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

[BUG] erroneous "lexical error" with lookup operator on maps and arrays, etc. #540

Open
joewiz opened this issue Oct 24, 2022 · 2 comments

Comments

@joewiz
Copy link
Member

joewiz commented Oct 24, 2022

Describe the bug

eXide raises an error whenever the lookup operator is used on maps and arrays, e.g., map { "bar": "baz" }?bar and ["a", "b", "c"]?2. These queries can be submitted and return correctly, so this isn't an eXist error - it's probably an xqlint error. Ever since #529 such errors are prominently displayed in the editor window rather than appearing only in the javascript console.

Expected behavior

eXide should not raise an error when the lookup operator is used.

To Reproduce

  1. Enter a query using the lookup operator into the eXide editor window: map { "bar": "baz" }?bar or ["a", "b", "c"]?2

  2. eXide will display an error:

    lexical analysis failed while expecting [S, EOF, '!', '!=', '(', '(:', ')', '*', '+', ',', '-', '/', '//', ':', ';', '<', '<<', '<=', '=', '>', '>=', '>>', '[', ']', 'after', 'and', 'as', 'ascending', 'at', 'before', 'by', 'case', 'cast', 'castable', 'collation', 'contains', 'count', 'default', 'descending', 'div', 'else', 'empty', 'end', 'eq', 'except', 'for', 'ge', 'group', 'gt', 'idiv', 'instance', 'intersect', 'into', 'is', 'le', 'let', 'lt', 'mod', 'modify', 'ne', 'only', 'or', 'order', 'paragraphs', 'return', 'satisfies', 'sentences', 'stable', 'start', 'times', 'to', 'treat', 'union', 'where', 'with', 'words', '|', '||', '|}', '}'] at line 3, column 21: ...?bar (:["a", "b", "c"]?2:)

Screenshots

n/a

Context (please always complete the following information):

  • OS: macOS 12.6
  • eXist-db version: eXist 6.1.0-SNAPSHOT 6a9bd0d6fb427dbd3f681a55134d9f9da0cdeafa 20221023104620
  • Java Version: OpenJDK 1.8.0_34 (Temurin build 1.8.0_345-b01)
  • App Version: develop

Additional context

  • How is eXist-db installed? built from source
  • Any custom changes in e.g. conf.xml? None.
@joewiz
Copy link
Member Author

joewiz commented Oct 25, 2022

Same goes for the arrow operator. "foo" => string-length() will generate the same error.

@joewiz joewiz changed the title [BUG] erroneous "lexical error" with lookup operator on maps and arrays [BUG] erroneous "lexical error" with lookup operator on maps and arrays, etc. Oct 25, 2022
@joewiz
Copy link
Member Author

joewiz commented Dec 3, 2022

This is really just a variant of #224. For the current status see #224 (comment).

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

No branches or pull requests

1 participant