Skip to content

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

Merged
miss-islington merged 3 commits into
python:masterfrom
lysnikolaou:refactor-pegen
May 27, 2020
Merged

Refactor error handling code in Parser/pegen/pegen.c#20440
miss-islington merged 3 commits into
python:masterfrom
lysnikolaou:refactor-pegen

Conversation

@lysnikolaou

@lysnikolaou lysnikolaou commented May 26, 2020

Copy link
Copy Markdown
Member

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.
Comment thread Parser/pegen/pegen.c Outdated
Comment thread Parser/pegen/pegen.c
@lysnikolaou lysnikolaou requested a review from gvanrossum May 27, 2020 15:37
@gvanrossum

Copy link
Copy Markdown
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
Copy Markdown
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

lysnikolaou commented May 27, 2020

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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
Copy Markdown
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