summaryrefslogtreecommitdiff
path: root/Parser/pegen_errors.c
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2022-10-06 16:07:17 -0700
committerGitHub <noreply@github.com>2022-10-06 16:07:17 -0700
commitcbf0afd8a1474d68310331af9218606959d4cc22 (patch)
treecd421653d73d25c89fa8c02e5819517efa76f7b3 /Parser/pegen_errors.c
parentb9d2e8171696514e9226164005f7bf24bf69e66d (diff)
downloadcpython-git-cbf0afd8a1474d68310331af9218606959d4cc22.tar.gz
gh-97973: Return all necessary information from the tokenizer (GH-97984)
Right now, the tokenizer only returns type and two pointers to the start and end of the token. This PR modifies the tokenizer to return the type and set all of the necessary information, so that the parser does not have to this.
Diffstat (limited to 'Parser/pegen_errors.c')
-rw-r--r--Parser/pegen_errors.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Parser/pegen_errors.c b/Parser/pegen_errors.c
index 95bbd43dc3..7738cbaf9e 100644
--- a/Parser/pegen_errors.c
+++ b/Parser/pegen_errors.c
@@ -164,11 +164,10 @@ _PyPegen_tokenize_full_source_to_check_for_errors(Parser *p) {
Py_ssize_t current_err_line = current_token->lineno;
int ret = 0;
+ struct token new_token;
for (;;) {
- const char *start;
- const char *end;
- switch (_PyTokenizer_Get(p->tok, &start, &end)) {
+ switch (_PyTokenizer_Get(p->tok, &new_token)) {
case ERRORTOKEN:
if (p->tok->level != 0) {
int error_lineno = p->tok->parenlinenostack[p->tok->level-1];