]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EBinary.java
Merge "Re-enabled Acorn transaction cancellation support for testing"
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EBinary.java
index e74dde7f6df929fc766b4a8f755b120a6172286c..58274a7a0269553521a840af33b5362faf6d8a70 100755 (executable)
@@ -3,7 +3,7 @@ package org.simantics.scl.compiler.elaboration.expressions;
 import java.util.ArrayList;\r
 \r
 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;\r
-import org.simantics.scl.compiler.common.names.Name;\r
+import org.simantics.scl.compiler.common.names.Names;\r
 import org.simantics.scl.compiler.common.precedence.Associativity;\r
 import org.simantics.scl.compiler.common.precedence.Precedence;\r
 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;\r
@@ -46,8 +46,6 @@ public class EBinary extends ASTExpression {
     public Expression resolve(TranslationContext context) {\r
         return parseOperators(context).resolve(context);\r
     }\r
-\r
-    private static final Name NEG = Name.create("Prelude", "neg");\r
     \r
     public Expression parseOperators(TranslationContext context) {\r
         ArrayList<Expression> output = new ArrayList<Expression>();\r
@@ -87,7 +85,7 @@ public class EBinary extends ASTExpression {
             }\r
             if(negation != null && ops.isEmpty()) {\r
                 if(opPrec.level <= NEGATION_LEVEL) {      \r
-                    SCLValue neg = context.getEnvironment().getValue(NEG);\r
+                    SCLValue neg = context.getEnvironment().getValue(Names.Prelude_neg);\r
                     if(neg == null) {\r
                         context.getErrorLog().log(location, \r
                                 "Couldn't resolve variable neg.");\r
@@ -112,7 +110,7 @@ public class EBinary extends ASTExpression {
             output.add(binary(l, oldOp, opAsts.remove(opAsts.size()-1), r));\r
         }\r
         if(negation != null) {\r
-            SCLValue neg = context.getEnvironment().getValue(NEG);\r
+            SCLValue neg = context.getEnvironment().getValue(Names.Prelude_neg);\r
             if(neg == null) {\r
                 context.getErrorLog().log(location, \r
                         "Couldn't resolve variable neg.");\r