feat: code generation for conditional and switch statements

This commit is contained in:
Brett Broadhurst 2026-03-03 16:22:35 -07:00
parent 889f678dd8
commit d6ff3a40bd
Failed to generate hash of commit
7 changed files with 476 additions and 59 deletions

View file

@ -245,9 +245,7 @@ fn popScratch(p: *Parse, context: *const StmtContext) *Ast.Node {
@panic("BUG: Scratch buffer popped when empty!");
}
fn nodeListFromScratch(p: *Parse, start_offset: usize, end_offset: usize) Error!?[]*Ast.Node {
if (start_offset >= end_offset) return null;
fn nodeListFromScratch(p: *Parse, start_offset: usize, end_offset: usize) Error![]*Ast.Node {
const span = end_offset - start_offset;
assert(span > 0);