1313@_spi ( RawSyntax) import SwiftParser
1414@_spi ( RawSyntax) import SwiftSyntax
1515
16- // MARK: - ArrayElementList
16+ // MARK: - ArrayElementListSyntax
1717
1818extension ArrayElementListSyntax {
1919 public init ( expressions: [ ExprSyntax ] ) {
@@ -30,15 +30,15 @@ extension ArrayElementListSyntax {
3030 }
3131}
3232
33- // MARK: - ArrayExpr
33+ // MARK: - ArrayExprSyntax
3434
3535extension ArrayExprSyntax {
3636 public init ( expressions: [ ExprSyntax ] ) {
3737 self . init ( elements: ArrayElementListSyntax ( expressions: expressions) )
3838 }
3939}
4040
41- // MARK: - CustomAttribute
41+ // MARK: - AttributeSyntax
4242
4343extension AttributeSyntax {
4444 /// A convenience initializer that allows passing in arguments using a result builder
@@ -58,15 +58,15 @@ extension AttributeSyntax {
5858 }
5959}
6060
61- // MARK: - BinaryOperatorExpr
61+ // MARK: - BinaryOperatorExprSyntax
6262
6363extension BinaryOperatorExprSyntax {
6464 public init ( text: String ) {
6565 self . init ( operator: . binaryOperator( text) )
6666 }
6767}
6868
69- // MARK: - BooleanLiteralExpr
69+ // MARK: - BooleanLiteralExprSyntax
7070
7171extension BooleanLiteralExprSyntax : ExpressibleByBooleanLiteral {
7272 public init ( _ value: Bool ) {
@@ -78,7 +78,7 @@ extension BooleanLiteralExprSyntax: ExpressibleByBooleanLiteral {
7878 }
7979}
8080
81- // MARK: - CatchClause
81+ // MARK: - CatchClauseSyntax
8282
8383extension CatchClauseSyntax {
8484 /// A convenience initializer that calculates spacing around the `catch` keyword.
@@ -96,7 +96,7 @@ extension CatchClauseSyntax {
9696 }
9797}
9898
99- // MARK: - DictionaryExpr
99+ // MARK: - DictionaryExprSyntax
100100
101101extension DictionaryExprSyntax {
102102 /// A convenience initializer that allows passing in members using a result builder
@@ -115,7 +115,15 @@ extension DictionaryExprSyntax {
115115 }
116116}
117117
118- // MARK: - Expr
118+ // MARK: - ExprListSyntax
119+
120+ extension ExprListSyntax {
121+ public init ( _ elements: [ ExprSyntaxProtocol ] ) {
122+ self . init ( elements. map { ExprSyntax ( fromProtocol: $0) } as [ ExprSyntax ] )
123+ }
124+ }
125+
126+ // MARK: - ExprSyntax
119127
120128extension ExprSyntax {
121129 /// Returns a syntax tree for an expression that represents the value of the
@@ -163,7 +171,7 @@ extension FloatLiteralExprSyntax: ExpressibleByFloatLiteral {
163171 }
164172}
165173
166- // MARK: - FunctionCallExpr
174+ // MARK: - FunctionCallExprSyntax
167175
168176extension FunctionCallExprSyntax {
169177 /// A convenience initializer that allows passing in arguments using a result builder
@@ -188,7 +196,7 @@ extension FunctionCallExprSyntax {
188196 }
189197}
190198
191- // MARK: - IntegerLiteralExpr
199+ // MARK: - IntegerLiteralExprSyntax
192200
193201extension IntegerLiteralExprSyntax : ExpressibleByIntegerLiteral {
194202 public init ( _ value: Int ) {
@@ -200,7 +208,21 @@ extension IntegerLiteralExprSyntax: ExpressibleByIntegerLiteral {
200208 }
201209}
202210
203- // MARK: - StringLiteralExpr
211+ // MARK: - LabeledExprSyntax
212+
213+ extension LabeledExprSyntax {
214+ /// A convenience initializer that allows passing in label as an optional string.
215+ /// The presence of the colon will be inferred based on the presence of the label.
216+ public init ( label: String ? = nil , expression: some ExprSyntaxProtocol ) {
217+ self . init (
218+ label: label. map { . identifier( $0) } ,
219+ colon: label == nil ? nil : . colonToken( trailingTrivia: . space) ,
220+ expression: expression
221+ )
222+ }
223+ }
224+
225+ // MARK: - StringLiteralExprSyntax
204226
205227extension String {
206228 /// Replace literal newlines with "\r", "\n", "\u{2028}", and ASCII control characters with "\0", "\u{7}"
@@ -338,21 +360,15 @@ extension StringLiteralExprSyntax {
338360 }
339361}
340362
341- // MARK: - TupleExprElement
363+ // MARK: - UnexpectedNodesSyntax
342364
343- extension LabeledExprSyntax {
344- /// A convenience initializer that allows passing in label as an optional string.
345- /// The presence of the colon will be inferred based on the presence of the label.
346- public init ( label: String ? = nil , expression: some ExprSyntaxProtocol ) {
347- self . init (
348- label: label. map { . identifier( $0) } ,
349- colon: label == nil ? nil : . colonToken( trailingTrivia: . space) ,
350- expression: expression
351- )
365+ extension UnexpectedNodesSyntax {
366+ public init ( _ elements: [ SyntaxProtocol ] ) {
367+ self . init ( elements. map { Syntax ( fromProtocol: $0) } as [ Syntax ] )
352368 }
353369}
354370
355- // MARK: - VariableDecl
371+ // MARK: - VariableDeclSyntax
356372
357373extension VariableDeclSyntax {
358374 /// Creates an optionally initialized property.
0 commit comments