-
Notifications
You must be signed in to change notification settings - Fork 5
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
[DROOLS-7310] parse nested parentheses #42
[DROOLS-7310] parse nested parentheses #42
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.
@tkobayas @mariofusco
Sorry guys, but this code is getting impossible to understand.
Please add comments/explanations to methods/variables, otherwise it will become another only-one-person-in-the-world can manage it.
BaseDescr descr = visitLhsPatternBind(ctx.lhsPatternBind()); | ||
existsDescr.addDescr(descr); | ||
if (ctx.lhsOrDef() != null) { | ||
BaseDescr descr = visitDescrChildren(ctx.lhsOrDef()).get(0); |
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.
@tkobayas
Please check and manage the case where this -> visitDescrChildren(ctx.lhsOrDef())
returns an empty list
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, I'll work on it.
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.
Done
@gitgabrio Thank you very much for the suggestion. I'll add more comments/explanation for this PR. And also I will add comments/explanation on overall drools-parser codebase (and probably "developer notes") as a separated JIRA https://issues.redhat.com/browse/DROOLS-7577 |
Great, many thanks @tkobayas !!! |
@@ -2835,7 +2833,6 @@ public void parse_TypeDeclarationWithFields() throws Exception { | |||
|
|||
} | |||
|
|||
@Disabled("Priority : High | Failed to parse or with parentheses in LHS") | |||
@Test | |||
public void parse_RuleWithLHSNesting() throws Exception { |
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.
Hi @tkobayas : Does this (or other) test cover multi-level nesting ?
If not, could you please add one that cover that specific case (multiple level of nested parentheses) ?
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.
The test case is one level nest (renamed to parenthesesOneLevelNestWithThreeSiblings
).
However, we already had multipleLevelNestAndOrOrOrAnd()
(renamed).
I also added 2 test cases of tricky multiple level nesting : multipleLevelNestWithThreeOrSiblings
and existsMultipleLevelNestWithThreeOrSiblings
Thanks!
- Adding more nested level tests
Updated with more comments (only for this PR related part. I'll do overall review with https://issues.redhat.com/browse/DROOLS-7577). @gitgabrio , feel free to let me know if you want more explanations on some specific places. Thanks! |
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 @tkobayas LGTM!
No description provided.