X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FAssignment.java;h=7cc70aaa77bed69f6328ce0a5055f884301f201b;hp=d1d17f6ec5a99d3ab95630301e66f507e3aa05e8;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/Assignment.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/Assignment.java old mode 100755 new mode 100644 index d1d17f6ec..7cc70aaa7 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/Assignment.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/Assignment.java @@ -1,41 +1,41 @@ -package org.simantics.scl.compiler.elaboration.expressions; - -import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext; -import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator; -import org.simantics.scl.compiler.types.Type; - -public class Assignment { - public Expression pattern; - public Expression value; - - public Assignment(Expression pattern, Expression value) { - if(Type.NULL_CHECKS) { - if(pattern == null) - throw new NullPointerException(); - if(value == null) - throw new NullPointerException(); - } - this.pattern = pattern; - this.value = value; - } - - public Assignment replace(ReplaceContext context) { - Expression newPattern = pattern.replaceInPattern(context); - Expression newValue = value.replace(context); - return new Assignment(newPattern, newValue); - } - - public void decorate(ExpressionDecorator decorator) { - pattern = pattern.decorate(decorator); - value = value.decorate(decorator); - } - - public void setLocationDeep(long loc) { - pattern.setLocationDeep(loc); - value.setLocationDeep(loc); - } - - public void forVariables(VariableProcedure procedure) { - value.forVariables(procedure); - } -} +package org.simantics.scl.compiler.elaboration.expressions; + +import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext; +import org.simantics.scl.compiler.internal.elaboration.utils.ExpressionDecorator; +import org.simantics.scl.compiler.types.Type; + +public class Assignment { + public Expression pattern; + public Expression value; + + public Assignment(Expression pattern, Expression value) { + if(Type.NULL_CHECKS) { + if(pattern == null) + throw new NullPointerException(); + if(value == null) + throw new NullPointerException(); + } + this.pattern = pattern; + this.value = value; + } + + public Assignment replace(ReplaceContext context) { + Expression newPattern = pattern.replaceInPattern(context); + Expression newValue = value.replace(context); + return new Assignment(newPattern, newValue); + } + + public void decorate(ExpressionDecorator decorator) { + pattern = pattern.decorate(decorator); + value = value.decorate(decorator); + } + + public void setLocationDeep(long loc) { + pattern.setLocationDeep(loc); + value.setLocationDeep(loc); + } + + public void forVariables(VariableProcedure procedure) { + value.forVariables(procedure); + } +}