Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the position information in AST nodes created by the parser is always consistent #93351

Closed
pablogsal opened this issue May 30, 2022 · 2 comments · Fixed by #93352
Closed

Ensure the position information in AST nodes created by the parser is always consistent #93351

pablogsal opened this issue May 30, 2022 · 2 comments · Fixed by #93352
Labels
3.10 3.11 3.12 interpreter-core

Comments

@pablogsal
Copy link
Member

@pablogsal pablogsal commented May 30, 2022

If we create an AST node with invalid position information, the error is reported in the compiler when it validates the line numbers and end line numbers, which is too far away and debugging this can be quite challenging. To improve the debugging experience, ensure that the parser cannot create an AST node with invalid position information.

pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
@AA-Turner AA-Turner added interpreter-core 3.11 3.10 3.12 labels May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2022
pablogsal added a commit that referenced this issue May 30, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2022
…by the parser is always consistent (pythonGH-93352)

(cherry picked from commit 5893b5d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
miss-islington added a commit that referenced this issue May 30, 2022
… parser is always consistent (GH-93352)

(cherry picked from commit 5893b5d)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
@hauntsaninja
Copy link
Contributor

@hauntsaninja hauntsaninja commented Jul 23, 2022

This broke a project of mine https://github.com/hauntsaninja/pyp that does some AST tricks. Worth adding a news entry (possibly to Python 3.11 What's New as well)?

@pablogsal
Copy link
Member Author

@pablogsal pablogsal commented Jul 23, 2022

I will add a news entry for this

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 23, 2022
…thongh-93351 (pythonGH-95175)

(cherry picked from commit 9762572d0aa3569ba82eeceb708ddea9f12918fd)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 23, 2022
…thongh-93351 (pythonGH-95175)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue Jul 23, 2022
…s in pythongh-93351 (pythonGH-95175)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this issue Jul 23, 2022
…h-93351 (GH-95175) (#95178)

(cherry picked from commit 9762572)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 3.11 3.12 interpreter-core
Projects
None yet
3 participants