summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-23 21:55:58 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-23 21:55:58 +0200
commit04fb8b288aa7c80607da79db7d085a4820b95a9d (patch)
tree7ca96d09d511274ebac298c329d5eef53a290d9c /src/parse
parent7a2cc3e7d29d16c5cf9b5a93a688e14da93c8662 (diff)
Show rules with type ascribed object
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/mod.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs
index c387de0c..b27af08f 100644
--- a/src/parse/mod.rs
+++ b/src/parse/mod.rs
@@ -809,19 +809,10 @@ fn show_expr(p: &mut Parser) -> ParseResult {
p.perform(NodeKind::ShowExpr, |p| {
p.eat_assert(&NodeKind::Show);
ident(p)?;
- if !p.at(&NodeKind::LeftParen) {
- p.expected_found("parameter list");
- return Err(ParseError);
- }
- p.perform(NodeKind::ClosureExpr, |p| {
- let marker = p.marker();
- p.start_group(Group::Paren);
- collection(p);
- p.end_group();
- params(p, marker);
- p.eat_expect(&NodeKind::As)?;
- expr(p)
- })
+ p.eat_expect(&NodeKind::Colon)?;
+ ident(p)?;
+ p.eat_expect(&NodeKind::As)?;
+ expr(p)
})
}