Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Not A Bug
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.x+
-
Component/s: Windows
-
Labels:None
-
Environment:The problem is platform independent, it occures when having \r\n as a line delimiter. Those usually appear when creating/editing files under Windows.
-
Number of attachments :
Description
When working with a Ruby code file that contains \r\n as line delimiters, the position of ast-nodes at the end of a line have incorrect position information. Namely the position includes the \r which is in fact one character too much.
The position error origins in the wrappedRead() method of the LexerSource. There the a \r with following \n is jumped and the position increased, which results in a position that exceeds the actual position by one.
Proposed solution is not to skip the \r. Return it as result of wrappedRead() it then should be treated like a white space.
Fix seems good, and have been applied. Thanks Thomas.