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 condition expressions and statements #41

Open Tientuine opened 1 year ago

Tientuine commented 1 year ago

@Marist-CMPT331-TOPL/students Depends on #3 and part of #15 (for if-then ternary operator).

The interpreter should be able to handle conditional execution, in both statement and expression form.

  1. [ ] Add a case for to valueOf for IfExpr. This implementation should work almost exactly like the implementation of IfExp from the HOPL languages.
  2. [ ] Add a case for to resultOf for IfStmt. This implementation should work much like the implementation of IfStmt from the HOPL languages.

Note: This will serve as an initial implementation, and the statement-version will be extended later with elif branches.