Skip to content

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

@joewiz

Description

@joewiz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions