Closed hchiam closed 7 years ago
Problem identified: Debug printout shows line 3 has cow
assigned to None
when it should be cow:-3
. I think it's that the assign statement is preventing variable name replacement.
Fix identified: change that suppression of variable name replacement for assign statements no longer true but only let it replace before the to
keyword.
Another fix identified: math replacements not recognizing negative numbers.
Also fix check_variable() to not create new variable names in variable_dictionary when doing assigning.
Now can do:
please assign minus one minus one to variable cow
please print minus one minus one equals variable cow
please assign variable cow minus one to cow
please print cow minus one equals variable cow
--> This outputs:
minus one minus one equals -2
cow minus one equals -3
please assign minus one minus one to variable cow please print variable cow please assign variable cow minus one to variable cow please print variable cow minus one please print variable cow