Report LexerEmptyModeStackException instead of throwing empty stack exception
fixes #2006
Fixed for Java, C#, Python2/3, JavaScript, Go runtimes Need to be fixed: C++, Swift, Dart, PHP
@parrt could you review this draft? If you agree with it, I'll complete other runtimes soon (C++, Swift, Dart, PHP).
at first glance this seems reasonable, but I'm always hesitant to add another class. Of course this is only an exception class so not a huge technical burden/debt. @ericvergnaud does this look ok? I definitely think it should avoid crashing for this error.
Hi,
I don’t disagree with the proposed change, but given the scope I suggest we postpone it to the next release. This will buy us time to calmly and collectively assess the impact.
Eric
Le 29 oct. 2021 à 01:34, Ivan Kochurkin @.***> a écrit :
@KvanTTT commented on this pull request.
In runtime/CSharp/src/Lexer.cs https://github.com/antlr/antlr4/pull/3317#discussion_r738841798:
@@ -553,12 +556,13 @@ public virtual void Recover(LexerNoViableAltException e) } }
public virtual void NotifyListeners(LexerNoViableAltException e)But it's not possible for dynamic languages (Python, Javascript), since they don't support method overloading.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/antlr/antlr4/pull/3317#discussion_r738841798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZNQJCXZLITM3JMZBBBS5DUJHMZ3ANCNFSM5GV6NNDA.
Ok, let's postpone this bug fix until the next release.