Skip to content

Commit ec486c4

Browse files
committed
[WIP] Add CanImportExpr node
1 parent 6bb19ef commit ec486c4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,41 @@ public let EXPR_NODES: [Node] = [
184184
),
185185
]
186186
),
187+
188+
// the canImport expr in if config expression
189+
Node(
190+
name: "CanImportExpr",
191+
nameForDiagnostics: "'canImport' expression in if config expression",
192+
kind: "Expr",
193+
children: [
194+
Child(
195+
name: "CanImportKeyword",
196+
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
197+
),
198+
Child(
199+
name: "LeftParen",
200+
kind: .token(choices: [.token(tokenKind: "LeftParenToken")])
201+
),
202+
Child(
203+
name: "ImportPath",
204+
kind: .token(choices: [.token(tokenKind: "IdentifierToken")])
205+
),
206+
Child(
207+
name: "Comma",
208+
kind: .token(choices: [.token(tokenKind: "CommaToken")]),
209+
isOptional: true
210+
),
211+
Child(
212+
name: "Version",
213+
kind: .node(kind: "TupleExprElement"),
214+
isOptional: true
215+
),
216+
Child(
217+
name: "RightParen",
218+
kind: .token(choices: [.token(tokenKind: "RightParenToken")])
219+
)
220+
]
221+
),
187222

188223
// case-item -> pattern where-clause? ','?
189224
Node(

0 commit comments

Comments
 (0)