diff options
author | Vincent Ambo <mail@tazj.in> | 2022-09-28T09·51+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-29T11·47+0000 |
commit | e96f94ac88638c0fb2b9575a5b631eebdc70c1d8 (patch) | |
tree | 3046376b4a22b070ba4227cb275850a69a9a7e73 /tvix/eval | |
parent | e31f8f735f72fa1d71f4a030ff778ebe640e9fb1 (diff) |
refactor(tvix/eval): compile_recursive_scope -> compile_bindings r/4992
Change-Id: Iff18d0f84ba2b7a4194797e6c52c55b1c37e419c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6794 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval')
-rw-r--r-- | tvix/eval/src/compiler/bindings.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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<N>(&mut self, slot: LocalIdx, kind: BindingsKind, node: &N) -> usize + fn compile_bindings<N>(&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); |