@@ -3887,6 +3887,14 @@ private bool TryExecuteWellKnownFunction(out object returnVal, object objectInst
3887
3887
return true ;
3888
3888
}
3889
3889
}
3890
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . Unescape ) , StringComparison . OrdinalIgnoreCase ) )
3891
+ {
3892
+ if ( TryGetArg ( args , out string arg0 ) )
3893
+ {
3894
+ returnVal = IntrinsicFunctions . Unescape ( arg0 ) ;
3895
+ return true ;
3896
+ }
3897
+ }
3890
3898
else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . GetPathOfFileAbove ) , StringComparison . OrdinalIgnoreCase ) )
3891
3899
{
3892
3900
if ( TryGetArgs ( args , out string arg0 , out string arg1 ) )
@@ -3899,31 +3907,39 @@ private bool TryExecuteWellKnownFunction(out object returnVal, object objectInst
3899
3907
{
3900
3908
if ( TryGetArgs ( args , out double arg0 , out double arg1 ) )
3901
3909
{
3902
- returnVal = arg0 + arg1 ;
3910
+ returnVal = IntrinsicFunctions . Add ( arg0 , arg1 ) ;
3903
3911
return true ;
3904
3912
}
3905
3913
}
3906
3914
else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . Subtract ) , StringComparison . OrdinalIgnoreCase ) )
3907
3915
{
3908
3916
if ( TryGetArgs ( args , out double arg0 , out double arg1 ) )
3909
3917
{
3910
- returnVal = arg0 - arg1 ;
3918
+ returnVal = IntrinsicFunctions . Subtract ( arg0 , arg1 ) ;
3911
3919
return true ;
3912
3920
}
3913
3921
}
3914
3922
else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . Multiply ) , StringComparison . OrdinalIgnoreCase ) )
3915
3923
{
3916
3924
if ( TryGetArgs ( args , out double arg0 , out double arg1 ) )
3917
3925
{
3918
- returnVal = arg0 * arg1 ;
3926
+ returnVal = IntrinsicFunctions . Multiply ( arg0 , arg1 ) ;
3919
3927
return true ;
3920
3928
}
3921
3929
}
3922
3930
else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . Divide ) , StringComparison . OrdinalIgnoreCase ) )
3923
3931
{
3924
3932
if ( TryGetArgs ( args , out double arg0 , out double arg1 ) )
3925
3933
{
3926
- returnVal = arg0 / arg1 ;
3934
+ returnVal = IntrinsicFunctions . Divide ( arg0 , arg1 ) ;
3935
+ return true ;
3936
+ }
3937
+ }
3938
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . Modulo ) , StringComparison . OrdinalIgnoreCase ) )
3939
+ {
3940
+ if ( TryGetArgs ( args , out double arg0 , out double arg1 ) )
3941
+ {
3942
+ returnVal = IntrinsicFunctions . Modulo ( arg0 , arg1 ) ;
3927
3943
return true ;
3928
3944
}
3929
3945
}
@@ -4113,6 +4129,62 @@ private bool TryExecuteWellKnownFunction(out object returnVal, object objectInst
4113
4129
return true ;
4114
4130
}
4115
4131
}
4132
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . BitwiseOr ) , StringComparison . OrdinalIgnoreCase ) )
4133
+ {
4134
+ if ( TryGetArgs ( args , out int arg0 , out int arg1 ) )
4135
+ {
4136
+ returnVal = IntrinsicFunctions . BitwiseOr ( arg0 , arg1 ) ;
4137
+ return true ;
4138
+ }
4139
+ }
4140
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . BitwiseAnd ) , StringComparison . OrdinalIgnoreCase ) )
4141
+ {
4142
+ if ( TryGetArgs ( args , out int arg0 , out int arg1 ) )
4143
+ {
4144
+ returnVal = IntrinsicFunctions . BitwiseAnd ( arg0 , arg1 ) ;
4145
+ return true ;
4146
+ }
4147
+ }
4148
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . BitwiseXor ) , StringComparison . OrdinalIgnoreCase ) )
4149
+ {
4150
+ if ( TryGetArgs ( args , out int arg0 , out int arg1 ) )
4151
+ {
4152
+ returnVal = IntrinsicFunctions . BitwiseXor ( arg0 , arg1 ) ;
4153
+ return true ;
4154
+ }
4155
+ }
4156
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . BitwiseNot ) , StringComparison . OrdinalIgnoreCase ) )
4157
+ {
4158
+ if ( TryGetArgs ( args , out int arg0 ) )
4159
+ {
4160
+ returnVal = IntrinsicFunctions . BitwiseNot ( arg0 ) ;
4161
+ return true ;
4162
+ }
4163
+ }
4164
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . LeftShift ) , StringComparison . OrdinalIgnoreCase ) )
4165
+ {
4166
+ if ( TryGetArgs ( args , out int arg0 , out int arg1 ) )
4167
+ {
4168
+ returnVal = IntrinsicFunctions . LeftShift ( arg0 , arg1 ) ;
4169
+ return true ;
4170
+ }
4171
+ }
4172
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . RightShift ) , StringComparison . OrdinalIgnoreCase ) )
4173
+ {
4174
+ if ( TryGetArgs ( args , out int arg0 , out int arg1 ) )
4175
+ {
4176
+ returnVal = IntrinsicFunctions . RightShift ( arg0 , arg1 ) ;
4177
+ return true ;
4178
+ }
4179
+ }
4180
+ else if ( string . Equals ( _methodMethodName , nameof ( IntrinsicFunctions . RightShiftUnsigned ) , StringComparison . OrdinalIgnoreCase ) )
4181
+ {
4182
+ if ( TryGetArgs ( args , out int arg0 , out int arg1 ) )
4183
+ {
4184
+ returnVal = IntrinsicFunctions . RightShiftUnsigned ( arg0 , arg1 ) ;
4185
+ return true ;
4186
+ }
4187
+ }
4116
4188
}
4117
4189
else if ( _receiverType == typeof ( Path ) )
4118
4190
{
@@ -4489,6 +4561,18 @@ private static bool TryGetArgs(object[] args, out string arg0, out StringCompari
4489
4561
return Enum . TryParse ( comparisonTypeName , out arg1 ) ;
4490
4562
}
4491
4563
4564
+ private static bool TryGetArgs ( object [ ] args , out int arg0 )
4565
+ {
4566
+ arg0 = 0 ;
4567
+
4568
+ if ( args . Length != 1 )
4569
+ {
4570
+ return false ;
4571
+ }
4572
+
4573
+ return TryConvertToInt ( args [ 0 ] , out arg0 ) ;
4574
+ }
4575
+
4492
4576
private static bool TryGetArgs ( object [ ] args , out int arg0 , out int arg1 )
4493
4577
{
4494
4578
arg0 = 0 ;
0 commit comments