2023-12-05 17:08:22 -05:00
|
|
|
use crate::{BuiltInFunction, Map, Result, Type, Value};
|
2023-11-28 17:54:17 -05:00
|
|
|
|
|
|
|
pub struct Output;
|
|
|
|
|
|
|
|
impl BuiltInFunction for Output {
|
|
|
|
fn name(&self) -> &'static str {
|
|
|
|
"output"
|
|
|
|
}
|
|
|
|
|
2023-11-30 02:09:55 -05:00
|
|
|
fn run(&self, arguments: &[Value], _context: &Map) -> Result<Value> {
|
2023-11-28 17:54:17 -05:00
|
|
|
for argument in arguments {
|
|
|
|
println!("{argument}");
|
|
|
|
}
|
|
|
|
|
2023-12-22 15:02:22 -05:00
|
|
|
Ok(Value::Option(None))
|
2023-11-28 17:54:17 -05:00
|
|
|
}
|
2023-12-01 22:16:50 -05:00
|
|
|
|
2023-12-05 17:08:22 -05:00
|
|
|
fn r#type(&self) -> Type {
|
|
|
|
Type::Function {
|
2023-12-01 22:16:50 -05:00
|
|
|
parameter_types: vec![Type::Any],
|
2023-12-26 17:19:12 -05:00
|
|
|
return_type: Box::new(Type::None),
|
2023-12-05 17:08:22 -05:00
|
|
|
}
|
2023-12-01 22:16:50 -05:00
|
|
|
}
|
2023-11-28 17:54:17 -05:00
|
|
|
}
|