ndmitchell / record-dot-preprocessor

A preprocessor for a Haskell record syntax using dot
Other
129 stars 19 forks source link

Fix lexer cursor repositioning #53

Closed otto-dev closed 2 years ago

otto-dev commented 2 years ago

lexeme ++ whitespace was in the wrong order. This matters because any newline characters in either lexeme orwhitespace will reset the column number in reposition. Therefore the two strings must be concatenated in the same order in which they where lexed, otherwise newlines in the whitespace portion won't reset the column correctly.

I don't know if this matters for record-dot-preprocessor, but I was working on an indentation aware fork of this repo where this caused issues that took time to track down.

ndmitchell commented 2 years ago

Thanks!