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

Assignment 3 #18

Closed Trent325 closed 1 year ago

Trent325 commented 1 year ago

I attempted to do assignment 3, it is probably wrong, so feedback is appreciated. Thank you

seanygberg commented 1 year ago

I think you have the right idea as to how everything should be implemented. The one thing I will say is when you define it in simple statement in the Parser, it think you just need (reserved "return" >> [expression] ) instead of (reserved "return" >> return [expression] ). I could be wrong, but I think that is how you could do it.

rvarca22 commented 1 year ago

Looks good to me. You should probably name your expression in Syntax "ReturnExpr" just to keep the naming convention for expressions in the language. Not sure if you're allowed to have a space in the name of an expression anyway.

I also agree with Sean's comment, the return statement in the Parser should read "reserved 'return' >> Expression" you don't need the second return