docs: clarify end_column value

I interpreted "the column where the token ends" to mean "a pointer
to the last character in the token", which would be the same as
the start column for a single-character token.

However, that's not what lark actually reports. Reword to clarify
this.

https://github.com/lark-parser/lark/issues/240
This commit is contained in:
Daniel Drake 2018-09-28 15:50:31 +08:00
parent a6c84e610e
commit 01cfe322a1
1 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,7 @@ When using a lexer, the resulting tokens in the trees will be of the Token class
* `line` - The line of the token in the text (starting with 1)
* `column` - The column of the token in the text (starting with 1)
* `end_line` - The line where the token ends
* `end_column` - The column where the token ends
* `end_column` - The next column after the end of the token. For example, if the token is a single character with a `column` value of 4, `end_column` will be 5.
## UnexpectedInput
@ -216,4 +216,4 @@ Accepts the parse function (usually `lark_instance.parse`) and a dictionary of `
The function will iterate the dictionary until it finds a matching error, and return the corresponding value.
For an example usage, see: [examples/error_reporting_lalr.py](https://github.com/lark-parser/lark/blob/master/examples/error_reporting_lalr.py)
For an example usage, see: [examples/error_reporting_lalr.py](https://github.com/lark-parser/lark/blob/master/examples/error_reporting_lalr.py)