commit 1753cb5a50af49527349b0f8020acadd226ffc15
parent 82c8c704ce0f8b79c61b769f88c41bd957161f2d
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 20 Apr 2021 08:28:40 -0400
hare::parse: fix indirect assignment to non-objsel
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hare/parse/+test/expr.ha b/hare/parse/+test/expr.ha
@@ -3,6 +3,7 @@
x = y;
*x = *y + 10;
*x = *foo();
+ *y() = bar();
x += 10;
x -= 10;
x *= 10;
diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha
@@ -54,7 +54,7 @@ export fn expression(lexer: *lex::lexer) (ast::expr | error) = {
};
synassert(mkloc(lexer),
- expr is ast::access_expr || expr is ast::slice_expr,
+ expr is ast::access_expr || expr is ast::slice_expr || indirect,
"Expected an object-selector or slice for assignment target")?;
return ast::assign_expr {