basex icon indicating copy to clipboard operation
basex copied to clipboard

Extend support for keyword args and placeholders

Open GuntherRademacher opened this issue 1 year ago • 0 comments

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 prepareArgs to Functions.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-414
  • FunctionCall-415
  • FunctionCall-416
  • FunctionCall-417

GuntherRademacher avatar Jun 17 '24 16:06 GuntherRademacher