Empty Alternative inside Nested Repetitions causes infinite loops on Parser initilization
See original GitHub issueI’m sure this was a grammar error on my part, but just wanted to let you know it’s possible to get into a loop state while performing self-analysis.
The loop is like this:
at possiblePathsFrom (/git/chevrotain/src/parse/grammar/interpreter.ts:287:14)
at getAlternativesForProd (/git/chevrotain/src/parse/grammar/interpreter.ts:265:24)
at possiblePathsFrom (/git/chevrotain/src/parse/grammar/interpreter.ts:322:16)
at getAlternativesForProd (/git/chevrotain/src/parse/grammar/interpreter.ts:265:24)
at possiblePathsFrom (/git/chevrotain/src/parse/grammar/interpreter.ts:322:16)
at getAlternativesForProd (/git/chevrotain/src/parse/grammar/interpreter.ts:265:24)
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Empty Alternative inside Nested Repetitions causes infinite ...
Yes, it was fixable by changing grammar. I'm trying to think of the scenarios where I encountered this. It's happened to me a...
Read more >Hibernate @OneToMany Relationship Causes Infinite Loop ...
Solution: Use. @JsonManagedReference annotation for the first objects instantiated. @JsonBackReference annotation for the second objects ...
Read more >Top 4 Types of Statements in Python Infinite Loop - eduCBA
An Infinite Loop in Python is a continuous repetitive conditional loop that gets executed until an external factor interferes in the execution flow, ......
Read more >Detecting and Escaping Infinite Loops with Jolt - Research
Specifi- cally, Jolt records the program state at the start of each loop iteration. If two consecutive loop iterations produce the same state,...
Read more >changes/CHANGELOG.md - Chevrotain
Empty Alternative inside Nested Repetitions causes infinite loops on Parser ... Provides a ~20% performance boost to most parsers initialization time.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The phase that causes the infinite loop does not take into account the GATEs at all. I hope to have time on the weekend to debug the reproduce-able example farther.
I can reproduce the issue with this small example: