validate a function-call
| 528 | |
| 529 | // validate a function-call |
| 530 | static AST_Validation _ValidateFunctionCall |
| 531 | ( |
| 532 | const char *funcName, // function name |
| 533 | bool include_aggregates // are aggregations allowed |
| 534 | ) { |
| 535 | // check existence of the function-name |
| 536 | if(!AR_FuncExists(funcName)) { |
| 537 | ErrorCtx_SetError("Unknown function '%s'", funcName); |
| 538 | return AST_INVALID; |
| 539 | } |
| 540 | |
| 541 | if(!include_aggregates && AR_FuncIsAggregate(funcName)) { |
| 542 | // Provide a unique error for using aggregate functions from inappropriate contexts |
| 543 | ErrorCtx_SetError("Invalid use of aggregating function '%s'", funcName); |
| 544 | return AST_INVALID; |
| 545 | } |
| 546 | |
| 547 | return AST_VALID; |
| 548 | } |
| 549 | |
| 550 | // validate an apply-all operator |
| 551 | static VISITOR_STRATEGY _Validate_apply_all_operator |
no test coverage detected