FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors by pablogsal · Pull Request #112410 · python/cpython · GitHub

Repository navigation

gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors - #112410

Merged
pablogsal merged 1 commit into
python:mainfrom
pablogsal:gh-112388
Nov 27, 2023
Merged

pablogsal merged 1 commit into
python:mainfrom
pablogsal:gh-112388

Conversation

pablogsal commented Nov 25, 2023 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

…verwrite tokenizer errors

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>

Copy link
Copy Markdown
Contributor

Maybe scope creep, but is there an opportunity for an improvement here?

_PyPegen_raise_error always returns NULL - maybe it should be void.

sunmy2019 added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 27, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @sunmy2019 for commit cef5ae9 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 27, 2023

sunmy2019 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good

Copy link
Copy Markdown
Member

_PyPegen_raise_error always returns NULL - maybe it should be void.

We need a placeholder here. If you track the caller, it's like

void *a;
if (all_good)
    a = ...;
else
    a = _PyPegen_raise_error(...);

lysnikolaou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

Copy link
Copy Markdown
Member

_PyPegen_raise_error always returns NULL - maybe it should be void.

Most of the time we assign the return value of _PyPegen_raise_error to the variable returned by the rule. This is a "hack" to set a specific error from a grammar action, but still signify to the parser that the rule has failed and it should backtrack all the way.

pablogsal added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Nov 27, 2023
pablogsal merged commit 2c8b191 into python:main Nov 27, 2023
pablogsal deleted the gh-112388 branch November 27, 2023 18:36

Copy link
Copy Markdown

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 27, 2023
…verwrite tokenizer errors (pythonGH-112410)

(cherry picked from commit 2c8b191)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>

bedevere-app Bot commented Nov 27, 2023

Copy link
Copy Markdown

GH-112466 is a backport of this pull request to the 3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 27, 2023
…verwrite tokenizer errors (pythonGH-112410)

(cherry picked from commit 2c8b191)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
bedevere-app Bot removed the needs backport to 3.12 only security fixes label Nov 27, 2023

bedevere-app Bot commented Nov 27, 2023

Copy link
Copy Markdown

GH-112467 is a backport of this pull request to the 3.11 branch.

bedevere-app Bot removed the needs backport to 3.11 only security fixes label Nov 27, 2023
pablogsal added a commit that referenced this pull request Nov 27, 2023
…overwrite tokenizer errors (GH-112410) (#112467)

gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (GH-112410)
(cherry picked from commit 2c8b191)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Nov 27, 2023
…overwrite tokenizer errors (GH-112410) (#112466)

gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (GH-112410)
(cherry picked from commit 2c8b191)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…verwrite tokenizer errors (python#112410)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…verwrite tokenizer errors (python#112410)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL