@@ -98,7 +98,7 @@ public static EList<Element> singletonList(Element element) {
9898 public static Expression expressionFor (EList <Element > results , Element context ) {
9999 if (!results .stream ().allMatch (
100100 elm ->elm instanceof Feature &&
101- (!(elm instanceof Expression ) || elm instanceof LiteralExpression ))) {
101+ (!(elm instanceof Expression ) || elm instanceof LiteralExpression || elm . eClass () == SysMLPackage . eINSTANCE . getExpression () ))) {
102102 return null ;
103103 } else if (results .isEmpty ()) {
104104 return SysMLFactory .eINSTANCE .createNullExpression ();
@@ -107,12 +107,16 @@ public static Expression expressionFor(EList<Element> results, Element context)
107107 if (results .size () > 1 ) {
108108 Type listOp = SysMLLibraryUtil .getLibraryType (context , ExpressionUtil .getOperatorQualifiedNames ("," ));
109109 for (int i = 1 ; i < results .size (); i ++) {
110+ InvocationExpression listExpr = SysMLFactory .eINSTANCE .createInvocationExpression ();
111+ TypeUtil .addOwnedParameterTo (listExpr , expression );
112+ TypeUtil .addOwnedParameterTo (listExpr , expressionFor (results .get (i )));
113+ NamespaceUtil .addMemberTo (listExpr , listOp );
114+
110115 FeatureTyping typing = SysMLFactory .eINSTANCE .createFeatureTyping ();
111116 typing .setType (listOp );
112- InvocationExpression listExpr = SysMLFactory . eINSTANCE . createInvocationExpression ( );
117+ typing . setTypedFeature ( listExpr );
113118 listExpr .getOwnedRelationship ().add (typing );
114- TypeUtil .addOwnedParameterTo (listExpr , expression );
115- TypeUtil .addOwnedParameterTo (listExpr , expressionFor (results .get (i )));
119+
116120 expression = listExpr ;
117121 }
118122 }
@@ -250,7 +254,8 @@ public static Feature getTargetFeatureFor(Element target) {
250254 public static Feature getTypeFeatureFor (Feature feature , Type type ) {
251255 return type == null ? null :
252256 type .getFeature ().stream ().
253- filter (f ->FeatureUtil .getAllRedefinedFeaturesOf (f ).contains (feature )).
257+ filter (f ->
258+ FeatureUtil .getAllRedefinedFeaturesOf (f ).contains (feature )).
254259 findFirst ().orElse (null );
255260 }
256261
0 commit comments