Implement augmented assignment operators
Add support for +=, -=, *=, and /= operators. This is basically just
syntactic sugar, but it's still nice to have
a += 1
compiles to the equivalent of
a = a + 1
with all the same implications of scoping rules.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -234,7 +234,7 @@ GENERATE = [
|
||||
GenerateGroup("Stmt")
|
||||
.add_struct("Import", ["import_kw: Token", "what: Vec<Token>", "module: Token"])
|
||||
.add_struct("Expr", ["expr: ExprP"])
|
||||
.add_struct("Assign", ["lhs: Token", "rhs: ExprP"])
|
||||
.add_struct("Assign", ["lhs: Token", "op: Token", "rhs: ExprP"])
|
||||
.add_struct("Set", ["expr: ExprP", "name: 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