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

Issue when running xqdoc with specific attribute names. #44

Open
peetkes opened this issue Jan 9, 2023 · 0 comments
Open

Issue when running xqdoc with specific attribute names. #44

peetkes opened this issue Jan 9, 2023 · 0 comments

Comments

@peetkes
Copy link

peetkes commented Jan 9, 2023

I created a test-case with a function containing a let statement with a specific attribute predicate and ran into an issue with the parser.
I got an error message stating:

line l:p mismatched input '$' expecting {EQUAL, NOT_EQUAL, LBRACKET, RBRACE, STAR, PLUS, MINUS, COMMA, SLASH, DSLASH, VBAR, LANGLE, RANGLE, BANG, ARROW, CONCATENATION, KW_AND, KW_CAST, KW_CASTABLE, KW_DIV, KW_EQ, KW_EXCEPT, KW_GE, KW_GT, KW_IDIV, KW_INSTANCE, KW_INTERSECT, KW_IS, KW_LE, KW_LT, KW_MOD, KW_NE, KW_OR, KW_TO, KW_TREAT, KW_UNION}

when I test the function with ANTLR Preview in IntelliJ I also see a similar error regarding the mismatched input '$'

I think it is caused by the fact that I used a specific attribute name 'previous'

Whenever I test a construct like this:

let $var := fn:empty($element[@previous])
..

I get that error message. As soon as I change it to something else like:

let $var := fn:empty($element[@prev])
..

It will work as expected.
Is there a list of names that cannot be used as parameter names or prdicates?
I noted that I get the same error when I use this:

let $previous := fn:empty($element[@prev])

This gives the same error.

Is that something that should be fixed in the grammar?

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • IntelliJ Ultimate version: IntelliJ IDEA 2022.2.2 (Ultimate Edition)
  • Version [e.g. 22]
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