Closed johnlumley closed 5 months ago
True. The given query could be rewritten as:
pin([ "a", "b", "c"] )?1
! label(.)?parent
! array:foot(.)
It’s a common problem with the arrow operator that it can only be used for simple function calls (it’s one reason why I would like to have a value map operator, as motivated in #755).
I’ve added a fix in the PR #1078.
I'm probably getting the wrong end of the stick, but I can't see how the example for fn:pin():
meets the current EBNF. (I know bits of this area may be in flux, so this may be just for the record .)
meets the production for
ArrowExpr
, and the RHS of anArrowExpr
is, in this case, anArrowStaticFunction
ArgumentList
pair, which doesn't encompass the subsequent lookup.But for
LookupExpr
to include the?parent
requiresPostfixExpr
as its first term, andPostfixExpr
can only includeArrowExpr
viaPrimaryExpr/ParenthesizedExpr
, i.e. with brackets.