commit 9e79a852e49469a1d12b1a8e01e686fd3fea5204
parent 8a1b934aa1e0dc237f8005409afba12e347cd254
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 16 Apr 2021 15:48:05 -0400
hare::parse: improve call parsing
Diffstat:
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha
@@ -106,12 +106,9 @@ fn call(lexer: *lex::lexer, lvalue: ast::expr) (ast::expr | error) = {
void => void,
};
- match (try(lexer, ltok::COMMA)?) {
- lex::token => void,
- void => {
- want(lexer, ltok::RPAREN)?;
- break;
- },
+ switch (want(lexer, ltok::COMMA, ltok::RPAREN)?.0) {
+ ltok::RPAREN => break,
+ * => void,
};
};