[Bug 30017] UpdatingFunctionCall use of PrimaryExpr makes the grammar ambiguous.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=30017

Michael Dyck <jmdyck@ibiblio.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdyck@ibiblio.org

--- Comment #1 from Michael Dyck <jmdyck@ibiblio.org> ---
(In reply to Reece H. Dunn from comment #0)
> UpdatingFunctionCall is defined in Update Facility 3.0 as:
> 
>     [207] UpdatingFunctionCall ::= "invoke" "updating" PrimaryExpr "("
> (ExprSingle ("," ExprSingle)*)? ")"
> 
> However, PrimaryExpr contains FunctionCall. This means that for:
> 
>     invoke updating test()
> 
> 'test()' will be interpreted as FunctionCall. That is:
> 
>     UpdatingFunctionCall: 'invoke updating'
>         PrimaryExpr/FunctionCall: 'test()'
>         [error]: missing token '('

Yes, that looks like the correct behaviour to me. What do you think is
ambiguous?


> It also does not make sense for this to be an OrderedExpr or Constructor
> (which are valid according to the grammar).

(Note to others: "this" = "the PrimaryExpr of an UpdatingFunctionCall".)

E.g., if you used a Constructor there, you'd get a type error. But it's not the
grammar's job to only derive type-safe queries.  


> It would make more sense to define this similar to the XQuery 3.1
> ArrowFunctionSpecifier:
> 
>     [127] ArrowFunctionSpecifier ::= EQName | VarRef | ParenthesizedExpr
> 
> For example:
> 
>     UpdatingFunctionCall ::= "invoke" "updating"
>       UpdatingFunctionCallSpecifier "(" (ExprSingle ("," ExprSingle)*)? ")"
>     UpdatingFunctionCallSpecifier ::= EQName | VarRef | ParenthesizedExpr

It's possible that might make more sense to some people. But note that
UpdatingFunctionCall is fairly explicitly modelled after XQuery's
DynamicFunctionCall, which also uses a PrimaryExpr to specify the function to
be invoked.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 21 November 2016 06:06:51 UTC