Comments (10)
Hello @codingseb,
I am a coworker of @HelgeL and we had another look at the problem.
We figured out a way to realize left associativity and put together a solution that's working for our cases and passes all of your test cases as well.
I will add a few comments to it and than suggest a pull request for our fork.
Maybe it will help you or others.
from expressionevaluator.
Hello @HelgeL
Thanks to opening this issue.
I will look about this bug as soon as possible.
from expressionevaluator.
😅 This one is tricky.
Because of the way ExpressionEvaluator evaluate operators. It evaluate first all elements between operators and then evaluate operators in the result stack with simple values. For a majority of operators it works well.
But in the case of ConditionalAnd and ConditionalOr I need to find a way to delay the evaluation of what is to the right. And decide later if it need to be evaluate depending on the result of what is to the left.
Maybe with temporary encapsulate the right part in a SubExpression it will works. I will make some tests and publish a new version ASAP.
Not sure if it will not break the precedence rules.
from expressionevaluator.
Thanks @codingseb for looking into the issue. Unfortunately I cannot be much of help for fixing it (I wish I was...). But what you write makes total sense, it seems a way to eliminate the test what's on the right is needed in case left is null, given the operator is one of the "Conditional" ones.
from expressionevaluator.
I am sorry but I did not find a way to do this easily.
The current way ExpressionEvaluator evaluate things avoid to delay or cancel evaluation of the right part of operators without breaking precedence rules (priorities of execution between operators)
For a while I thing to refactor more deeply ExpressionEvaluator to use a syntaxic tree in place of just evaluating "on the fly".
If I succeed one day to do this transition. It should allow a set of interesting new functionalities and to correct this bug. But it will probably take longer than I thought.
I opened a specific issue to follow the evolution of implementing this transition to a 2.0 ExpressionEvaluator (#58)
For now I can only suggest that you find another way to write the expressions affected by this bug.
from expressionevaluator.
Hello @Karbot.
Ho that's very nice. Yes I will gladly look to your pull request if you suggest one.
For the operators precedence bugs I added some tests in the branch V2_TrySyntaxicTreeImplementation that are not in master if you want to test it on your solution. Otherwise I will test it myself on your pull request.
Thanks for your contribution for you and @HelgeL. It is very appreciated.
from expressionevaluator.
I took your new defined tests from V2_TrySyntaxicTreeImplementation) into the pull request. They were passed as well.
from expressionevaluator.
OK Thanks again guys. I think your solution is very good.
I just published version 1.4.12.0 that contains your work and correct this bug.
I close this issue.
I will keep the v2.0 issue open and maybe one day this will be manage by syntaxic tree.
But it's now less important to do it fast.
from expressionevaluator.
I Reopen this issue because the current solution do not manage all possibles cases and create a new bug with exception in scripts.
So I am currently working on adapting and extending the current found solution with more tests to manage theses additional linked bugs
from expressionevaluator.
Just published version 1.4.13.0 with additionals corrections for this. And some Refactoring and simplification.
from expressionevaluator.
Related Issues (20)
- Add an option to disallow accessing namespaces HOT 2
- Referencing property of property can cause unwanted exception
- Syntax error of sign symbols
- Intelligente type casting
- Error message - Exception has been thrown by the target of an invocation. HOT 3
- Linq Select throws exception (ValueTuple?) issue? HOT 3
- Syntax error in Functions HOT 3
- Incorrect result. HOT 1
- Strong name HOT 1
- Ignore missing zero in numeric values
- Match function arguments considering implicit casts HOT 2
- Decimal support for math functions
- Slow EvaluateCast HOT 1
- Syntax error calling overloaded method in context object including Func<> parameter
- Link error in Unity Android il2cpp build
- Can't handle division HOT 2
- [Suggestion] AssignVariable in Script Evaluation (Not in Declraration)
- Doesn't process a IDictionary<string, object> correctly.
- Is it possible to add an operator that is both right-hand-side-only and can act as a normal one? HOT 2
- RobiniaDocs API Explorer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expressionevaluator.