pub fn parsestring_char(p: *Parser) Error!bool p: *ParserMaxDepth3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508 pub fn parsestring_char(p: *Parser) Error!bool {
const def_index = @backingInt(Def.defstring_char);
if (p.depths[def_index] > max_depth) return error.MaxDepth;
p.depths[def_index] += 1;
defer p.depths[def_index] -= 1;
return blk_0: {
const pos_0 = p.i;
if (blk_1: {
if (std.mem.startsWith(u8, p.source[p.i..], "\\\\")) {
p.i += 2;
break :blk_1 true;
}
break :blk_1 false;
}) break :blk_0 true;
p.i = pos_0;
if (blk_1: {
if (std.mem.startsWith(u8, p.source[p.i..], "\\\"")) {
p.i += 2;
break :blk_1 true;
}
break :blk_1 false;
}) break :blk_0 true;
p.i = pos_0;
if (blk_1: {
const pos_1 = p.i;
const match_1 = (p.i < p.source.len and switch (p.source[p.i]) {
'"'...'"',
=> blk_2: {
p.i += 1;
break :blk_2 true;
},
else => false,
});
p.i = pos_1;
break :blk_1 !match_1;
} and try p.parsenon_control_utf8()) break :blk_0 true;
p.i = pos_0;
break :blk_0 false;
};
}