-
Notifications
You must be signed in to change notification settings - Fork 101
Why are operators limited to "two" characters ? #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Ok. I need to think a little about this one. I will also check if operators like |
I guess I am making the assumption that this evaluator is meant to allow one to tweak the syntax depending on need. But Maybe that's wrong and this is really supposed to be primarily a C# syntax evaluator. I need an evaluator that has a preexisting defined syntax -- and it's a combination of BASIC and C where you have both && and 'and', || and 'or', also both "=" and "==" work. There's no assignments -- just expressions. So I think there's a decision to be made here. Decide that this code-base is not fit-for-purpose for my needs, Or, put the code-base on a path such that some of these things are user-extensible. For instance, perhaps some future version of the library can allow for the above mentioned changes be configured dynamically rather than change the source. |
Yes. A goal of this evaluator is to be as near as possible of C# by default. But you can of course try to adapt it to your need if it works. I think modify existing operators is quite easy but you need to modify ExpressionEvaluator file itself as you say. If a way to modify or extend how operators work from outside of the file could exists it would be better. It could be also easier to update the library. So I will think about it for future versions. At first EvaluationExpression was just a small thing that I made for my own needs. I just decided at some point to share it so it can maybe help others. I appreciate ideas like yours because it help this project to live. It's just that I didn't think about this specific idea until now. |
Just to keep track of some ideas related to it :
Examples : x love y;
a kill b;
Not v;
~?variable;
c @+ h;
a @ b # c;
//... |
Yes, very cool. I also like the fact that it's all in one file. thanks. |
OK I think the new release 1.4.0.0 resolve this issue. See this for more infos it took some time, but it's here. |
Method name "EvaluateTwoCharsOperators" implies it.
If one were to add "And" and "Or" operators as aliases for && and ||, the current implementation wouldn't work because "And" has three characters.
Making this change seems to work, but not sure it's the best way:
BEFORE
AFTER
The text was updated successfully, but these errors were encountered: