hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 8418a9af181c31f956d912e16a954b968dc3401e
parent 87a80a82b7490f7fad4efb538520a8369cb1b76b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 16 Apr 2021 09:54:45 -0400

hare::parse: remove workaround for #377

Diffstat:
Mhare/parse/expr.ha | 14+++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha @@ -208,17 +208,13 @@ fn postfix(lexer: *lex::lexer, lvalue: (ast::expr | void)) (ast::expr | error) = ex: ast::expr => ex, }; - match (try(lexer, ltok::LPAREN, ltok::DOT, ltok::LBRACKET, ltok::QUESTION)) { + lvalue = match (try(lexer, ltok::LPAREN, + ltok::DOT, ltok::LBRACKET, ltok::QUESTION)) { tok: lex::token => switch (tok.0) { - ltok::LPAREN => lvalue = call(lexer, lvalue)?, - ltok::DOT => lvalue = postfix_dot(lexer, lvalue)?, + ltok::LPAREN => call(lexer, lvalue)?, + ltok::DOT => postfix_dot(lexer, lvalue)?, ltok::LBRACKET => abort(), // TODO: Indexing - ltok::QUESTION => { - // Crappy workaround for harec bug - // https://todo.sr.ht/~sircmpwn/hare/377 - let new = alloc(lvalue): ast::propagate_expr; - lvalue = new; - }, + ltok::QUESTION => alloc(lvalue): ast::propagate_expr, * => abort(), }, void => return lvalue,