-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[new-parser] Support LHS pattern annotations #5797
Conversation
@@ -124,7 +124,7 @@ lhsPattern : xpathPrimary (OVER patternFilter)? | | |||
( QUESTION? qualifiedIdentifier LPAREN positionalConstraints? constraints? RPAREN (OVER patternFilter)? (FROM patternSource)? ) ; | |||
*/ | |||
|
|||
lhsPattern : QUESTION? objectType=drlQualifiedName LPAREN positionalConstraints? constraints? RPAREN (DRL_OVER patternFilter)? (DRL_FROM patternSource)? ; | |||
lhsPattern : QUESTION? objectType=drlQualifiedName LPAREN positionalConstraints? constraints? RPAREN drlAnnotation* (DRL_OVER patternFilter)? (DRL_FROM patternSource)? ; |
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.
This allows an annotation to appear after a LHS pattern, for example, Person() @watch(!age)
.
@@ -459,7 +459,7 @@ type : (classOrInterfaceType | primitiveType) typeArguments? ( DOT IDENTIFIER ty | |||
drlArguments : LPAREN drlArgument (COMMA drlArgument)* RPAREN ; | |||
drlArgument : ( stringId | floatLiteral | BOOL_LITERAL | NULL_LITERAL ) ; | |||
|
|||
drlAnnotation : AT name=drlQualifiedName (LPAREN ( drlElementValuePairs | drlElementValue )? RPAREN)? ; | |||
drlAnnotation : AT name=drlQualifiedName ((LPAREN ( drlElementValuePairs | drlElementValue )? RPAREN) | chunk)? ; |
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.
This allows an annotation value to be something that doesn't fit into the standard Java annotation key-value format, for example, @watch(!*, age)
.
} | ||
} | ||
return value; | ||
} |
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.
This one is used by both the old parser and the new parser's visitor.
@tkobayas, @mariofusco, @gitgabrio please review. |
Before PR
After PR
|
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!
@yurloc Please solve the conflict (likely because of recent other PR merge), thanks! |
2e9d9a2
to
03a56a0
Compare
Done. @mariofusco please merge. |
Overall fixing progress: Error: There were 370 failed tests. |
FYI) @yurloc , you seem to take the |
* LHS patterns can have annotations * LHS pattern annotations can contain chunks
* LHS patterns can have annotations * LHS pattern annotations can contain chunks
* LHS patterns can have annotations * LHS pattern annotations can contain chunks
* LHS patterns can have annotations * LHS pattern annotations can contain chunks
* LHS patterns can have annotations * LHS pattern annotations can contain chunks
Fixes #5740.
This change replicates the old parser's behavior.
Multiple annotations can appear after an LHS pattern:
incubator-kie-drools/drools-drl/drools-drl-parser/src/main/java/org/drools/drl/parser/lang/DRL6Parser.java
Lines 3559 to 3564 in 4004fe9
A DRL annotation can either contain Java-style key-value pairs, or a chunk:
incubator-kie-drools/drools-drl/drools-drl-parser/src/main/java/org/drools/drl/parser/lang/DRL6Parser.java
Lines 4673 to 4732 in 4004fe9
How to replicate CI configuration locally?
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.
build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.
How to retest this PR or trigger a specific build:
for pull request and downstream checks
for a full downstream build
run_fdb
for Jenkins PR check only
Build Now
button.