You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something I just noticed while implementing error reporting for my parser - every time I add a new line to my input file, the column number goes out of sync by +1 (and then eventually the line number too, when it hits the end of the line). That smelt of line ending weirdness to me, so I switched my editor from CRLF to LF - sure enough, everything lines back up.
So, in other words, it looks like pos_to_line in the generated code doesn't take into account the fact that a CRLF line ending is 2 bytes long. I'm guessing this hasn't been caught yet cause most people are using this library/Rust on Linux, where LF is the default.
This isn't a huge issue, as I can work around it by stripping out \r characters before the parsing stage, but I thought I should bring it to your attention at least!
Thanks for all your hard work on this library, by the way! By far the most fun I've had writing parsers ❤️
The text was updated successfully, but these errors were encountered:
Something I just noticed while implementing error reporting for my parser - every time I add a new line to my input file, the column number goes out of sync by +1 (and then eventually the line number too, when it hits the end of the line). That smelt of line ending weirdness to me, so I switched my editor from CRLF to LF - sure enough, everything lines back up.
So, in other words, it looks like
pos_to_line
in the generated code doesn't take into account the fact that a CRLF line ending is 2 bytes long. I'm guessing this hasn't been caught yet cause most people are using this library/Rust on Linux, where LF is the default.This isn't a huge issue, as I can work around it by stripping out
\r
characters before the parsing stage, but I thought I should bring it to your attention at least!Thanks for all your hard work on this library, by the way! By far the most fun I've had writing parsers ❤️
The text was updated successfully, but these errors were encountered: