mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 00:45:37 +01:00
Pass FuncCtx to Insn::Function to keep track of arg count
This commit is contained in:
@@ -104,6 +104,22 @@ pub enum Func {
|
||||
Json(JsonFunc),
|
||||
}
|
||||
|
||||
impl Func {
|
||||
pub fn to_string(&self) -> String {
|
||||
match self {
|
||||
Func::Agg(agg_func) => agg_func.to_string().to_string(),
|
||||
Func::Scalar(scalar_func) => scalar_func.to_string(),
|
||||
Func::Json(json_func) => json_func.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FuncCtx {
|
||||
pub func: Func,
|
||||
pub arg_count: usize,
|
||||
}
|
||||
|
||||
impl Func {
|
||||
pub fn resolve_function(name: &str, arg_count: usize) -> Result<Func, ()> {
|
||||
match name {
|
||||
|
||||
Reference in New Issue
Block a user