ligasgr / intellij-xquery

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

Missing $ in for construct not reported as an error. #176

Closed rhdunn closed 8 years ago

rhdunn commented 8 years ago

Given:

let $a := (1, 2, 3)
return for $b in a return $b
                 ^----- missing '$'

The missing '$' error or similar should be reported, but isn't.

ligasgr commented 8 years ago

hi,

This is perfectly, syntacticly valid code. 'a' in this case is 'step expression' with 'forward step' which simply means that this expression will take an element 'a' from context item. Full path is StepExpr->AxisStep->ForwardStep->AbbrevForwardStep->NodeTest->NameTest. More details here: https://www.w3.org/TR/xquery-30/#doc-xquery30-ForwardStep