about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/bindings.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-09-28 r/4978 refactor(tvix/eval): split `compile_inherits` into twoVincent Ambo1-12/+29
Splits the large `compile_inherits` function which previously *compiled* plain inherits and *declared* namespaced inherits into `compile_plain_inherits` and `declare_namespaced_inherits`. This is supposed to make more sense than before, but is still not consistently used (notably, non-recursive attribute sets still duplicate most of this logic). Another salami slice. Change-Id: Id97fac1cbd5ee97b24d047e7728655e6b7734153 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6773 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-28 r/4977 refactor(tvix/eval): add non-recursive logic to `compile_inherit`Vincent Ambo1-16/+39
... but do not use it yet. This refactoring is pretty complicated, so I'm applying salami-slicing tactics here. Change-Id: I66e04ee10548f68bf67dc842f3f14cc279426c22 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6772 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-28 r/4976 refactor(tvix/eval): introduce type to track kind of bindingsVincent Ambo1-11/+30
As part of the unification of binding logic between different carriers of bindings, we need to track which kind of bindings we are dealing with (attribute set? recursive scope? ...) to correctly emit keys and declare identifiers in the locals stack. Right now this changes no functionality as `BindingsKind::Attrs` is not yet used (only RecAttrs and LetIn, which was previously represented by the `rec_attrs` boolean). Change-Id: Id2ac27894079ab584521cb568d75c124f7bf2403 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6771 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-28 r/4975 refactor(tvix/eval): move recursive inherit logic into helperVincent Ambo1-98/+108
This helper will gain the ability to compile both kinds of inherits, but it is kind of tricky to get right so I am doing it in smaller steps. Right now there is no change in functionality. Change-Id: Ie990b88dd90a5e0f9fd79961ee09a6c83f2c872d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6770 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-28 r/4974 refactor(tvix/eval): rename BindingKind -> BindingVincent Ambo1-7/+7
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>
2022-09-28 r/4973 refactor(tvix/eval): generalise error variant for dynamic keysVincent Ambo1-26/+12
Change-Id: I08f40b4b53652a519e76d6e8344c7c3fe10a0689 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6767 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-28 r/4972 refactor(tvix/eval): bye compiler::attrs, hello compiler::bindingsVincent Ambo1-0/+689
Changes the module structure of the compiler to have a module dedicated to the logic of setting up bindings. This logic is in the process of being merged between attribute sets and `let`-expressions, and the structure of the modules makes more sense when ecapsulating that specifically. (Other bits of code related to e.g. attribute sets are pretty straightforward and can just live in the main compiler module). Change-Id: I9469b73a7034e5b5f3bb211694d97260c4c9ef54 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6766 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>