Some expressions take an enormous amount of time to parse
See original GitHub issueHi there,
I’ve just upgraded from sly 2.7.0.3 to 2.7.0.5 and switched from using laborious manually-driven precedence to the lovely new built-in precedence support. However, a couple of my expressions work but are incredibly slow.
Here’s an example piece of code for a project I maintain. This commit moves me from 2.7.0.3 to 2.7.0.5, introduces bitwise ‘&’ and ‘|’ operators and moves to using [Operand]
, [Infix]
and [Prefix]
attributes: https://github.com/RoystonS/BetterBravoLights/commit/6d066a9f986da911992bc5978946550d7546a187
All of the tests pass, but two in particular are now incredibly slow. I’m not sure what’s going on - I’d expect them either to fail with some sort of stack overflow exception due to excessive recursion, or pass very quickly.
To reproduce, grab the above project at that commit, built it in VS2019 and run the unit tests.
The particular case that’s problematic is one that mixes unary minus with parenthetic grouping, i.e. -(1+2)
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (15 by maintainers)
Heya. Thanks for doing that. Yep, I’ll get that built up and tested, hopefully later today. I’ll also get you the other superpower branch to take a look at for comparison.
Yep, 2.8.0 looks absolutely fantastic. Outstanding job, sir - very much appreciated!