Skip to content

Commit b5bdee3

Browse files
authored
Merge pull request #188 from structuredllm/bug
[Itergen] Fix bug
2 parents aa99020 + a120b41 commit b5bdee3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

syncode/parsers/itergen_parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ def _update_symbol_pos_map_terminals(self, lexer_tokens: Iterable[Token], parsed
102102

103103
# We don't add the last lexer token as it may change in the future
104104
# Essntially, we don't want IterGen to stop immediatelly after generating terminal which may extend in the future
105-
start_idx -= 1
105+
if start_idx > 0:
106+
start_idx -= 1
107+
106108
end_idx = len(lexer_tokens)-1
107109

108110
for idx in range(start_idx, end_idx):

0 commit comments

Comments
 (0)