Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Allow expression functions to use named parameters
This commit sets the framework for allowing expression functions to use named parameters. Ie, instead of: clamp(1,2,3) you can use: clamp( min:=1, value:=2, max:=3) This also allows arguments to be switched, eg: clamp( value:=2, max:=3, min:=1) Additionally, it allows for a more structured definition of function parameters to handle optional arguments and default values for parameters. These are currently being done using a hacky infinite argument list. I've utilised the postgres ':=' syntax for specifying named arguments to avoid potential collisions which may arise with the equality test if we re-used just the '=' operator alone. Sponsored by North Road
- Loading branch information
Showing with 551 additions and 75 deletions.
- +104 −7 python/core/qgsexpression.sip
- +3 −3 resources/function_help/json/azimuth
- +2 −2 resources/function_help/json/randf
- +2 −2 resources/function_help/json/round
- +3 −1 scripts/process_function_template.py
- +26 −22 src/core/qgsexpression.cpp
- +290 −17 src/core/qgsexpression.h
- +10 −0 src/core/qgsexpressionlexer.ll
- +34 −5 src/core/qgsexpressionparser.yy
- +77 −16 tests/src/core/testqgsexpression.cpp
Oops, something went wrong.