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

fix: boolean operator fix (#23) #83

Merged
merged 8 commits into from
Dec 29, 2020
Merged

Conversation

Mwexim
Copy link
Owner

@Mwexim Mwexim commented Oct 18, 2020

Closes #23.

This is a small fix for the bug described in the above issue.
Basically, expression parsing now goes as follows:

  1. Literal parsing (unchanged)
  2. Variable parsing (unchanged)
  3. Boolean operator parsing (forced)
  4. List parsing (unchanged)
  5. Expression parsing (unchanged)

This means boolean operators will now have priority, which was needed in the expression. If you still want to use a boolean list (why, I don't know...), you can just paste 'list' in front of your expression to force-parse it as a list.

Note that these changes are propositional and that any suggestions are welcome. This is just my take on the problem. I think changing the whole list syntax is a bit over the top for such a small issue.
Let me know if you are satisfied with the 'list' prefix as well.

Olyno
Olyno previously approved these changes Oct 18, 2020
Copy link
Contributor

@Olyno Olyno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, good job!

@Mwexim
Copy link
Owner Author

Mwexim commented Oct 19, 2020

I’ll wait for @Syst3ms to reply for this one.

Co-authored-by: Giovanni <42092549+Matocolotoe@users.noreply.github.com>
Olyno
Olyno previously approved these changes Oct 25, 2020
@@ -64,6 +64,12 @@
// Gradle requires the cast, but IntelliJ considers it redundant
public static final PatternType<Object> OBJECTS_PATTERN_TYPE = new PatternType<>((Type<Object>) TypeManager.getByClass(Object.class).orElseThrow(AssertionError::new), false);

public static final ExpressionInfo<ExprBooleanOperators, Boolean> EXPRESSION_BOOLEANOPERATORS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need some testing to check that this isn't being initialized until after registration.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some testing and no errors appear, which is normal considering we don't use the class until after registration. Unless we change things drastically in the future, this should be fine.

@Mwexim Mwexim merged commit d9aaf95 into master Dec 29, 2020
@Mwexim Mwexim deleted the improve/boolean-operator-fix branch December 29, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Or and And words don't make their jobs
4 participants