From a3786c62bafccd097be635c720470826b02cde33 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sun, 9 Jun 2024 07:24:19 -0700 Subject: [PATCH] Proper positions for synthetic tokens --- harness.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/harness.py b/harness.py index f4b0264..3eb8560 100644 --- a/harness.py +++ b/harness.py @@ -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