-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Unsupported statement #1519
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
Unsupported statement #1519
Conversation
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
Parallel Test execution Gradle Caching Explicitly request for latest JavaCC 7.0.10
- Add Feature allowUnsupportedStatement, default=false - Fully implement UnsupportedStatement for the Statement() production - Partially implement UnsupportedStatement for the Statements() production, works only when UnsupportedStatement comes first
Disable STATEMENTS() test, which will never fail and add comments to this regard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I will merge. I find the idea of parsing without exceptions very attractive. :)
try { | ||
(stm = SingleStatement() | stm = Block()) { list.add(stm); } <ST_SEMICOLON> | ||
( (stm = SingleStatement() | stm = Block()) <ST_SEMICOLON> { list.add(stm); } )* | ||
( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I find your version much harder to read.
I like this. Any idea when this is going to be released? |
At the moment I am deploying a new SNAPSHOT version. To be honest releasing this was not yet a plan, since version 4.4 was released recently. |
Implement
Unsupported statement
, which will return any unparsable statement or fragment as a list of tokens.This Feature is OFF by default and can be activated on demand:
However, there are 2 caveats:
BEGIN ... END
blocks (because its hard to distinguish theEND
token from anUnsupported Statement
Statements()
production since the neededLOOKAHEAD
does not work, but results in a stack overflow (maybe a JavaCC bug)Also
IF ... ELSE ...
has not been considered yet. I do not think, it is relevant.Fixes #1510