Skip to content

Commit 049f228

Browse files
committed
gh-153569: keep token span invariants explicit
1 parent fa4714d commit 049f228

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Parser/lexer/lexer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ _PyToken_TextView(const struct tok_state *tok, const struct token *token,
1717
*length = 0;
1818
return "";
1919
}
20+
assert(_PyTok_SpanIsValid(token->span));
2021
assert(tok->buf != NULL);
2122
assert(tok->inp >= tok->buf);
2223
assert(token->span.start >= tok->buf_offset);

0 commit comments

Comments
 (0)