Marist-CMPT331-TOPL / adder

Adder is a small but usable subset of the Python language. It is named for the Blackadder comedy series, much as the Python language is named for Monty Python.
MIT License
0 stars 2 forks source link

Interpret augmented assignment #46

Open Tientuine opened 1 year ago

Tientuine commented 1 year ago

@Marist-CMPT331-TOPL/students

The interpreter should know how to correctly execute an augmented assignment statement by implementing the corresponding semantic rule(s).

  1. [ ] Add a case to resultOf for AugmentedAssignmentStmt that uses valueOf to evaluate the necessary, implicit BinaryExpr in order to compute the right-hand side and then update the variable in the free store.

Note: This will serve as an initial implementation. Perhaps later someone can update this to handle more general left-hand sides besides just simple identifiers.