Fix end of file error reporting
This commit is contained in:
parent
22029edbb2
commit
07164d51a0
1 changed files with 2 additions and 2 deletions
|
|
@ -157,8 +157,8 @@ def parse(table: parser.ParseTable, tokens, trace=None) -> typing.Tuple[Tree | N
|
||||||
for (kind, start, length) in input_tokens
|
for (kind, start, length) in input_tokens
|
||||||
]
|
]
|
||||||
|
|
||||||
assert "$" not in input
|
eof = 0 if len(input) == 0 else input[-1].end
|
||||||
input = input + [TokenValue(kind="$", start=-1, end=-1)]
|
input = input + [TokenValue(kind="$", start=eof, end=eof)]
|
||||||
input_index = 0
|
input_index = 0
|
||||||
|
|
||||||
threads = [
|
threads = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue