◐ Shell
clean mode source ↗

Fix lookahead of soft keywords in the PEG parser by pablogsal · Pull Request #20436 · python/cpython

@pablogsal

I was playing a bit with the feature and realized that we missed the lookahead code.

@lysnikolaou

When were soft keywords added? I can't remember us implementing that.

@pablogsal

When were soft keywords added? I can't remember us implementing that.

#20370

pablogsal

gvanrossum

Choose a reason for hiding this comment

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

Okay, everything else LGTM. I now remember noticing this (during my hack to add a print statement) and thinking "oh, I need to add _PyPegen_lookahead_with_string" -- and then forgetting about it.

gvanrossum

Choose a reason for hiding this comment

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

Thanks!

@lysnikolaou

When were soft keywords added? I can't remember us implementing that.

#20370

Nice.

@gvanrossum

There's one caveat: we need to remind people to use 'single' quotes for keywords, not "double" quotes. This happens to be the current convention but it may be surprising to people that it matters, and some folks may just automatically type "double" quotes.

@pablogsal

There's one caveat: we need to remind people to use 'single' quotes for keywords, not "double" quotes. This happens to be the current convention but it may be surprising to people that it matters, and some folks may just automatically type "double" quotes.

That could be on the "new parser guide" on the dev guide. I was preparing something for that, but I am currently waiting to see how we want to approach #19969 first.

@miss-islington

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

lysnikolaou added a commit to lysnikolaou/cpython that referenced this pull request

May 27, 2020

pablogsal pushed a commit that referenced this pull request

May 27, 2020