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

Associativity of multiplication / division #6

Closed
laurmaedje opened this issue Jul 26, 2020 · 1 comment
Closed

Associativity of multiplication / division #6

laurmaedje opened this issue Jul 26, 2020 · 1 comment

Comments

@laurmaedje
Copy link
Member

The current parser implementation has the problem that the associativity of multiplication and division is reversed. Thus, 3 / 4 * 5 is parsed as 3 / (4 * 5) instead of the correct (3 / 4) * 5. The current approach of parsing the left-hand side of an expression one precendence-level lower and the right-hand side at the same level won't work now since making the left-hand side same level would make the parser left-recursive (infinite recursion). The best approach is probably to parse operands in a loop.

@laurmaedje
Copy link
Member Author

This can be closed once #7 is merged.

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

No branches or pull requests

1 participant