basex
basex copied to clipboard
Extend support for keyword args and placeholders
The support for calling user-defined functions needs to be extended by
- handling keyword arguments,
- establishing the correct order of parameters of partially evaluated functions. This may deviate from the order in the target function when placeholders are used for keyword arguments.
This change
- adds a call to
prepareArgstoFunctions.dynamic, in order to integrate keyword arguments into the positional argument list. - calculates a permutation of placeholder ordinals, mapping the i-th placeholder in the integrated positional argument list (for the target function) to its position in the parameter list of the partially applied function,
- propagates the type to the parameter variable, in order to enable item coercion,
- disallows keyword arguments in dynamic function calls during parsing.
The corresponding QT4 test cases are
FunctionCall-414FunctionCall-415FunctionCall-416FunctionCall-417