refactor(tvix/eval): rename BindingKind -> Binding
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>
This commit is contained in:
parent
846215ae2b
commit
dd2d45e1cd
1 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue