From 43844188773eff9dca3c0278ad66c8dc2ecfcffe Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 13 Oct 2022 21:07:40 -0700 Subject: docs(tvix/eval): StackIdx, LocalIdx UpvalueIdx This adds a comment noting that StackIdx is an offset relative to the base of the current CallFrame, whereas UpvalueIdx is an absolute index into the upvalues array. It also removes the confusing mention of StackIdx in the descriptive comment for LocalIdx. They index into totally different structures; one exists at runtime and the other exists at compile time. Change-Id: Ib932b1b0679734c15001e8c5c95a08293fa016b4 Signed-off-by: Adam Joseph Reviewed-on: https://cl.tvl.fyi/c/depot/+/7017 Reviewed-by: grfn Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/compiler/scope.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tvix/eval/src/compiler') diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs index 83fba6eed73c..327766bcb501 100644 --- a/tvix/eval/src/compiler/scope.rs +++ b/tvix/eval/src/compiler/scope.rs @@ -121,9 +121,7 @@ pub struct Upvalue { pub span: codemap::Span, } -/// Represents the index of a local in the scope's local array, which -/// is subtly different from its `StackIdx` (which excludes -/// uninitialised values in between). +/// The index of a local in the scope's local array at compile time. #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)] pub struct LocalIdx(usize); -- cgit 1.4.1