From e96f94ac88638c0fb2b9575a5b631eebdc70c1d8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 28 Sep 2022 12:51:03 +0300 Subject: refactor(tvix/eval): compile_recursive_scope -> compile_bindings Change-Id: Iff18d0f84ba2b7a4194797e6c52c55b1c37e419c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6794 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/compiler/bindings.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs index 28a9fd1105c5..e5f558edeec5 100644 --- a/tvix/eval/src/compiler/bindings.rs +++ b/tvix/eval/src/compiler/bindings.rs @@ -296,7 +296,7 @@ impl Compiler<'_> { BindingsKind::Attrs }; - let count = self.compile_recursive_scope(slot, kind, &node); + let count = self.compile_bindings(slot, kind, &node); self.push_op(OpCode::OpAttrs(Count(count)), &node); // Remove the temporary scope, but do not emit any additional cleanup @@ -366,7 +366,7 @@ impl Compiler<'_> { } } - fn compile_recursive_scope(&mut self, slot: LocalIdx, kind: BindingsKind, node: &N) -> usize + fn compile_bindings(&mut self, slot: LocalIdx, kind: BindingsKind, node: &N) -> usize where N: ToSpan + ast::HasEntry, { @@ -391,7 +391,7 @@ impl Compiler<'_> { /// Unless in a non-standard scope, the encountered values are simply pushed /// on the stack and their indices noted in the entries vector. pub(super) fn compile_let_in(&mut self, slot: LocalIdx, node: ast::LetIn) { - self.compile_recursive_scope(slot, BindingsKind::LetIn, &node); + self.compile_bindings(slot, BindingsKind::LetIn, &node); // Deal with the body, then clean up the locals afterwards. self.compile(slot, node.body().unwrap()); @@ -401,7 +401,7 @@ impl Compiler<'_> { pub(super) fn compile_legacy_let(&mut self, slot: LocalIdx, node: ast::LegacyLet) { self.emit_warning(&node, WarningKind::DeprecatedLegacyLet); self.scope_mut().begin_scope(); - self.compile_recursive_scope(slot, BindingsKind::RecAttrs, &node); + self.compile_bindings(slot, BindingsKind::RecAttrs, &node); self.push_op(OpCode::OpAttrs(Count(node.entries().count())), &node); self.emit_constant(Value::String(SmolStr::new_inline("body").into()), &node); self.push_op(OpCode::OpAttrsSelect, &node); -- cgit 1.4.1