From ee27095fb3b2ccb0adc216970abb549249545008 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 29 Feb 2024 19:33:28 -0600 Subject: [PATCH] parser: expand the possibilities for assignment locations This may be reverted later. TODO: Formalize the concept of a place expression TODO: Add this to grammar.ebnf --- libconlang/src/parser.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libconlang/src/parser.rs b/libconlang/src/parser.rs index 88ff585..3f1925b 100644 --- a/libconlang/src/parser.rs +++ b/libconlang/src/parser.rs @@ -889,7 +889,11 @@ impl<'t> Parser<'t> { /// [Assign] = [Path] ([AssignKind] [Assign]) | [Compare](Binary) pub fn exprkind_assign(&mut self) -> PResult { let head = self.expr_from(Self::exprkind_compare)?; - if !matches!(head.kind, ExprKind::Path(_)) { + // TODO: Formalize the concept of a "place expression" + if !matches!( + head.kind, + ExprKind::Path(_) | ExprKind::Call(_) | ExprKind::Member(_) | ExprKind::Index(_) + ) { return Ok(head.kind); } let Ok(op) = self.assign_op() else {