-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add soft keywords #20370
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
Add soft keywords #20370
Conversation
Looks like the failing tests all have to do with print statements.
(UPDATE:) It does make me wonder if we shouldn't have a way to state that (certain) soft keywords should only be considered when the next character is a space. |
These are like keywords but they only work in context; they are not reserved except when there is an exact match. This would enable things like match statements.
Fixed an unfortunate interaction with the new |
A weak test would be adding something like this that uses the double quotes in the grammar and checks that |
Now with tests. I'd like to keep this as an easter egg, hence the skip issue label. No need to backport to 3.9 (unless you'd rather keep the source of Tools/peg_generator identical). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I left one question
@gvanrossum: Status check is done, and it's a success ✅ . |
These are like keywords but they only work in context; they are not reserved except when there is an exact match.
This would enable things like match statements without reserving
match
(which would be bad for there.match()
function and probably lots of other places).Automerge-Triggered-By: @gvanrossum