This is an automated email from the ASF dual-hosted git repository.
tkobayas pushed a commit to branch dev-new-parser
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git
The following commit(s) were added to refs/heads/dev-new-parser by this push:
new 3ac65e9ef0 Primary rule should accept `this` keyword (#5791)
3ac65e9ef0 is described below
commit 3ac65e9ef0182fc39a6eeb9749b8e6b8a2f251e5
Author: Jiří Locker <[email protected]>
AuthorDate: Mon Mar 18 11:08:06 2024 +0100
Primary rule should accept `this` keyword (#5791)
As in `String(this == "x")`.
---
.../src/test/java/org/drools/drl/parser/antlr4/DRLExprParserTest.java | 1 +
.../src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4 | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git
a/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/DRLExprParserTest.java
b/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/DRLExprParserTest.java
index c404d2e0ef..e32f287beb 100644
---
a/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/DRLExprParserTest.java
+++
b/drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/DRLExprParserTest.java
@@ -317,6 +317,7 @@ public class DRLExprParserTest {
"(long) l",
"(float) f",
"(double) d",
+ "this",
"<Type>this()",
"Object[][].class.getName()",
"new<Integer>ArrayList<Integer>()"
diff --git
a/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4
b/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4
index c8a34b5076..d85859d3bd 100644
---
a/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4
+++
b/drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4
@@ -671,7 +671,7 @@ primary returns [BaseDescr result]
: expr=parExpression { if( buildDescr ) { $result = $expr.result; } }
| nonWildcardTypeArguments (explicitGenericInvocationSuffix | this_key
arguments)
| literal { if( buildDescr ) { $result = new AtomicExprDescr(
$literal.text, true ); } }
- //| this_key ({!helper.validateSpecialID(2)}? DOT IDENTIFIER)*
({helper.validateIdentifierSufix()}? identifierSuffix)?
+ | this_key (DOT drlIdentifier)* identifierSuffix?
| super_key superSuffix
| new_key creator
| primitiveType (LBRACK RBRACK)* DOT class_key
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]