X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FERange.java;h=6fbcdafecfbaa90248e858a619061c24c813db89;hb=b2676209b072592da3425c2efb29f51eb5c4a0e0;hp=2eaa5a208e361a4261d0af532fc6758fd136d43d;hpb=a8758de5bc19e5adb3f618d3038743a164f09912;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERange.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERange.java old mode 100755 new mode 100644 index 2eaa5a208..6fbcdafec --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERange.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/ERange.java @@ -1,39 +1,43 @@ -package org.simantics.scl.compiler.elaboration.expressions; - -import org.simantics.scl.compiler.common.names.Names; -import org.simantics.scl.compiler.elaboration.contexts.TranslationContext; -import org.simantics.scl.compiler.elaboration.modules.SCLValue; -import org.simantics.scl.compiler.errors.Locations; - -public class ERange extends ASTExpression { - Expression from; - Expression to; - - public ERange(Expression from, Expression to) { - this.from = from; - this.to = to; - } - - @Override - public Expression resolve(TranslationContext context) { - from = from.resolve(context); - to = to.resolve(context); - SCLValue rangeFunction = context.getEnvironment().getValue(Names.Prelude_range); - return new EApply(location, new EConstant(rangeFunction), from, to); - } - - @Override - public void setLocationDeep(long loc) { - if(location == Locations.NO_LOCATION) { - location = loc; - from.setLocationDeep(loc); - to.setLocationDeep(loc); - } - } - - @Override - public Expression accept(ExpressionTransformer transformer) { - return transformer.transform(this); - } - -} +package org.simantics.scl.compiler.elaboration.expressions; + +import org.simantics.scl.compiler.common.names.Names; +import org.simantics.scl.compiler.elaboration.contexts.TranslationContext; +import org.simantics.scl.compiler.elaboration.modules.SCLValue; +import org.simantics.scl.compiler.errors.Locations; + +public class ERange extends ASTExpression { + public Expression from; + public Expression to; + + public ERange(Expression from, Expression to) { + this.from = from; + this.to = to; + } + + @Override + public Expression resolve(TranslationContext context) { + from = from.resolve(context); + to = to.resolve(context); + SCLValue rangeFunction = context.getEnvironment().getValue(Names.Prelude_range); + return new EApply(location, new EConstant(rangeFunction), from, to); + } + + @Override + public void setLocationDeep(long loc) { + if(location == Locations.NO_LOCATION) { + location = loc; + from.setLocationDeep(loc); + to.setLocationDeep(loc); + } + } + + @Override + public Expression accept(ExpressionTransformer transformer) { + return transformer.transform(this); + } + + @Override + public void accept(ExpressionVisitor visitor) { + visitor.visit(this); + } +}