(func: &ast::Function)
| 71 | } |
| 72 | |
| 73 | pub fn extract_func_args(func: &ast::Function) -> Result<Vec<ast::Expr>> { |
| 74 | match &func.args { |
| 75 | ast::FunctionArguments::List(args) => Ok(args |
| 76 | .args |
| 77 | .iter() |
| 78 | .filter_map(|a| match a { |
| 79 | ast::FunctionArg::Unnamed(ast::FunctionArgExpr::Expr(e)) => Some(e.clone()), |
| 80 | _ => None, |
| 81 | }) |
| 82 | .collect()), |
| 83 | _ => Ok(Vec::new()), |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /// Evaluate a constant SqlExpr to a SqlValue. Delegates to the shared |
| 88 | /// `const_fold::fold_constant` helper so that zero-arg scalar functions |
no test coverage detected