Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LHS vs RHS in arithmetic expressions. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neighthan
Copy link

Fixes #19.

visit_div_expression already had the correct method of popping the RHS first then the LHS. However, plus, minus and mul all switched the order and called the first thing popped from the stack the LHS. For plus and mul, this doesn't affect the correctness, but it lead to minus being interpreted backwards (see the linked issue). I think this should fix that issue, but I'm not familiar with the code base, so please let me know if there are other places this change would need to be made too.

Fixes KCL-Planning#19.

`visit_div_expression` already had the correct method of popping the RHS first then the LHS. However, plus, minus and mul all switched the order and called the first thing popped from the stack the LHS. For plus and mul, this doesn't affect the correctness, but it lead to minus being interpreted backwards (see the linked issue). I think this should fix that issue, but I'm not familiar with the code base, so please let me know if there are other places this change would need to be made too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefix to infix notation
1 participant