@@ -59,6 +59,7 @@ extension ${kind}Buildable {
59
59
func build${ kind} ( format: Format) - > ${ build_kind} {
60
60
build ${ kind} ( format: format, leadingTrivia: nil )
61
61
}
62
+
62
63
% end
63
64
public func buildSyntax( format: Format ) -> Syntax {
64
65
buildSyntax ( format: format, leadingTrivia: nil )
@@ -68,18 +69,13 @@ extension ${kind}Buildable {
68
69
Syntax ( build ${ kind} ( format: format, leadingTrivia: leadingTrivia) )
69
70
}
70
71
71
- public func build${ kind} List ( format: Format) - > [ ${ build_kind} ] {
72
- build ${ kind} List( format: format, leadingTrivia: nil )
73
- }
74
-
75
- public func build${ kind} List ( format: Format, leadingTrivia: Trivia? ) - > [ ${ build_kind} ] {
72
+ public func build${ kind} List ( format: Format, leadingTrivia: Trivia? = nil ) - > [ ${ build_kind} ] {
76
73
[ build ${ kind} ( format: format, leadingTrivia: leadingTrivia) ]
77
74
}
78
75
}
79
76
80
77
% end
81
78
% end
82
-
83
79
// MARK: - Buildables
84
80
85
81
% for node in SYNTAX_NODES:
@@ -125,8 +121,7 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
125
121
)
126
122
127
123
if let leadingTrivia = leadingTrivia {
128
- return ${ node. swift_syntax_kind}
129
- . withLeadingTrivia ( leadingTrivia)
124
+ return ${ node. swift_syntax_kind} . withLeadingTrivia ( leadingTrivia)
130
125
}
131
126
132
127
return ${ node. swift_syntax_kind}
@@ -150,7 +145,7 @@ public struct ${node.syntax_kind}: SyntaxBuildable {
150
145
self . elements = elements
151
146
}
152
147
153
- public func build${ node. syntax_kind} ( format: Format, leadingTrivia : Trivia ? = nil ) - > ${ node. syntax_kind} Syntax {
148
+ public func build${ node. syntax_kind} ( format: Format) - > ${ node. syntax_kind} Syntax {
154
149
% if not node. is_token ( ) :
155
150
% leading_trivia = 'nil '
156
151
% if node. elements_separated_by_newline:
@@ -165,7 +160,7 @@ public struct ${node.syntax_kind}: SyntaxBuildable {
165
160
}
166
161
167
162
public func buildSyntax( format: Format , leadingTrivia: Trivia ? = nil ) -> Syntax {
168
- let ${ node. swift_syntax_kind} = build ${ node. syntax_kind} ( format: format, leadingTrivia : leadingTrivia )
163
+ let ${ node. swift_syntax_kind} = build ${ node. syntax_kind} ( format: format)
169
164
170
165
if let leadingTrivia = leadingTrivia {
171
166
return Syntax ( ${ node. swift_syntax_kind} ) . withLeadingTrivia ( leadingTrivia)
0 commit comments