refactor: no more optional lists in ast nodes
This commit is contained in:
parent
d08e753664
commit
b231e66b49
5 changed files with 84 additions and 104 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue