Browse Source

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
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.5
Daniel Drake 6 years ago
parent
commit
01cfe322a1
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      docs/classes.md

+ 2
- 2
docs/classes.md 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)

Loading…
Cancel
Save