Exemplo n.º 1
0
 public ArrayAssignmentExpression(AssignmentType type, IVariableExpression variable,
                                  ArrayExpression <T, Array <T> > expression)
     : base($"{variable.Representation()} {type} {expression.Script()}", variable.VariableType())
 {
     this.type       = type;
     this.variable   = variable;
     this.expression = expression;
     arrayType       = expression.ArrayType();
     // type checking
     Assert.IsTrue(variable.VariableType() == expression.Type());
 }
Exemplo n.º 2
0
 public AssignmentExpression(AssignmentType type, IVariableExpression variable,
                             Expression <T> expression, bool returnsValue)
     : base($"{variable.Representation()} {type} {expression.Script()}", variable.VariableType())
 {
     this.type         = type;
     this.variable     = variable;
     this.expression   = expression;
     this.returnsValue = returnsValue;
     // type checking
     Assert.IsTrue(variable.VariableType() == expression.Type());
     if (returnsValue)
     {
         Assert.IsTrue(typeof(TR) == typeof(T));
     }
     else
     {
         Assert.IsTrue(typeof(TR) == typeof(Void));
     }
 }