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)); }
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); }
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); }