]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EConstant.java
Property following functions value and possibleValue to ontology modules
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EConstant.java
index eb3f5ca4a74ff3e192c7647153f5f1d14cd36bcd..25cc96019f95175787b63732979b7ce8f4a9bab0 100644 (file)
@@ -16,6 +16,7 @@ import org.simantics.scl.compiler.elaboration.errors.NotPatternException;
 import org.simantics.scl.compiler.elaboration.expressions.lhstype.LhsType;
 import org.simantics.scl.compiler.elaboration.expressions.lhstype.PatternMatchingLhs;
 import org.simantics.scl.compiler.elaboration.java.DynamicConstructor;
+import org.simantics.scl.compiler.elaboration.macros.MacroRule;
 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.codegen.references.IVal;
@@ -125,6 +126,14 @@ public class EConstant extends Expression {
             else
                 return value.getExpression().copy().simplify(context);
         }
+        else {
+            MacroRule macroRule = value.getMacroRule();
+            if(macroRule != null) {
+                Expression newExpression = macroRule.inline(context, typeParameters);
+                if(newExpression != null)
+                    return newExpression;
+            }
+        }
         return this;
     }