Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing VisitNotExpression method #8

Open
michael-zaytsev opened this issue Nov 24, 2021 · 1 comment
Open

Missing VisitNotExpression method #8

michael-zaytsev opened this issue Nov 24, 2021 · 1 comment

Comments

@michael-zaytsev
Copy link

michael-zaytsev commented Nov 24, 2021

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

@michael-zaytsev
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant