From 9765715ca0b1940b0baf357064a6a9e4b072bc9c Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Thu, 23 Jan 2025 18:17:45 +0900 Subject: [PATCH] - drop infix doubleAmpersand and doublePipe --- .gitignore | 1 + .../org/drools/drl/parser/antlr4/MiscDRLParserTest.java | 3 +++ .../main/antlr4/org/drools/drl/parser/antlr4/DRL10Parser.g4 | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 655baabbb2b..2d195d5f653 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ nbproject *.ipr *.iws *.iml +build.log # generated files dependency-reduced-pom.xml diff --git a/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/MiscDRLParserTest.java b/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/MiscDRLParserTest.java index 40fb99d67fd..f51d7c76ebe 100644 --- a/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/MiscDRLParserTest.java +++ b/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/MiscDRLParserTest.java @@ -5140,6 +5140,7 @@ void accumulateEmptyChunks() { assertThat(accumulateDescr.getResultCode()).isEqualTo("null"); } + @DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true") @Test void doublePipeInfixOr() { final String text = @@ -5161,6 +5162,7 @@ void doublePipeInfixOr() { }); } + @DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true") @Test void doubleAmpersandInfixAnd() { final String text = @@ -5180,6 +5182,7 @@ void doubleAmpersandInfixAnd() { }); } + @DisabledIfSystemProperty(named = "drools.drl.antlr4.parser.enabled", matches = "true") @Test void doubleAmpersandInfixAndInAccumulate() { final String text = diff --git a/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL10Parser.g4 b/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL10Parser.g4 index cc5080da384..8e2734761fc 100644 --- a/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL10Parser.g4 +++ b/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL10Parser.g4 @@ -123,15 +123,15 @@ queryLhs : lhsExpression* ; lhsExpression : LPAREN lhsExpression RPAREN #lhsExpressionEnclosed | DRL_OR drlAnnotation* lhsExpression+ #lhsOr - | lhsExpression ((DRL_OR|OR) drlAnnotation* lhsExpression)+ #lhsOr + | lhsExpression ((DRL_OR) drlAnnotation* lhsExpression)+ #lhsOr | DRL_AND drlAnnotation* lhsExpression+ #lhsAnd - | lhsExpression ((DRL_AND|AND) drlAnnotation* lhsExpression)+ #lhsAnd + | lhsExpression ((DRL_AND) drlAnnotation* lhsExpression)+ #lhsAnd | lhsUnary #lhsUnarySingle ; // lhsAnd is used as a label in lhsExpression rule. But some other rules explicitly use the def, so lhsAndDef is declared. lhsAndDef : LPAREN lhsAndDef RPAREN - | lhsUnary ((DRL_AND|AND) lhsUnary)* + | lhsUnary ((DRL_AND) lhsUnary)* | LPAREN DRL_AND lhsUnary+ RPAREN ;