Fields are 1 indexed since that is how most text editors display line and character (UTF-16 code-unit) positions. The start numbers are inclusive, and the end numbers are exclusive, so the number of characters in a token is (startCharInFile - endCharInFile).
Line numbers are 1 greater than the number of line breaks where a line-break is defined greedily as one of {{{CR}}}, {{{LF}}}, {{{CRLF}}}. Bash, javascript, or python style line-continuations like
a, b, c = 0, 1, \ 2are treated as line breaks. Line numbers are determined solely based on the characters in the file and do not represent a logical unit of a program.
File Positions are independent of the language being parsed. @author mikesamuel@gmail.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|