-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[ASTGen] Utilize base specific SyntaxEnum and start Pattern generation #69829
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
Conversation
|
@swift-ci Please smoke test |
hamishknight
left a comment
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.
Nice!
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.
If we're going to give these argument labels, should the optional variants also get them? Or is the intention to avoid the risk of recursion?
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.
Yes, I will add argument labels to all the existing generate(_:) functions in follow-ups.
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.
Did you mean
| // CodeBlockItem -> BraceStmt or IfStmt. | |
| // CodeBlockSyntax -> BraceStmt or IfStmt. |
Also, if this can become an IfStmt, can it also become a SwitchStmt?
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.
IfStmt was wrong. just CodeBlockSyntax -> BraceStmt
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.
Don’t we need to also check for PatternSyntax 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.
BridgedPattern is not an ASTNode at this point
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.
Oh, I see. 👍🏽
test/ASTGen/types.swift
Outdated
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.
Nit
| // rdar//116686158 | |
| // rdar://116686158 |
test/ASTGen/verify-parse.swift
Outdated
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.
Nit
| // rdar//116686158 | |
| // rdar://116686158 |
2eb5116 to
215abe6
Compare
|
@swift-ci Please smoke test |
{Decl|Stmt|Expr|Type|Pattern}SyntaxEnumintroduced in Add SyntaxEnum per base syntax kind swift-syntax#2351generate(_: Syntax)intogenerate(decl: DeclSyntax),generate(expr: ExprSyntax)etc.Patterns.swiftto generate Patterns as the same scheme as other kinds. (C++ parser ping-pong is not implmented)