@@ -1216,3 +1216,47 @@ class WithExpr extends Expr, @with_expr {
12161216
12171217 override string getAPrimaryQlClass ( ) { result = "WithExpr" }
12181218}
1219+
1220+ /**
1221+ * A spread element expression, for example `.. x` in `[1, 2, .. x]`
1222+ */
1223+ class SpreadElementExpr extends Expr , @spread_element_expr {
1224+ /**
1225+ * Gets the expression, for example `x` in `.. x`.
1226+ */
1227+ Expr getExpr ( ) { result = this .getChild ( 0 ) }
1228+
1229+ override string toString ( ) { result = ".. " + this .getExpr ( ) .toString ( ) }
1230+
1231+ override string getAPrimaryQlClass ( ) { result = "SpreadElementExpr" }
1232+ }
1233+
1234+ /**
1235+ * A collection expression, for example `[1, 2, 3]` on line 1 in
1236+ * ```csharp
1237+ * int[] x = [1, 2, 3];
1238+ * ```
1239+ */
1240+ class CollectionExpression extends Expr , @collection_expr {
1241+ /**
1242+ * Gets the `i`th argument of this collection.
1243+ */
1244+ Expr getElement ( int i ) { result = this .getChild ( i ) }
1245+
1246+ /**
1247+ * Gets an argument of this collection
1248+ */
1249+ Expr getAnElement ( ) { result = this .getElement ( _) }
1250+
1251+ override Type getType ( ) {
1252+ super .getType ( ) instanceof NullType and
1253+ exists ( CastExpr ce | ce .getExpr ( ) = this and result = ce .getType ( ) )
1254+ or
1255+ not super .getType ( ) instanceof NullType and
1256+ result = super .getType ( )
1257+ }
1258+
1259+ override string toString ( ) { result = "[...]" }
1260+
1261+ override string getAPrimaryQlClass ( ) { result = "CollectionExpression" }
1262+ }
0 commit comments