refactor: no more optional lists in ast nodes

This commit is contained in:
Brett Broadhurst 2026-03-29 16:34:54 -06:00
parent d08e753664
commit b231e66b49
Failed to generate hash of commit
5 changed files with 84 additions and 104 deletions

View file

@ -268,11 +268,11 @@ fn makeNodeSequence(
loc: Ast.Node.Span,
scratch_offset: usize,
) Error!*Ast.Node {
var list: ?[]*Ast.Node = null;
if (!p.isScratchEmpty(context)) {
list = try p.nodeListFromScratch(scratch_offset, p.scratch.items.len);
const list = try p.nodeListFromScratch(scratch_offset, p.scratch.items.len);
return .createList(p.arena, tag, loc, list);
}
return .createList(p.arena, tag, loc, list);
return .createList(p.arena, tag, loc, &.{});
}
fn isBlockStackEmpty(p: *Parse, context: *const StmtContext) bool {