-
Notifications
You must be signed in to change notification settings - Fork 14
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
Parser fails with runaway group error if the last non-empty code line ends with a line comment #28
Comments
Files ending with line comments should not raise error.group_runaway
Proposed bugfix ridencww#28 integrated into Structorizer
A successfully tested bugfix proposal is available in pull request #29. |
Thank you for not only identifying an issue, but also supplying the fix. My time this week is limited, but early next week I will write a failing unit test, merge your PR, generate a new release, and upload it to Maven Central. I am glad to see others continue to use the Java engine and Devin's Builder, which is a good educational tool. |
Improved version of bugfix ridencww#28 (preserving the cut-off ultimate comment)
Fixes ridencww#28 (update Parser.java)
Revised the proposed fix. The first version had suppressed the comment token and yielded the EOF, the new one does it the other way round, which seemed more sensible, in particular with respect to issue #18). |
A quick update. last week I pulled the project down, updated the build file, and created a failing unit test. I ran out of time due to work constraints, but am picking this up again this week and making the actual code change. Will alert you when I've committed everything to the develop branch so you can have a look at it. |
If the parsed source file contains a line comment (provided of course that the used grammar specifies line comments) in the last non-empty code line then the parser fails with
error.group_runaway
, no matter whether the file ends with a newline or not. Even if hundreds of newlines follow, the parsing will fail.With end-standing block comments, the behaviour is correct (if the end symbol is missing, i.e., the group is actually unterminated then the error duefully occurs, otherwise it does not).
In the appendix, there is a combination of a Java grammar and a Java file that pass the test in GOLDBuilder but fail in the engine with the error described above.
final_line_comment_failure.zip
The text was updated successfully, but these errors were encountered: