| 18 | } |
| 19 | |
| 20 | string FormatMacroFunction(const MacroFunction &function, const string &name) { |
| 21 | auto result = name + "("; |
| 22 | string parameters; |
| 23 | for (idx_t param_idx = 0; param_idx < function.parameters.size(); param_idx++) { |
| 24 | if (!parameters.empty()) { |
| 25 | parameters += ", "; |
| 26 | } |
| 27 | const auto ¶m_name = function.parameters[param_idx]->Cast<ColumnRefExpression>().GetColumnName(); |
| 28 | parameters += param_name; |
| 29 | |
| 30 | if (!function.types.empty() && function.types[param_idx] != LogicalType::UNKNOWN) { |
| 31 | parameters += " " + function.types[param_idx].ToString(); |
| 32 | } |
| 33 | |
| 34 | auto it = function.default_parameters.find(param_name); |
| 35 | if (it != function.default_parameters.end()) { |
| 36 | parameters += " := "; |
| 37 | parameters += it->second->ToString(); |
| 38 | } |
| 39 | } |
| 40 | result += parameters + ")"; |
| 41 | return result; |
| 42 | } |
| 43 | |
| 44 | MacroBindResult MacroFunction::BindMacroFunction( |
| 45 | Binder &binder, const vector<unique_ptr<MacroFunction>> &functions, const string &name, |
no test coverage detected