Skip to content

Commit 7e5d82c

Browse files
committed
gh-153569: remove obsolete tokenizer cursor checks
1 parent dee8cf3 commit 7e5d82c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Parser/lexer/lexer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ _PyLexer_get_normal(struct tok_state *tok, ftstring_state *current, struct token
269269

270270
tok->start = tok->cur;
271271
tok->start_loc = (_PyTok_Loc){
272-
tok->lineno, tok->cur >= 0 ? _PyLexer_ByteColumn(tok) : -1};
272+
tok->lineno, _PyLexer_ByteColumn(tok)};
273273

274274
/* Return pending indents/dedents */
275275
if (tok->pendin != 0) {
@@ -303,9 +303,9 @@ _PyLexer_get_normal(struct tok_state *tok, ftstring_state *current, struct token
303303
} while (c == ' ' || c == '\t' || c == '\014');
304304

305305
/* Set start of current token */
306-
tok->start = tok->cur < 0 ? -1 : tok->cur - 1;
306+
tok->start = tok->cur - 1;
307307
tok->start_loc = (_PyTok_Loc){
308-
tok->lineno, tok->cur >= 0 ? _PyLexer_ByteColumn(tok) - 1 : -1};
308+
tok->lineno, _PyLexer_ByteColumn(tok) - 1};
309309

310310
/* Skip comment, unless it's a type comment */
311311
if (c == '#') {

0 commit comments

Comments
 (0)