Skip to content

Commit 81d8f35

Browse files
committed
Change Node.parserFunction type to TokenSyntax
1 parent 39a4239 commit 81d8f35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CodeGeneration/Sources/SyntaxSupport/Node.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class Node {
5555

5656
/// If the syntax node can be constructed by parsing a string, the parser
5757
/// function that should be invoked to create this node.
58-
public let parserFunction: String?
58+
public let parserFunction: TokenSyntax?
5959

6060
/// A name for this node that is suitable to be used as a variables or enum
6161
/// case's name.
@@ -110,7 +110,7 @@ public class Node {
110110
isExperimental: Bool = false,
111111
nameForDiagnostics: String?,
112112
documentation: String? = nil,
113-
parserFunction: String? = nil,
113+
parserFunction: TokenSyntax? = nil,
114114
traits: [String] = [],
115115
children: [Child] = []
116116
) {
@@ -229,7 +229,7 @@ public class Node {
229229
isExperimental: Bool = false,
230230
nameForDiagnostics: String?,
231231
documentation: String? = nil,
232-
parserFunction: String? = nil,
232+
parserFunction: TokenSyntax? = nil,
233233
elementChoices: [SyntaxNodeKind]
234234
) {
235235
self.kind = kind

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftparser/ParserEntryFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let parserEntryFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
3939
// incremental parse and would then live in a different arena than
4040
// `parser.arena`.
4141
defer { withExtendedLifetime(parser) {} }
42-
let node = parser.\(raw: parserFunction)()
42+
let node = parser.\(parserFunction)()
4343
let raw = RawSyntax(parser.parseRemainder(into: node))
4444
return Syntax(raw: raw, rawNodeArena: raw.arena).cast(Self.self)
4545
}

0 commit comments

Comments
 (0)