calls!
This commit is contained in:
parent
4033495353
commit
eb51dd2702
|
|
@ -149,7 +149,20 @@ fn build_in_scope(parent: &BuildContext<'_>, code: &ast::Function) -> Function {
|
||||||
source: Box::new(build_expression(&scope, source)),
|
source: Box::new(build_expression(&scope, source)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
ast::Statement::Call { callee, args } => todo!(),
|
ast::Statement::Call { callee, args } => {
|
||||||
|
body.push(Statement::Call(Call {
|
||||||
|
callee: Box::new(build_expression(
|
||||||
|
&scope,
|
||||||
|
&ast::Expression::Variable(ast::Location::Variable {
|
||||||
|
name: callee.clone(),
|
||||||
|
}),
|
||||||
|
)),
|
||||||
|
args: args
|
||||||
|
.iter()
|
||||||
|
.map(|arg| build_expression(&scope, arg))
|
||||||
|
.collect(),
|
||||||
|
}));
|
||||||
|
}
|
||||||
ast::Statement::Local { name, init } => {
|
ast::Statement::Local { name, init } => {
|
||||||
let init = init.as_ref().map(|init| build_expression(&scope, &init));
|
let init = init.as_ref().map(|init| build_expression(&scope, &init));
|
||||||
let id = scope.scope.borrow_mut().add_local(&name);
|
let id = scope.scope.borrow_mut().add_local(&name);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user