@@ -42,12 +42,12 @@ internal override ConstantExpression ConstantFold() {
4242 case PythonOperator . BitwiseAnd : return new ConstantExpression ( Int32Ops . BitwiseAnd ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) ) ;
4343 case PythonOperator . BitwiseOr : return new ConstantExpression ( Int32Ops . BitwiseOr ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) ) ;
4444 case PythonOperator . ExclusiveOr : return new ConstantExpression ( Int32Ops . ExclusiveOr ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) ) ;
45- case PythonOperator . LessThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( Int32Ops . Compare ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) < 0 ) ) ;
46- case PythonOperator . GreaterThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( Int32Ops . Compare ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) > 0 ) ) ;
47- case PythonOperator . LessThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( Int32Ops . Compare ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) <= 0 ) ) ;
48- case PythonOperator . GreaterThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( Int32Ops . Compare ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) >= 0 ) ) ;
49- case PythonOperator . Equals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( Int32Ops . Compare ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) == 0 ) ) ;
50- case PythonOperator . NotEquals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( Int32Ops . Compare ( ( Int32 ) constLeft . Value , ( Int32 ) constRight . Value ) != 0 ) ) ;
45+ case PythonOperator . LessThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Int32 ) constLeft . Value < ( Int32 ) constRight . Value ) ) ;
46+ case PythonOperator . GreaterThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Int32 ) constLeft . Value > ( Int32 ) constRight . Value ) ) ;
47+ case PythonOperator . LessThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Int32 ) constLeft . Value <= ( Int32 ) constRight . Value ) ) ;
48+ case PythonOperator . GreaterThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Int32 ) constLeft . Value >= ( Int32 ) constRight . Value ) ) ;
49+ case PythonOperator . Equals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Int32 ) constLeft . Value == ( Int32 ) constRight . Value ) ) ;
50+ case PythonOperator . NotEquals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Int32 ) constLeft . Value != ( Int32 ) constRight . Value ) ) ;
5151 }
5252 }
5353 if ( constLeft . Value . GetType ( ) == typeof ( Double ) ) {
@@ -59,12 +59,12 @@ internal override ConstantExpression ConstantFold() {
5959 case PythonOperator . FloorDivide : return new ConstantExpression ( DoubleOps . FloorDivide ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) ) ;
6060 case PythonOperator . TrueDivide : return new ConstantExpression ( DoubleOps . TrueDivide ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) ) ;
6161 case PythonOperator . Mod : return new ConstantExpression ( DoubleOps . Mod ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) ) ;
62- case PythonOperator . LessThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( DoubleOps . Compare ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) < 0 ) ) ;
63- case PythonOperator . GreaterThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( DoubleOps . Compare ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) > 0 ) ) ;
64- case PythonOperator . LessThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( DoubleOps . Compare ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) <= 0 ) ) ;
65- case PythonOperator . GreaterThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( DoubleOps . Compare ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) >= 0 ) ) ;
66- case PythonOperator . Equals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( DoubleOps . Compare ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) == 0 ) ) ;
67- case PythonOperator . NotEquals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( DoubleOps . Compare ( ( Double ) constLeft . Value , ( Double ) constRight . Value ) != 0 ) ) ;
62+ case PythonOperator . LessThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Double ) constLeft . Value < ( Double ) constRight . Value ) ) ;
63+ case PythonOperator . GreaterThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Double ) constLeft . Value > ( Double ) constRight . Value ) ) ;
64+ case PythonOperator . LessThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Double ) constLeft . Value <= ( Double ) constRight . Value ) ) ;
65+ case PythonOperator . GreaterThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Double ) constLeft . Value >= ( Double ) constRight . Value ) ) ;
66+ case PythonOperator . Equals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Double ) constLeft . Value == ( Double ) constRight . Value ) ) ;
67+ case PythonOperator . NotEquals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( Double ) constLeft . Value != ( Double ) constRight . Value ) ) ;
6868 }
6969 }
7070 if ( constLeft . Value . GetType ( ) == typeof ( BigInteger ) ) {
@@ -81,12 +81,12 @@ internal override ConstantExpression ConstantFold() {
8181 case PythonOperator . BitwiseAnd : return new ConstantExpression ( BigIntegerOps . BitwiseAnd ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) ) ;
8282 case PythonOperator . BitwiseOr : return new ConstantExpression ( BigIntegerOps . BitwiseOr ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) ) ;
8383 case PythonOperator . ExclusiveOr : return new ConstantExpression ( BigIntegerOps . ExclusiveOr ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) ) ;
84- case PythonOperator . LessThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( BigIntegerOps . Compare ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) < 0 ) ) ;
85- case PythonOperator . GreaterThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( BigIntegerOps . Compare ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) > 0 ) ) ;
86- case PythonOperator . LessThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( BigIntegerOps . Compare ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) <= 0 ) ) ;
87- case PythonOperator . GreaterThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( BigIntegerOps . Compare ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) >= 0 ) ) ;
88- case PythonOperator . Equals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( BigIntegerOps . Compare ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) == 0 ) ) ;
89- case PythonOperator . NotEquals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( BigIntegerOps . Compare ( ( BigInteger ) constLeft . Value , ( BigInteger ) constRight . Value ) != 0 ) ) ;
84+ case PythonOperator . LessThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( BigInteger ) constLeft . Value < ( BigInteger ) constRight . Value ) ) ;
85+ case PythonOperator . GreaterThan : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( BigInteger ) constLeft . Value > ( BigInteger ) constRight . Value ) ) ;
86+ case PythonOperator . LessThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( BigInteger ) constLeft . Value <= ( BigInteger ) constRight . Value ) ) ;
87+ case PythonOperator . GreaterThanOrEqual : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( BigInteger ) constLeft . Value >= ( BigInteger ) constRight . Value ) ) ;
88+ case PythonOperator . Equals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( BigInteger ) constLeft . Value == ( BigInteger ) constRight . Value ) ) ;
89+ case PythonOperator . NotEquals : return new ConstantExpression ( ScriptingRuntimeHelpers . BooleanToObject ( ( BigInteger ) constLeft . Value != ( BigInteger ) constRight . Value ) ) ;
9090 }
9191 }
9292 if ( constLeft . Value . GetType ( ) == typeof ( Complex ) ) {
0 commit comments