better name

This commit is contained in:
numzero 2025-04-19 12:47:11 +03:00
parent 3b8de2886e
commit 5077daf8f3

View File

@ -150,7 +150,7 @@ fn build_expression(scope: &BuildContext<'_>, code: &ast::Expression) -> Express
ast::Expression::Constant(c) => Expression::Constant(c.clone()), ast::Expression::Constant(c) => Expression::Constant(c.clone()),
ast::Expression::Variable(loc) => Expression::Variable(lookup(scope, loc)), ast::Expression::Variable(loc) => Expression::Variable(lookup(scope, loc)),
ast::Expression::Call(call) => Expression::Call(build_call(scope, call)), ast::Expression::Call(call) => Expression::Call(build_call(scope, call)),
ast::Expression::Function(f) => Expression::Function(build_in_scope(scope, f)), ast::Expression::Function(f) => Expression::Function(build_function(scope, f)),
} }
} }
@ -170,7 +170,7 @@ fn build_call(scope: &BuildContext<'_>, code: &ast::Call) -> Call {
} }
} }
fn build_in_scope(parent: &BuildContext<'_>, code: &ast::Function) -> Function { fn build_function(parent: &BuildContext<'_>, code: &ast::Function) -> Function {
let scope = BuildContext { let scope = BuildContext {
parent: Some(parent), parent: Some(parent),
scope: Default::default(), scope: Default::default(),
@ -218,5 +218,5 @@ pub fn build(code: &ast::Function) -> Function {
parent: None, parent: None,
scope: RefCell::new(Scope::new_toplevel()), scope: RefCell::new(Scope::new_toplevel()),
}; };
build_in_scope(&mut root, &code) build_function(&mut root, &code)
} }