Variable lookahead needed for ArrowTarget
#1716
Labels
Enhancement
A change or improvement to an existing feature
PR Pending
A PR has been raised to resolve this issue
XPath
An issue related to XPath
The current grammar definition allows any
QName
(viaEQName
) as anArrowStaticFunction
:This complicates the distinction of the static and dynamic variants of
ArrowTarget
, as it cannot be done with a fixed number of lookahead tokens. E.g. in an expression starting like thisthe distinction cannot be made before the left brace is seen. While constructing an LR parser, there is a shift-reduce conflict between shifting
fn
as a keyword of anInlineFunctionExpr
, or reducingfn
to theQName
ofEQName
.This can easily be fixed by adding
xgc: reserved-function-names
toArrowStaticFunction
, which would also be consistent with other function calls in disallowing reserved function names:But could not
ArrowTarget
also be written like the following?In this case, the
xgc: reserved-function-names
constraint would be inherited fromFunctionCall
. It eliminatesArrowStaticFunction
andArrowDynamicFunction
and at the same time lifts some restrictions imposed by the currentArrowTarget
. It does not cause any LALR(2) conflicts.The text was updated successfully, but these errors were encountered: