fn parseSwitchProngList(p: *Parse) !Node.SubRange p: *Parse3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185fn parseSwitchProngList(p: *Parse) !Node.SubRange {
const scratch_top = p.scratch.items.len;
defer p.scratch.shrinkRetainingCapacity(scratch_top);
while (true) {
const item = try parseSwitchProng(p) orelse break;
try p.scratch.append(p.gpa, item);
switch (p.tokenTag(p.tok_i)) {
.comma => p.tok_i += 1,
// All possible delimiters.
.colon, .r_paren, .r_brace, .r_bracket => break,
// Likely just a missing comma; give error but continue parsing.
else => try p.warn(.expected_comma_after_switch_prong),
}
}
return p.listToSpan(p.scratch.items[scratch_top..]);
}