-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Parse in operator before comparisons #524
Conversation
@igitur Can you also create a unit-test which really tests this functionality ? Maybe EntitiesTests ? |
20f2fb5
to
95b8c47
Compare
Done. Added new partial class in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@StefH Any chance of a new release to include the changes? |
@igitur |
I have to find a way to automatically convert a Tag into a Release here in GitHub... |
Thanks. I wasn't monitoring that.
Github already creates a draft release when you tag. To convert that to a final release isn't much extra effort. But I'm sure there will be some GitHub Actions script to do that. |
I found a github action which can do this: I've added this action on this project, so in the future, when I add a tag, this will be converted into a release. |
Great, I might use that in my own projects. |
In case you are interested in generating the release notes in the same I do: take a look at https://github.com/StefH/GitHubReleaseNotes |
Hi,
Inspired by SQL
where
clauses, I'm used to thein
operator having precedence over others likeand
andor
.For example, I'm used to
MainCompanyId in (1, 2) and Name in ("A")
to be parsed as(((x.MainCompanyId == 1) OrElse (x.MainCompanyId == 2)) AndAlso (x.Name == "A"))
.I think currently the parser attempts to parse it to something like
((((x.MainCompanyId == 1) OrElse (x.MainCompanyId == 2)) AndAlso x.Name) == "A")
, which is invalid syntax.A current workaround is to add additional parentheses and write the clause as
(MainCompanyId in (1, 2)) and (Name in ("A"))
. This parses successfully, but it feels quite verbose to me.This PR fixes the issue by first parsing for
in
s before comparisons. It was a simple fix and I'm almost surprised that it didn't break any existing tests (as far as I can see). I added a unit test for this PR's change.Hope I didn't miss anything and that you agree with change in operator precedence in principle.