mariofusco commented on code in PR #6354:
URL:
https://github.com/apache/incubator-kie-drools/pull/6354#discussion_r2102187922
##########
drools-model/drools-mvel-parser/src/main/java/org/drools/mvel/parser/ast/expr/PointFreeExpr.java:
##########
@@ -33,17 +33,23 @@ public class PointFreeExpr extends Expression {
private final NodeList<Expression> right;
private final SimpleName operator;
+ private final SimpleName subOperator;
private boolean negated;
private final Expression arg1;
private final Expression arg2;
private final Expression arg3;
private final Expression arg4;
public PointFreeExpr( TokenRange tokenRange, Expression left,
NodeList<Expression> right, SimpleName operator, Boolean negated, Expression
arg1, Expression arg2, Expression arg3, Expression arg4 ) {
+ this(tokenRange, left, right, operator, null, negated, arg1, arg2,
arg3, arg4 );
+ }
+
+ public PointFreeExpr( TokenRange tokenRange, Expression left,
NodeList<Expression> right, SimpleName operator, SimpleName subOperator,
Boolean negated, Expression arg1, Expression arg2, Expression arg3, Expression
arg4 ) {
super(tokenRange);
this.left = left;
this.right = right;
this.operator = operator;
+ this.subOperator = subOperator;
Review Comment:
Ok, now I see why you introduced the `subOperator`, but I'm still doubtful
if this is necessary and we want it. What I mean is that the syntax op[subOp]
has always been very weird to me and we kept there only for legacy/historical
reasons. In other words there's no reason why we have `str[startsWith]` and
`str[endsWith]` instead of `stringStartsWith` and `stringEndsWith`, they are 2
distinct operators anyway and doesn't have anything in common. What I mean is
that I would prefer to avoid the additional `subOperator` and in this case just
having operator=`str[startsWith]`. Anyway I'm not sure if this is feasible or
if I'm missing some impilcations, so feel free to ignore this comment if this
is not possible.
--
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]