You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tkobayas (via GitHub)" <gi...@apache.org> on 2024/03/27 09:32:23 UTC

[PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

tkobayas opened a new pull request, #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806

   **Issue**: 
   
   * https://github.com/apache/incubator-kie-drools/issues/5742
   
   <details>
   <summary>
   How to replicate CI configuration locally?
   </summary>
   
   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](https://github.com/kiegroup/github-action-build-chain) to handle cross repository builds and be sure that we always use latest version of the code for each repository.
    
   [build-chain tool](https://github.com/kiegroup/github-action-build-chain) 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](https://github.com/kiegroup/github-action-build-chain#local-execution) details to get more information about it.
   </details>
   
   <details>
   <summary>
   How to retest this PR or trigger a specific build:
   </summary>
   
   - for <b>pull request and downstream checks</b>  
     - Push a new commit to the PR. An empty commit would be enough.
   
   - for a <b>full downstream build</b>
     - for <b>github actions</b> job: add the label `run_fdb`
   
   - for <b>Jenkins PR check only</b>
     - If you are an ASF committer for KIE podling, login to Jenkins (https://ci-builds.apache.org/job/KIE/job/drools/), go to the specific PR job, and click on `Build Now` button.
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#issuecomment-2022309198

   Before PR
   `drools-model-codegen`
   ```
   [ERROR] Tests run: 2434, Failures: 220, Errors: 0, Skipped: 9
   ```
   
   After PR
   `drools-model-codegen`
   ```
   [ERROR] Tests run: 2434, Failures: 200, Errors: 0, Skipped: 9
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540800031


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRLParser.g4:
##########
@@ -321,8 +323,11 @@ drlPrimary
     | nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments)
     | inlineListExpression
     | inlineMapExpression
+    | inlineCast
     ;
 
+inlineCast : drlIdentifier HASH drlIdentifier ;

Review Comment:
   In `DRLParser.g4`, we mimic the parser syntax of `DRL6Expressions.g4`. However, here looks a little different. `DRL6Expressions.g4`'s `primary` rule handles more complex structure (e.g. `DOT` chaining) while such structure is handled in `drlExpression` in  `DRLParser.g4` because `drlExpression` is inherited from `JavaParser.g4`'s `expression`. 
   
   This time, I prioritized simplicity for the changes in `DRLParser.g4`. But I will file a github issue to review `drlExpression` and `drlPrimary` to make them closer to `DRL6Expressions.g4`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1542412512


##########
drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/MiscDRLParserTest.java:
##########
@@ -3870,4 +3870,43 @@ void ooPathMixedWithStandardConstraint() {
         assertThat(constraintDescr.toString())
                 .isEqualToIgnoringWhitespace("/wife[$age : age] && age > $age");
     }
+
+    @Test
+    void inlineCast() {
+        final String text = "package org.drools\n" +
+                "rule R1\n" +
+                "when\n" +
+                "  $a : ICA( someB#ICB.someC#ICC.onlyConcrete() == \"Hello\" )\n" +

Review Comment:
   Thank you for spotting this!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540800031


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRLParser.g4:
##########
@@ -321,8 +323,11 @@ drlPrimary
     | nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments)
     | inlineListExpression
     | inlineMapExpression
+    | inlineCast
     ;
 
+inlineCast : drlIdentifier HASH drlIdentifier ;

Review Comment:
   In `DRLParser.g4`, we mimic the parser syntax of `DRL6Expressions.g4`. However, here looks a little different. `DRL6Expressions.g4`'s `primary` rule handles more complex structure (e.g. `DOT` chaining) while such structure is handled in `drlExpression` in  `DRLParser.g4` because `drlExpression` is inherited from `JavaParser.g4`'s `expression`. 
   
   This time, I prioritized simplicity for the changes in `DRLParser.g4`. But I filed https://github.com/apache/incubator-kie-drools/issues/5807 to review `drlExpression` and `drlPrimary` to make them closer to `DRL6Expressions.g4`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "yurloc (via GitHub)" <gi...@apache.org>.
yurloc commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1542190526


##########
drools-drl/drools-drl-parser-tests/src/test/java/org/drools/drl/parser/antlr4/MiscDRLParserTest.java:
##########
@@ -3870,4 +3870,43 @@ void ooPathMixedWithStandardConstraint() {
         assertThat(constraintDescr.toString())
                 .isEqualToIgnoringWhitespace("/wife[$age : age] && age > $age");
     }
+
+    @Test
+    void inlineCast() {
+        final String text = "package org.drools\n" +
+                "rule R1\n" +
+                "when\n" +
+                "  $a : ICA( someB#ICB.someC#ICC.onlyConcrete() == \"Hello\" )\n" +

Review Comment:
   This is identical to the `inlineCastMultiple()` test below. Looks like a copy-paste error. Please fix.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540851851


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRLParser.g4:
##########
@@ -321,8 +323,11 @@ drlPrimary
     | nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments)
     | inlineListExpression
     | inlineMapExpression
+    | inlineCast
     ;
 
+inlineCast : drlIdentifier HASH drlIdentifier ;

Review Comment:
   I also filed https://github.com/apache/incubator-kie-drools/issues/5808 for further refactoring for the parsers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "yurloc (via GitHub)" <gi...@apache.org>.
yurloc commented on PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#issuecomment-2030680219

   Overall fixing progress: There were 270 failed tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540800031


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRLParser.g4:
##########
@@ -321,8 +323,11 @@ drlPrimary
     | nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments)
     | inlineListExpression
     | inlineMapExpression
+    | inlineCast
     ;
 
+inlineCast : drlIdentifier HASH drlIdentifier ;

Review Comment:
   In `DRLParser.g4`, we mimic the parser syntax of `DRL6Expressions.g4`. However, here looks a little different. `DRL6Expressions.g4`'s `primary` rule handles more complex structure (e.g. `DOT` chaining) while such structure is handled in `drlExpression` in  `DRLParser.g4` because `drlExpression` is inherited from `JavaParser.g4`'s `expression`. 
   
   This time, I prioritized simplicity for the changes in `DRLParser.g4`. But I will file a github issue to review `drlExpression` and `drlPrimary` to make it closer to `DRL6Expressions.g4`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540766446


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -671,7 +672,6 @@ 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 (DOT drlIdentifier)* identifierSuffix?

Review Comment:
   This line was added by https://github.com/apache/incubator-kie-drools/pull/5791 , but now `this` is handled by the later lines `|   i1=drlIdentifier ...` which can process `DOT`, `HASH` and `NULL_SAFE_DOT`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#issuecomment-2022446642

   @yurloc @mariofusco @gitgabrio Please review, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1542418273


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -230,6 +230,7 @@ drlIdentifier returns [Token token]
     | PERMITS
     | RECORD
     | VAR
+    | THIS

Review Comment:
   Thanks, especially the reason "2" is the point. We'd like to minimize the deviation from the old parser behaviour at this stage. (Hoping cleaner refactoring in the future)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas merged PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540800031


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRLParser.g4:
##########
@@ -321,8 +323,11 @@ drlPrimary
     | nonWildcardTypeArguments (explicitGenericInvocationSuffix | THIS arguments)
     | inlineListExpression
     | inlineMapExpression
+    | inlineCast
     ;
 
+inlineCast : drlIdentifier HASH drlIdentifier ;

Review Comment:
   In `DRLParser.g4`, we mimic the parser syntax of `DRL6Expressions.g4`. However, here looks a little different. `DRL6Expressions.g4`'s `primary` rule handles more complex structure (e.g. `DOT` chaining) while such a structure is handled in `drlExpression` in  `DRLParser.g4` because `drlExpression` is inherited from `JavaParser.g4`'s `expression`. 
   
   This time, I prioritized simplicity for the changes in `DRLParser.g4`. But I filed https://github.com/apache/incubator-kie-drools/issues/5807 to review `drlExpression` and `drlPrimary` to make them closer to `DRL6Expressions.g4`.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "yurloc (via GitHub)" <gi...@apache.org>.
yurloc commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1542189860


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -230,6 +230,7 @@ drlIdentifier returns [Token token]
     | PERMITS
     | RECORD
     | VAR
+    | THIS

Review Comment:
   The problem with this is that the parser will now allow `this` to appear at impossible places, for example, `Person( age.this.getSomething() )`. I _feel_ slightly uncomfortable about this :slightly_smiling_face: 
   
   But on second thought, I think it's OK because:
   
   1. A slightly more permissive parser is not a big problem as opposed to a parser that's unable to accept a valid input.
   2. It's in line with the old parser's behavior (no `THIS` token => `this` recognized as `ID` => accepted in the example above).
   3. Yes, this is probably the most pragmatic approach. Simplicity over (maybe redundant) correctness.
   
   So +0.9.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540766446


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -671,7 +672,6 @@ 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 (DOT drlIdentifier)* identifierSuffix?

Review Comment:
   This line was added by https://github.com/apache/incubator-kie-drools/pull/5791 , but now `this` is handled by the later lines `|   i1=drlIdentifier ...` which can process `HASH` and `NULL_SAFE_DOT`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540761143


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -230,6 +230,7 @@ drlIdentifier returns [Token token]
     | PERMITS
     | RECORD
     | VAR
+    | THIS

Review Comment:
   Now, I add `THIS` to `drlIdentifier` (in both `DRLParser.g4` and `DRL6Expressions.g4`) because the original `DRL6Expressions.g` treated `this` as `ID` in `primary` rule (remember that `|   this_key ...` line was commented out). `this` is involved with DRL specific syntax like inline cast (`this#Person`) and null dereference (`this.address!.city`). So I think it's better to include it in `drlIdentifier` so that we can keep parser rules simple.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1540761143


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -230,6 +230,7 @@ drlIdentifier returns [Token token]
     | PERMITS
     | RECORD
     | VAR
+    | THIS

Review Comment:
   Now, I add `THIS` to `drlIdentifier` (in both `DRLParser.g4` and `DRL6Expressions.g4`) because the original `DRL6Expressions.g` treated `this` as `ID` in `primary` rule (remember that `|   this_key ...` line was commented out). `this` is involved with DRL specific syntax like inline cast (`this#Person`) and null dereference (`this.address!.city`). So I think it's better to include it in `drlIdentifier` so that we can write simpler rules.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools#5742] [new-parser] Broken inline cast [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #5806:
URL: https://github.com/apache/incubator-kie-drools/pull/5806#discussion_r1542418273


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -230,6 +230,7 @@ drlIdentifier returns [Token token]
     | PERMITS
     | RECORD
     | VAR
+    | THIS

Review Comment:
   Thanks, especially the reason "2" is the point. We'd like to minimize deviation from the old parser behaviour at this stage. (Hoping cleaner refactoring in the future)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org