@@ -8,15 +8,15 @@ namespace ToolGood.Algorithm
88 /// <summary>
99 /// 运算符
1010 /// </summary>
11- public class Operator
11+ internal class Operator
1212 {
1313 public Operator ( OperatorType type , string value )
1414 {
1515 this . Type = type ;
1616 this . Value = value ;
1717 }
1818
19- public Operator ( OperatorType type , string value , int argsCount )
19+ public Operator ( OperatorType type , string value , int argsCount )
2020 {
2121 this . Type = type ;
2222 this . Value = value ;
@@ -115,7 +115,7 @@ public Operator(OperatorType type, string value,int argsCount)
115115 /// </summary>
116116 /// <param name="opt">运算符</param>
117117 /// <returns>返回指定的运算符类型</returns>
118- public static OperatorType ConvertOperator ( string opt )
118+ public static OperatorType ConvertOperator ( string opt , string next )
119119 {
120120 switch ( opt ) {
121121 //case "!": return OperatorType.NOT;
@@ -135,8 +135,19 @@ public static OperatorType ConvertOperator(string opt)
135135 case "&" : return OperatorType . StringADD ;
136136 case "|" : return OperatorType . OR ;
137137 case "," : return OperatorType . CA ;
138- default : return OperatorType . FUNC ;
138+ default : break ; // return OperatorType.FUNC;
139139 }
140+ switch ( opt ) {
141+ case "pi" :
142+ case "e" :
143+ case "true" :
144+ case "false" :
145+ if ( next == "(" ) {
146+ return OperatorType . FUNC ;
147+ }
148+ return OperatorType . PARAMETER ;
149+ }
150+ return OperatorType . FUNC ;
140151 }
141152
142153 /// <summary>
0 commit comments