Eric Milles created GROOVY-12435:
------------------------------------

             Summary: carriage-return only line ending does not increment line 
number
                 Key: GROOVY-12435
                 URL: https://issues.apache.org/jira/browse/GROOVY-12435
             Project: Groovy
          Issue Type: Bug
          Components: parser-antlr4
    Affects Versions: 6.0.0, 5.1.3, 4.0.33, 3.0.25
            Reporter: Eric Milles
         Attachments: LineEndings.groovy, image-2026-09-30-09-41-06-973.png

[^LineEndings.groovy]I had a source file with mixed line endings that caused a 
lot of trouble with the editor. I traced this back to the parser's handling of 
line endings. It seems when a line ending is just a carriage-return (\r) the 
line number is not incremented.

!image-2026-09-30-09-41-06-973.png!

In this example, the import and script statement have lines 2 and 6 
respectively. They should be at lines 3 and 7 as can be seen by the line 
numbering in the editor's gutter. The antlr2 parser handled this case properly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to