From 691a596aac0381d7794c6969cb9793131aa998f3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 13 Aug 2022 17:34:20 +0300 Subject: feat(tvix/eval): compile simple `let ... in ...` expressions These expressions now leave the binding values on the stack, and clean up the scope after the body of the expression. While variable access is not yet implemented (as the identifier node remains unhandled), this already gives us the correct stack behaviour. Change-Id: I138c20ace9c64502c94b2c0f99a6077cd912c00d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6188 Tested-by: BuildkiteCI Reviewed-by: grfn --- tvix/eval/src/opcode.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tvix/eval/src/opcode.rs') diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs index 4cf4f695b0..ebd91dd439 100644 --- a/tvix/eval/src/opcode.rs +++ b/tvix/eval/src/opcode.rs @@ -61,4 +61,7 @@ pub enum OpCode { // Type assertion operators OpAssertBool, + + // Close scopes while leaving their expression value around. + OpCloseScope(usize), // number of locals to pop } -- cgit 1.4.1