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 <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-13 17:34:20 +03:00 committed by tazjin
parent bbad338017
commit 691a596aac
3 changed files with 98 additions and 0 deletions

View file

@ -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
}