Skip to content

Commit

Permalink
- drop Annotation inside LHS
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Jan 23, 2025
1 parent 9765715 commit 1457c6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4057,6 +4057,7 @@ void lhsPatternAnnotation() {
assertThat(annotationDescr.getSingleValueAsString()).isEqualTo("!*, age");
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void prefixAndDescrAnnotation() {
final String text =
Expand All @@ -4078,6 +4079,7 @@ void prefixAndDescrAnnotation() {
assertThat(andDescr.getDescrs()).hasSize(2);
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void prefixOrDescrAnnotation() {
final String text =
Expand All @@ -4100,6 +4102,7 @@ void prefixOrDescrAnnotation() {
assertThat(orDescr.getDescrs()).hasSize(2);
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void infixAndDescrAnnotation() {
final String text =
Expand All @@ -4120,6 +4123,7 @@ void infixAndDescrAnnotation() {
assertThat(andDescr.getDescrs()).hasSize(3);
}

@DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true")
@Test
void infixOrDescrAnnotation() {
final String text =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ lhs : DRL_WHEN lhsExpression* ;
queryLhs : lhsExpression* ;

lhsExpression : LPAREN lhsExpression RPAREN #lhsExpressionEnclosed
| DRL_OR drlAnnotation* lhsExpression+ #lhsOr
| lhsExpression ((DRL_OR) drlAnnotation* lhsExpression)+ #lhsOr
| DRL_AND drlAnnotation* lhsExpression+ #lhsAnd
| lhsExpression ((DRL_AND) drlAnnotation* lhsExpression)+ #lhsAnd
| DRL_OR lhsExpression+ #lhsOr
| lhsExpression ((DRL_OR) lhsExpression)+ #lhsOr
| DRL_AND lhsExpression+ #lhsAnd
| lhsExpression ((DRL_AND) lhsExpression)+ #lhsAnd
| lhsUnary #lhsUnarySingle
;

Expand Down

0 comments on commit 1457c6f

Please sign in to comment.