Grackle: implement StartSketchAt stdlib function

This commit is contained in:
Adam Chalmers
2024-02-26 20:03:30 -06:00
committed by 49lf
parent f40cdabfdf
commit b212ff4470

View File

@ -97,3 +97,24 @@ impl Callable for Add {
})
}
}
fn single_binding(b: EpBinding, fn_name: &'static str, expected: &'static str) -> Result<Address, CompileError> {
match b {
EpBinding::Single(a) => Ok(a),
EpBinding::Sequence { .. } => Err(CompileError::ArgWrongType {
fn_name,
expected,
actual: "array".to_owned(),
}),
EpBinding::Map { .. } => Err(CompileError::ArgWrongType {
fn_name,
expected,
actual: "array".to_owned(),
}),
EpBinding::Function(_) => Err(CompileError::ArgWrongType {
fn_name,
expected,
actual: "function".to_owned(),
}),
}
}