tkobayas commented on code in PR #5767:
URL: 
https://github.com/apache/incubator-kie-drools/pull/5767#discussion_r1513995365


##########
drools-drl/drools-drl-parser/src/main/antlr4/org/drools/drl/parser/antlr4/DRL6Expressions.g4:
##########
@@ -838,10 +838,10 @@ in_key
     ;
 
 operator_key
-  // TODO get rid of the DRL_MATCHES token or introduce DRL_CONTAINS etc. for 
consistency.
-  :      {(helper.isPluggableEvaluator(false))}? id=(IDENTIFIER|DRL_MATCHES) { 
helper.emit($id, DroolsEditorType.KEYWORD); }
+  // At the moment, we list possible DRLLexer tokens here, but we may be able 
to improve this by isolating lexers. IDENTIFIER is required to accept custom 
operators
+  :      {(helper.isPluggableEvaluator(false))}? 
id=(IDENTIFIER|DRL_MATCHES|DRL_MEMBEROF|DRL_CONTAINS|DRL_EXCLUDES|DRL_SOUNDSLIKE|DRL_STR)
 { helper.emit($id, DroolsEditorType.KEYWORD); }

Review Comment:
   Hi @gitgabrio 
   
   `ParserHelper.isPluggableEvaluator` is to check if the next token is a 
registered operator. The argument is a `boolean` flag to check if the operator 
is required to support negation.
   
   
https://github.com/apache/incubator-kie-drools/blob/dev-new-parser/drools-drl/drools-drl-parser/src/main/java/org/drools/drl/parser/antlr4/ParserHelper.java#L234
   
   The registry is dynamic so we can add custom operators dynamically.
   
   
https://github.com/apache/incubator-kie-drools/blob/dev-new-parser/drools-drl/drools-drl-parser/src/main/java/org/drools/drl/parser/impl/Operator.java#L102-L106
   
   So we cannot remove the sematic predicate in this case. I updated the PR 
adding a comment. 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to