-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
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.
Seems good, good job!
I’ll wait for @Syst3ms to reply for this one. |
src/main/java/io/github/syst3ms/skriptparser/parsing/SyntaxParser.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Giovanni <42092549+Matocolotoe@users.noreply.github.com>
src/main/java/io/github/syst3ms/skriptparser/parsing/SyntaxParser.java
Outdated
Show resolved
Hide resolved
@@ -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 |
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.
Might need some testing to check that this isn't being initialized until after registration.
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.
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.
Closes #23.
This is a small fix for the bug described in the above issue.
Basically, expression parsing now goes as follows:
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.