Skip to content

Commit a6ea7c8

Browse files
committed
Add missing parameter
1 parent f7667e1 commit a6ea7c8

File tree

5 files changed

+139
-91
lines changed

5 files changed

+139
-91
lines changed

CodeGeneration/Sources/SyntaxSupport/Node.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ public class Node {
117117
isOptional: true,
118118
collectionElementName: unexpectedName
119119
),
120-
child,
120+
child
121121
]
122-
}
122+
} + (children.last != nil ? [Child(
123+
name: "UnexpectedAfter\(children.last!.name)",
124+
kind: "UnexpectedNodes",
125+
isOptional: true,
126+
collectionElementName: "UnexpectedAfter\(children.last!.name)"
127+
)] : [])
123128
}
124129

125130
self.nonUnexpectedChildren = children.filter { !$0.isUnexpectedNodes }

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SyntaxTraitsFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let syntaxTraitsFile = SourceFileSyntax {
2828
}
2929
}
3030

31-
ExtensionDeclSyntax("public extension \(trait.traitName)Syntax") {
31+
ExtensionDeclSyntax("public extension \(raw: trait.traitName)Syntax") {
3232
FunctionDeclSyntax("""
3333
/// Without this function, the `with` function defined on `SyntaxProtocol`
3434
/// does not work on existentials of this protocol type.

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/BuildableNodesFile.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ private func createConvenienceInitializer(node: Node) -> InitializerDeclSyntax?
103103

104104
return InitializerDeclSyntax(
105105
leadingTrivia: .docLineComment("/// A convenience initializer that allows initializing syntax collections using result builders") + .newline,
106-
modifiers: [DeclModifierSyntax(name: .keyword(.public))],
106+
attributes: [.attribute(AttributeSyntax("@_disfavoredOverload"))],
107+
modifiers: [DeclModifierSyntax(leadingTrivia: .newline, name: .keyword(.public))],
107108
signature: FunctionSignatureSyntax(
108109
input: ParameterClauseSyntax {
109110
FunctionParameterSyntax("leadingTrivia: Trivia? = nil", for: .functionParameters)

Sources/SwiftParser/Lexer/Cursor.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,6 @@ extension Lexer.Cursor {
12981298
}
12991299

13001300
mutating func lexHexNumber() -> Lexer.Result {
1301-
let tokStart = self
13021301
// We assume we're starting from the 'x' in a '0x...' floating-point literal.
13031302
let zeroConsumed = self.advance(matching: "0")
13041303
let xConsumed = self.advance(matching: "x")

0 commit comments

Comments
 (0)