Closed markwpearce closed 1 month ago
code like this:
sub foo(t) t += 1 end sub
used to be an assignment statement, with a binary Expression... eg:
Assignment (t, '=') -> BinaryExpression (t, '+=', 1)
which included "t" twice
This is changed to a single AugmentedAssignmentStatement
AugmentedAssignmentStatement
AugmentedAssignment (t, '+=', 1)
Additionally, this PR makes sure the parser only builds Assignments (including typed Assignments) when it is allowed to.
I also added tests for AugmentedAssignmentStatement and IncrementStatement
IncrementStatement
Addresses #1186
code like this:
used to be an assignment statement, with a binary Expression... eg:
which included "t" twice
This is changed to a single
AugmentedAssignmentStatement
Additionally, this PR makes sure the parser only builds Assignments (including typed Assignments) when it is allowed to.
I also added tests for
AugmentedAssignmentStatement
andIncrementStatement
Addresses #1186