(name: &str, function_definition: &UserFunctionDefinition, args: &[Value])
| 46 | } |
| 47 | |
| 48 | fn validate_parameters(name: &str, function_definition: &UserFunctionDefinition, args: &[Value]) -> Result<(), DscError> { |
| 49 | if let Some(expected_params) = &function_definition.parameters { |
| 50 | if args.len() != expected_params.len() { |
| 51 | return Err(DscError::Parser(t!("functions.userFunction.wrongParamCount", name = name, expected = expected_params.len(), got = args.len()).to_string())); |
| 52 | } |
| 53 | for (arg, expected_param) in args.iter().zip(expected_params) { |
| 54 | validate_parameter_type(name, arg, &expected_param.r#type)?; |
| 55 | } |
| 56 | } |
| 57 | Ok(()) |
| 58 | } |
| 59 | |
| 60 | fn validate_output_type(name: &str, function_definition: &UserFunctionDefinition, output: &Value) -> Result<(), DscError> { |
| 61 | match function_definition.output.r#type { |
no test coverage detected