Add index assignment and augmented assignment
This allows for syntax like `foo['a'] = 1` and more complex assignments like `foo.bar()[a() + b()] += 1` Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -256,6 +256,9 @@ GENERATE = [
|
||||
.add_struct("Import", ["import_kw: Token", "what: Vec<Token>", "module: Token"])
|
||||
.add_struct("Expr", ["expr: ExprP"])
|
||||
.add_struct("Assign", ["lhs: Token", "op: Token", "rhs: ExprP"])
|
||||
.add_struct(
|
||||
"IndexAssign", ["expr: ExprP", "index: ExprP", "op: Token", "rhs: ExprP"]
|
||||
)
|
||||
.add_struct("Set", ["expr: ExprP", "name: Token", "op: Token", "rhs: ExprP"])
|
||||
.add_struct("Block", ["lbrace: Token", "stmts: Vec<StmtP>", "rbrace: Token"])
|
||||
.add_struct("Return", ["return_kw: Token", "expr: Option<ExprP>"])
|
||||
|
||||
Reference in New Issue
Block a user