about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-23T14·12+0300
committertazjin <tazjin@tvl.su>2022-09-28T00·00+0000
commitdd2d45e1cd3fb9fa5d1ec10495bc170a80721feb (patch)
tree03c89dd92ac9a9a0f6e76730ce4ff20818727ab8 /tvix
parent846215ae2b924dc1de5cf8f3873402b3334917c3 (diff)
refactor(tvix/eval): rename BindingKind -> Binding r/4974
This just describes a binding, and we do need a good name for the kind
of binding*s*, which is going to be introduced soon.

Change-Id: I53900ee52da8a07dae8b918fa6a4cb308e627efb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6768
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/compiler/bindings.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs
index 3dd8514c0281..6322a1d5247b 100644
--- a/tvix/eval/src/compiler/bindings.rs
+++ b/tvix/eval/src/compiler/bindings.rs
@@ -9,7 +9,7 @@ use super::*;
 // Data structures to track the bindings observed in the
 // second pass, and forward the information needed to compile
 // their value.
-enum BindingKind {
+enum Binding {
     InheritFrom {
         namespace: ast::Expr,
         name: SmolStr,
@@ -29,7 +29,7 @@ struct KeySlot {
 struct TrackedBinding {
     key_slot: Option<KeySlot>,
     value_slot: LocalIdx,
-    kind: BindingKind,
+    binding: Binding,
 }
 
 /// AST-traversing functions related to bindings.
@@ -370,7 +370,7 @@ impl Compiler<'_> {
             bindings.push(TrackedBinding {
                 key_slot,
                 value_slot,
-                kind: BindingKind::InheritFrom {
+                binding: Binding::InheritFrom {
                     namespace: from,
                     name: SmolStr::new(&name),
                     span,
@@ -413,7 +413,7 @@ impl Compiler<'_> {
             bindings.push(TrackedBinding {
                 key_slot,
                 value_slot,
-                kind: BindingKind::Plain {
+                binding: Binding::Plain {
                     expr: entry.value().unwrap(),
                 },
             });
@@ -430,10 +430,10 @@ impl Compiler<'_> {
                 self.scope_mut().mark_initialised(key_slot.slot);
             }
 
-            match binding.kind {
+            match binding.binding {
                 // This entry is an inherit (from) expr. The value is
                 // placed on the stack by selecting an attribute.
-                BindingKind::InheritFrom {
+                Binding::InheritFrom {
                     namespace,
                     name,
                     span,
@@ -451,7 +451,7 @@ impl Compiler<'_> {
 
                 // Binding is "just" a plain expression that needs to
                 // be compiled.
-                BindingKind::Plain { expr } => self.compile(binding.value_slot, expr),
+                Binding::Plain { expr } => self.compile(binding.value_slot, expr),
             }
 
             // Any code after this point will observe the value in the