|
pub(crate) use llcore_runtime::api::*; |
|
|
|
#[allow(non_snake_case)] |
|
pub(crate) mod symbol___io_println { |
|
use super::*; |
|
|
|
#[allow(non_camel_case_types)] |
|
#[derive(Debug, Clone, PartialEq)] |
|
pub struct effect___io_println; |
|
|
|
#[async_trait] |
|
impl Effect for effect___io_println { |
|
async fn call( |
|
&self, |
|
context: Arc<Mutex<TaskContext>>, |
|
co: &FunctionCoroutine, |
|
args: Vec<Value>, |
|
) -> Value { |
|
helpers::assert_param_count(&co, context.clone(), 1, args.len()).await; |
|
|
|
let paramtype_0 = StringType {}; |
|
let paramval_0 = &args[0]; |
|
helpers::assert_type(&co, context.clone(), ¶mtype_0, ¶mval_0).await; |
|
|
|
let result = co |
|
.yield_(FunctionInterruption::Effect { |
|
name: "__io_println".to_string(), |
|
args, |
|
}) |
|
.await; |
|
|
|
let return_type = OneOfType { |
|
lltypes: vec![ |
|
Box::new(ValueType { |
|
llval: Value::Atom(Atom(0)), |
|
}), |
|
Box::new(TupleType { |
|
members_types: vec![ |
|
Box::new(ValueType { |
|
llval: Value::Atom(Atom(1)), |
|
}), |
|
Box::new(AtomType {}), |
|
], |
|
}), |
|
], |
|
}; |
|
helpers::assert_type(&co, context.clone(), &return_type, &result).await; |
|
|
|
result |
|
} |
|
} |
|
} |
|
|
|
#[allow(non_snake_case)] |
|
pub mod symbol_println { |
|
use super::*; |
|
|
|
#[allow(non_camel_case_types)] |
|
#[derive(Debug, Clone, PartialEq)] |
|
pub struct func_println {} |
|
|
|
impl Function for func_println { |
|
fn call(&self, context: Arc<Mutex<TaskContext>>, args: Vec<Value>) -> FunctionContinuation { |
|
async fn code_block( |
|
co: FunctionCoroutine, |
|
context: Arc<Mutex<TaskContext>>, |
|
args: Vec<Value>, |
|
) -> Value { |
|
helpers::assert_param_count(&co, context.clone(), 1, args.len()).await; |
|
|
|
let paramtype_0 = StringType {}; |
|
let paramval_0 = &args[0]; |
|
helpers::assert_type(&co, context.clone(), ¶mtype_0, ¶mval_0).await; |
|
|
|
let return_type = OneOfType { |
|
lltypes: vec![ |
|
Box::new(ValueType { |
|
llval: Value::Atom(Atom(0)), |
|
}), |
|
Box::new(TupleType { |
|
members_types: vec![ |
|
Box::new(ValueType { |
|
llval: Value::Atom(Atom(1)), |
|
}), |
|
Box::new(AtomType {}), |
|
], |
|
}), |
|
], |
|
}; |
|
|
|
let result = async { |
|
let effect = symbol___io_println::effect___io_println {}; |
|
let args: Vec<Value> = vec![paramval_0.clone()]; |
|
|
|
effect.call(context.clone(), &co, args).await |
|
} |
|
.await; |
|
helpers::assert_type(&co, context.clone(), &return_type, &result).await; |
|
|
|
result |
|
} |
|
|
|
FunctionContinuation::new_boxed(|co| code_block(co, context, args)) |
|
} |
|
} |
|
} |