-
Notifications
You must be signed in to change notification settings - Fork 97
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
ConditionalAnd with variables #56
Comments
Hello @HelgeL |
😅 This one is tricky. 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. |
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. |
I am sorry but I did not find a way to do this easily. For a while I thing to refactor more deeply ExpressionEvaluator to use a syntaxic tree in place of just evaluating "on the fly". 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. |
Hello @codingseb, |
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. |
I took your new defined tests from V2_TrySyntaxicTreeImplementation) into the pull request. They were passed as well. |
#56 left-associative evaluation of conditional and / or expressions
OK Thanks again guys. I think your solution is very good. I close this issue. |
I Reopen this issue because the current solution do not manage all possibles cases and create a new bug with exception in scripts. |
Just published version 1.4.13.0 with additionals corrections for this. And some Refactoring and simplification. |
First, I want to say it's a fascinating and high-quality module, congratulations and thank you for putting it up here!
I have a problem evaluating expressions with variables when using ConditionalAnd and null values:
This throws a NullReferenceException with the second half, where "plain C#" would skip evaluating this part. The issue seems related to some that were discussed here recently, especially #51 and #53, but the fixes don't address it. The exception details are:
The text was updated successfully, but these errors were encountered: