-
Notifications
You must be signed in to change notification settings - Fork 439
Add diagnostic for canImport
expression
#1574
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
Changes from all commits
0dd5df9
4c23aaf
f372c85
fa6902a
809fe52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,60 @@ public let EXPR_NODES: [Node] = [ | |
] | ||
), | ||
|
||
// the canImport expr in if config expression | ||
Node( | ||
name: "CanImportExpr", | ||
nameForDiagnostics: "'canImport' expression", | ||
kind: "Expr", | ||
children: [ | ||
Child( | ||
name: "CanImportKeyword", | ||
kind: .token(choices: [.keyword(text: "canImport")]) | ||
), | ||
Child( | ||
name: "LeftParen", | ||
kind: .token(choices: [.token(tokenKind: "LeftParenToken")]) | ||
), | ||
Child( | ||
name: "ImportPath", | ||
kind: .token(choices: [.token(tokenKind: "IdentifierToken")]) | ||
), | ||
Child( | ||
name: "VersionInfo", | ||
kind: .node(kind: "CanImportVersionInfo"), | ||
isOptional: true | ||
), | ||
Child( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than have a string of optional components, can we split the version information into its own syntax element and make that optional? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense to me. I've extracted the optional part of |
||
name: "RightParen", | ||
kind: .token(choices: [.token(tokenKind: "RightParenToken")]) | ||
), | ||
] | ||
), | ||
|
||
Node( | ||
name: "CanImportVersionInfo", | ||
nameForDiagnostics: nil, | ||
kind: "Expr", | ||
children: [ | ||
Child( | ||
name: "Comma", | ||
kind: .token(choices: [.token(tokenKind: "CommaToken")]) | ||
), | ||
Child( | ||
name: "Label", | ||
kind: .token(choices: [.keyword(text: "_version"), .keyword(text: "_underlyingVersion")]) | ||
), | ||
Child( | ||
name: "Colon", | ||
kind: .token(choices: [.token(tokenKind: "ColonToken")]) | ||
), | ||
Child( | ||
name: "VersionTuple", | ||
kind: .node(kind: "VersionTuple") | ||
), | ||
] | ||
), | ||
|
||
// case-item -> pattern where-clause? ','? | ||
Node( | ||
name: "CaseItem", | ||
|
Uh oh!
There was an error while loading. Please reload this page.