1
Vote

Scanner returns incorrect token offsets when reading files with non-native newlines

description

When parsing Windows files on Linux the tokens returned by the scanner have incorrect offsets.

This is because the scanner keeps a running total of the number of characters read (mOffset) by adding the current line's length plus Environment.NewLine.Length. When the environment's newline differs from the file's the offset becomes invalid.

comments