From d42d8f3089c524cfa9e2fc332a81af5c0686db8d Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 18 Sep 2022 16:07:43 -0400 Subject: [PATCH] docs(tvix/eval): Document OpAttrs Document the OpAttrs op, paying special attention to the (perhaps confusing) behavior of taking the number of *pairs*, not the number of *values*, which will be popped off the stack into the resulting attr set. Change-Id: I64df0290308ecae7a5c7e14ead37091d32701507 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6654 Autosubmit: grfn Tested-by: BuildkiteCI Reviewed-by: sterni Reviewed-by: tazjin --- tvix/eval/src/opcode.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs index 458ea6dd3..9ddd19532 100644 --- a/tvix/eval/src/opcode.rs +++ b/tvix/eval/src/opcode.rs @@ -86,6 +86,10 @@ pub enum OpCode { OpJumpIfNotFound(JumpOffset), // Attribute sets + /// Construct an attribute set from the given number of key-value pairs on the top of the stack + /// + /// Note that this takes the count of *pairs*, not the number of *stack values* - the actual + /// number of values popped off the stack will be twice the argument to this op OpAttrs(Count), OpAttrPath(Count), OpAttrsUpdate,