Skip to content

Commit e04f28e

Browse files
committed
Remove redundant open/eof token generation
1 parent c8a1069 commit e04f28e

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

Sources/SwiftSyntaxBuilderGeneration/Templates/TokensFile.swift

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -96,35 +96,6 @@ let tokensFile = SourceFile {
9696
}
9797
}
9898
}
99-
VariableDecl(
100-
modifiers: [TokenSyntax.static.withLeadingTrivia(.newlines(1) + .docLineComment("/// The `eof` token") + .newlines(1))],
101-
letOrVarKeyword: .var
102-
) {
103-
// We need to use `CodeBlock` here to ensure there is braces around.
104-
let body = CodeBlock {
105-
FunctionCallExpr(MemberAccessExpr(base: "SyntaxFactory", name: "makeToken")) {
106-
TupleExprElement(expression: MemberAccessExpr(name: "eof"))
107-
TupleExprElement(label: TokenSyntax.identifier("presence"), colon: .colon, expression: MemberAccessExpr(name: "present"))
108-
}
109-
}
110-
111-
createTokenSyntaxPatternBinding("eof", accessor: body)
112-
}
113-
VariableDecl(
114-
modifiers: [TokenSyntax.static.withLeadingTrivia(.newlines(1) + .docLineComment("/// The `open` contextual token") + .newlines(1))],
115-
letOrVarKeyword: .var
116-
) {
117-
// We need to use `CodeBlock` here to ensure there is braces around.
118-
let body = CodeBlock {
119-
FunctionCallExpr(MemberAccessExpr(base: "SyntaxFactory", name: "makeContextualKeyword")) {
120-
TupleExprElement(expression: StringLiteralExpr("open"))
121-
}
122-
123-
createWithTrailingTriviaCall()
124-
}
125-
126-
createTokenSyntaxPatternBinding("open", accessor: body)
127-
}
12899
}
129100
VariableDecl(
130101
modifiers: [TokenSyntax.static.withLeadingTrivia(.newlines(1) + .docLineComment("/// The `eof` token") + .newlines(1))],
@@ -133,7 +104,7 @@ let tokensFile = SourceFile {
133104
// We need to use `CodeBlock` here to ensure there is braces around.
134105
let body = CodeBlock {
135106
FunctionCallExpr(MemberAccessExpr(base: "SyntaxFactory", name: "makeToken")) {
136-
TupleExprElement(expression: MemberAccessExpr(name: "eof"), trailingComma: .comma)
107+
TupleExprElement(expression: MemberAccessExpr(name: "eof"))
137108
TupleExprElement(label: TokenSyntax.identifier("presence"), colon: .colon, expression: MemberAccessExpr(name: "present"))
138109
}
139110
}

0 commit comments

Comments
 (0)