-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Leex line wrap issue #431
Leex line wrap issue #431
Conversation
Patch has passed first testings and has been assigned to be reviewed I am a script, I am not human |
I've just noticed, may be the same fix is necessary for token, tokens, and skip_token functions |
">>, | ||
Dir = ?privdir, | ||
XrlFile = filename:join(Dir, "test_line_wrap.xrl"), | ||
?line ok = file:write_file(XrlFile, Xrl), |
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.
?line
is deprecated.
Also, please read https://github.com/erlang/otp/wiki/Writing-good-commit-messages. |
The fix for 'token' and 'tokens' functions is ready. |
The summary line of the commit message is too long and/or ends with a "." I am a script, I am not human |
The line counter becomes invalid, when the rules with linewrap are used. This issue appears, because the parsing FSM does not rollback the line counter after attempting such rule.
The line counter becomes invalid, when the rules with linewrap are used. This issue appears, because the parsing FSM does not rollback the line counter after attempting such rule. Unit tests for 'token' and 'tokens' are also added.
Patch has passed first testings and has been assigned to be reviewed I am a script, I am not human |
See https://bugs.erlang.org/browse/ERL-263 The fix in commit c9bc5c9 of PR-431 (erlang#431) introduced new problems.
Looks like there is a bug with line counting in parsetools. To reproduce it, create test.xrl:
and run:
Parser detects three lines instead of two in the input
The only cause, I found here, is pushing back an newline:
Note that pushing back a newline will mean the line numbering will no longer be correct.
However, there is no any character back-off.
In my opinion, this issue appears, because the parsing FSM does not rollback the line counter after attempting the first rule "[a]+[\n]*=".
I'm not sure, the patch will not break something else :) But the existing unit tests are passed, so I hope, it would be useful.
Here is the dbg trace. You can notice the moment, when the line counter becomes invalid.