Skip to content
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

Evaluating "new DateTime(2022,1,20)" does not work unless OptionInlineNamespacesEvaluationActive is turned on #127

Closed
HelgeL opened this issue Jan 20, 2022 · 6 comments
Assignees
Labels

Comments

@HelgeL
Copy link

HelgeL commented Jan 20, 2022

Still using this fantastic library and great to see it progresses! I have made a huge version jump from 1.4.12.0 to current 1.4.35.0. However one of my tests does not pass anymore, so I have fiddled around.

When evaluating this expression:
new DateTime(2022,1,20)
the result is correctly evaluated with OptionInlineNamespacesEvaluationActive=true.

However when OptionInlineNamespacesEvaluationActive=false (which was my default setting), an error is raised as follows:
Type or class DateTime is unknown

The old version could successfully evaluate this expression regardless of OptionInlineNamespacesEvaluationActive setting. Maybe it is on purpose in which case I'm fine with turning the option on. I was just hesitating with the possible performance and security implications.

@codingseb codingseb self-assigned this Jan 20, 2022
codingseb added a commit that referenced this issue Jan 20, 2022
@codingseb codingseb added the bug label Jan 20, 2022
@codingseb
Copy link
Owner

Hello @HelgeL thanks for the issue.
Yes this is a bug introduced during the evolution of ExpressionEvaluator.

It should work again in version 1.4.36.0

@codingseb
Copy link
Owner

Version 1.4.36.0 is published

@HelgeL
Copy link
Author

HelgeL commented Jan 20, 2022

Wow, Grüezi and thank you for your quick fix! That's awesome. (Can I donate somehow?)
Btw if you are interested, I have forked your repo and have enhanced ExpressionEvaluator to handling single quoted strings. Would you be interested? I could prepare a pull request, or you can see my commits from yesterday here: https://github.com/HelgeL/ExpressionEvaluator/commits/master

@HelgeL
Copy link
Author

HelgeL commented Jan 20, 2022

Found the donate button, never mind!

@codingseb
Copy link
Owner

WOW thanks a lot @HelgeL for your donation

@codingseb
Copy link
Owner

codingseb commented Jan 20, 2022

I have forked your repo and have enhanced ExpressionEvaluator to handling single quoted strings.
Would you be interested? I could prepare a pull request, or you can see my commits from yesterday here: https://github.com/HelgeL/ExpressionEvaluator/commits/master

Can be useful.

I see that it is an option so normally it should not break compatibility. Just some questions :
Do you have some tests that come with ?
Did you try it with char evaluation that use also singlequote. how do you manage potential conflicts ?
You just always use the option evaluator.OptionCharEvaluationActive = false; when evaluator.OptionSingleQuotedStringEvaluationActive= true; or you can use both together ?

We just should add some documentation on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants