Proper positions for synthetic tokens

This commit is contained in:
John Doty 2024-06-09 07:24:19 -07:00
parent 0c3e6b211c
commit a3786c62ba

View file

@ -400,8 +400,9 @@ class Parser:
# Insert a token into the stream.
# Need to advance the cursor to compensate.
assert repair.value is not None
pos = input[cursor].end
input.insert(
cursor, TokenValue(kind=repair.value, start=-1, end=-1)
cursor, TokenValue(kind=repair.value, start=pos, end=pos)
)
cursor += 1