Skip to content

Refactor error handling code in Parser/pegen/pegen.c #20440

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

Merged
merged 3 commits into from
May 27, 2020

Conversation

lysnikolaou
Copy link
Member

@lysnikolaou lysnikolaou commented May 26, 2020

Set p->error_indicator in various places, where it's needed, but it's
not done.

Automerge-Triggered-By: @gvanrossum

Set p->error_indicator in various places, where it's needed, but it's
not done. Also refactor `_PyPegen_expect_soft_keyword` to avoid a
double call of `PyBytes_AsString` and a double check for the `NAME` type.
@lysnikolaou lysnikolaou requested a review from gvanrossum May 27, 2020 15:37
@gvanrossum
Copy link
Member

This is going to be tricky to backport to 3.9 unless we backport soft keywords too (which I am fine with TBH). Thoughts?

@miss-islington
Copy link
Contributor

@lysnikolaou: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 526e23f into python:master May 27, 2020
@lysnikolaou lysnikolaou deleted the refactor-pegen branch May 27, 2020 16:14
@lysnikolaou
Copy link
Member Author

lysnikolaou commented May 27, 2020

This is going to be tricky to backport to 3.9 unless we backport soft keywords too (which I am fine with TBH). Thoughts?

Certainly fine by me as well. Shouldn't we ask Łukasz first though, since soft keyword support is really on the edge of being a new feature for the parser?

@gvanrossum
Copy link
Member

It's a new feature for pegen, not for CPython. So I think it's fine as long as we don't start using soft keywords. (Adding aprint statement was fun but broke too many tests to be a clean easter egg.)

Note that there are two PRs you need to backport -- my original PR, and Pablo's PR to fix lookaheads.

@lysnikolaou
Copy link
Member Author

Ok, I'm on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants