Skip to content

Like operator did not strip off quotes  #1

@shijinglu

Description

@shijinglu
  1. Like operator did not strip off quotes
  2. Right node of the like op should be a literal instead of an identity
@Override
    public void exitExprLikeOp(LureParser.ExprLikeOpContext ctx) {
        super.exitExprLikeOp(ctx);
        String leftIdentifier = ctx.expr().getText();
        String rightStrLiteral = ctx.TK_STRING_LITERAL().getText();
        if (rightStrLiteral.length() > 2) {
            rightStrLiteral = rightStrLiteral.substring(1, rightStrLiteral.length() - 1);
        }
        astMap.put(
                ctx,
                new NodeLike(
                        NodeIdentity.fromString(leftIdentifier),
                        NodeLiteral.fromString(rightStrLiteral),
                        null,
                        null,
                        null));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions