-
Notifications
You must be signed in to change notification settings - Fork 422
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
[DNM][SE-NNNN] Parse is case
#1414
base: main
Are you sure you want to change the base?
[DNM][SE-NNNN] Parse is case
#1414
Conversation
@@ -735,7 +735,7 @@ public enum Keyword: UInt8, Hashable { | |||
} | |||
} | |||
|
|||
/// Whether the token kind is switched from being an identifier to a keyword in the lexer. | |||
/// Whether the token kind is switched from being an identifier to being an identifier to a keyword in the lexer. |
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.
This is generated. I don't know what's causing the duplicate words here.
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.
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.
Opened #1421 for this.
@swift-ci please test |
I haven’t read the entire proposal pitch but allowing value bindings in
The compiler still uses the C++ parser so you’ll need to implement the same in the C++ parser as well. |
e0ff5ef
to
d1afd93
Compare
Yes, in Jordan's pitch the intention is not allowing value-binding in |
d1afd93
to
2bd28cc
Compare
2bd28cc
to
c18d0d0
Compare
@swift-ci please test |
Thanks for the explanation and sorry for not reading the entire thread. I imagine this is something that needs to be discussed in the Swift Evolution proposal, so I won’t leave any comment on personal preference here. |
A small piece of the puzzle.
This PR allows SwiftSyntax to parse
is case
pattern patching expressions, as pitched on the forums.2 questions for reviewers:
Currently as implemented, this PR allows
is case
to be used with value-binding like this:My intention is to allow value-bindings like this only inside conditions:
Is it possible to diagnose this on the syntactic level in this package? My understanding so far is that this can only be done during semantic analysis.
Is this parser used along with the old one written in C++ in the compiler, or is this the only one used? Do I need to re-implement the same logic in the C++ version too?