Ejemplo n.º 1
0
 public static VarValue UseOperation(VarValue left, VarValue right, OpCode code)
 {
     if (left.varType == Type.CONST && right.varType == Type.CONST)
     {
         return(new VarValue(ApplyOperation(left.value, right.value, code)));
     }
     return(OperationUnderNotConst(left, right));
 }
Ejemplo n.º 2
0
 private static VarValue OperationUnderNotConst(VarValue left, VarValue right)
 {
     if (left.varType == Type.NAC || right.varType == Type.NAC)
     {
         return(new VarValue(new Var()));
     }
     if (left.varType == Type.UNDEF || right.varType == Type.UNDEF)
     {
         return(new VarValue());
     }
     return(null);
 }
Ejemplo n.º 3
0
 public VarValue CollectionOperator(VarValue right)
 {
     if (right == null || this == right)
     {
         return(this);
     }
     if (this.varType == Type.NAC || right.varType == Type.NAC)
     {
         return(new VarValue(new Var()));
     }
     if (this.varType == Type.CONST && right.varType == Type.CONST)
     {
         return(new VarValue(new Var()));
     }
     if (this.varType == Type.CONST)
     {
         return(this);
     }
     return(right);
 }