fix function call parsing
was broken by commit #ac6cc21
This commit is contained in:
parent
828b84e1cc
commit
fe27d20130
1 changed files with 4 additions and 3 deletions
|
@ -449,7 +449,9 @@ atom(ParserState *ps)
|
|||
}
|
||||
return tree;
|
||||
case T_LPAREN:
|
||||
return expr(ps, EXPR_INIT_PREC);
|
||||
tree = expr(ps, EXPR_INIT_PREC);
|
||||
next_match(ps->lexer, T_RPAREN);
|
||||
return tree;
|
||||
default:
|
||||
parse_error(ps, "expected a number, identifier or expression, not '%s'", TokenIdStr[t.id]);
|
||||
free(tree);
|
||||
|
@ -484,10 +486,9 @@ expr(ParserState *ps, int minprec)
|
|||
Ast *tree = unary(ps);
|
||||
for (;;) {
|
||||
LexToken t = lex_scan(ps->lexer);
|
||||
if (t.id == T_RPAREN)
|
||||
break;
|
||||
if (!token_is_binop(t.id)
|
||||
|| t.id == T_END
|
||||
|| t.id == T_RPAREN
|
||||
|| OperatorTable[t.id].pred < minprec) {
|
||||
lex_backup(ps->lexer, t);
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue