antlr-kotlin icon indicating copy to clipboard operation
antlr-kotlin copied to clipboard

Fix: Operator precedence is not respected

Open tianyu opened this issue 2 years ago • 3 comments

This PR contains a failing test showing that operator precedence is not respected.

~~No idea how to fix it, though :/~~ Fixed!

tianyu avatar Mar 11 '22 21:03 tianyu

Actually, I'm having trouble parsing expressions like a - b + c.

  • It should be interpreted as (a - b) + c,
  • Instead it's interpreted as a - (b + c).

It makes a big difference!

tianyu avatar Mar 12 '22 00:03 tianyu

@yaccoff @ftomassetti I you can point me in the right direction of where the bug could be, I'd happily try to contribute a fix.

tianyu avatar Mar 13 '22 23:03 tianyu

@ftomassetti I was able to apply the patch from @atsushieno and fix the failing unit test! Please take a look!

tianyu avatar Mar 14 '22 13:03 tianyu

@ftomassetti, will you take a look?

tianyu avatar Mar 13 '23 14:03 tianyu

Included in #107 , so closing

ftomassetti avatar Dec 06 '23 15:12 ftomassetti