镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Missing VisitNotExpression method #8

Open

Description

@michael-zaytsev

Good day to you all!

Trying to create query from not contains(property/path, 'value'), I get the following log entry:

Unhandled node type: NotExpression Token {
  position: 20,
  next: 56,
  value: Token {
    position: 24,
    next: 56,
    value: { method: 'contains', parameters: [Array] },
    type: 'MethodCallExpression',
    raw: "contains(property/path, 'value')"
  },
  type: 'NotExpression',
  raw: "not contains(property/path, 'value')"
}

I found out that its reason is missing VisitNotExpression method in /src/visitor.ts.
As a result, I don't get expected query.

Package version: 0.1.2

Activity

  1. michael-zaytsev commented on Nov 24, 2021

    @michael-zaytsev
    Author

    How I see the solution...

    Within VisitNotExpression method, populating metadata property of Lexer.Token with negation property can be added at least for MethodCallExpression token.
    Then node.metadata?.negation can be used in VisitMethodCallExpression method.

    I think this solution is quite suitable because the question is just whether NOT token should be inserted into a query of one of a few already processed method expressions or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions