ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Order by modifier warning #204

Closed sofiageo closed 7 years ago

sofiageo commented 8 years ago
for $x in 1 to 10
order by $x
return $x

is OK, but

for $x in 1 to 10
order by $x descending
return $x

Gives a warning for word descending https://www.w3.org/TR/xquery/#doc-xquery-OrderModifier

ligasgr commented 8 years ago

Can you please show a screenshot of how it looks like when you see the "warning"? I can, temporarily, see an underscore and not marking as a keyword but only until I type in "return $x". Does it persists also after full expression is typed in? Can you please also specify the version of the plugin and the IDE?

sofiageo commented 8 years ago

I'm using IntelliJ IDEA 2016.1.3 on Windows 10 XQuery Plugin 3.0.2 The warning persists. Example (including some more issues) forligas

sofiageo commented 8 years ago

OK I start to have the feeling It's my fault for using wrong command order... but it still works like that in BaseX so it was confusing. Sorry about false flag. Since it works (I don't know if it's valid XQuery or not), maybe you can adjust it to work with this order too?

ligasgr commented 8 years ago

You're absolutely right that it should support. It's part of 3.0 version that it can be in any order. https://www.w3.org/TR/xquery-30/#prod-xquery30-IntermediateClause

The issue is with the lexical analysis aspect where the "where" is missing in the list of "following" tokens (XQuery.flex:285 and XQuery.flex:283).

ligasgr commented 8 years ago

Thanks for quick response and additional data. It's nearly impossible to analyse the issue without that 👍