From 6c803cdf5ad5bacbf88829a963dd81221fa0d27c Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Fri, 27 Dec 2024 00:54:31 -0500 Subject: [PATCH] take some loop notes --- src/compiler.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/compiler.rs b/src/compiler.rs index 66cdb7e..cf3d745 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -627,6 +627,16 @@ impl Compiler { let (Ast::TuplePattern(members), _) = pattern.as_ref() else { unreachable!() }; + // TODO: finish compiling match clauses + // I just added "match depth" to the VM + // this will set match depth to artiy + // and decrement it each pattern + // the compiler will need to know about match depth for binding to work + // we should match against ALL args first + // rather than jump_no_matching after every arg check + // compile the body + // and then jump_no_match to the next clause + // at the end, panic_no_match } //match against the values on the stack //we know the (fixed) arity, so we should know where to look