Fix antlr/antlr4#1890 Standalone CR should be recognized as line separator#58
Fix antlr/antlr4#1890 Standalone CR should be recognized as line separator#58nixel2007 wants to merge 2 commits intotunnelvisionlabs:masterfrom
Conversation
|
The builds on CI servers failed |
|
Hi, @danielsun1106 I see an error in build logs: But I don't understand what exactly numbers after the second comma mean. Could you guide me about this a little? The first number is a token type, i suggest. And the second and the third ones? |
|
@nixel2007 I can not remember its meaning either... @sharwell should be able to tell us ;-) |
Note that I'm not planning to take this change. It should be possible to derive from the existing types in the library if you need to customize the token positioning mechanism. (It would have been better if tokens didn't track this information at all, but it's too late to remove now.) |
|
a-ha, test string contains standalone CR, so the second
could you point me to this classes/methods? I haven't digged it a lot, but I suppose that if I'll try to change token position somewhere else than |
|
@nixel2007 |
Did as you said, thank you. 1c-syntax/bsl-parser@86bbfc5#diff-9f09662df115bb4cb45e8ad2afc23bbdR25 |
|
You can generate your grammar as antlr4/tool/src/org/antlr/v4/tool/Grammar.java Lines 625 to 627 in bdcd934 |
|
Ok, i'll try it. thank you! |
|
@nixel2007 did you end up successfully overriding the |
|
@nmancus1 yep. I've created CRAwareLexerATNSimulator (https://github.com/1c-syntax/bsl-parser/blob/master/src/main/java/com/github/_1c_syntax/bsl/parser/CRAwareLexerATNSimulator.java) and pass it to lexer in |
Hello!
I've made changes to treat stand-alone CR as line separator.
This changes were tested on millions of LOC with-out any noticable perfomance regress. Also I use my fork to parse files everyday as a part of static analysis process.
P.S. Link to my PR to original ANTLR4 repo opened half an year ago...