pub fn parseNUMBERLITERAL(p: *Parser) Error!bool p: *ParserMaxDepth3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019 pub fn parseNUMBERLITERAL(p: *Parser) Error!bool {
const def_index = @backingInt(Def.defNUMBERLITERAL);
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 (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
'0'...'9',
=> blk_1: {
p.i += 1;
break :blk_1 true;
},
else => false,
}) and blk_1: {
var i_1: usize = 0;
while (try p.parsedigit_int()) {
if (i_1 > max_depth) return error.MaxDepth;
i_1 += 1;
}
break :blk_1 true;
} and blk_1: {
if (std.mem.startsWith(u8, p.source[p.i..], ".")) {
p.i += 1;
break :blk_1 true;
}
break :blk_1 false;
} and blk_1: {
var match_1 = false;
var i_1: usize = 0;
while (try p.parsedigit_float()) {
match_1 = true;
if (i_1 > max_depth) return error.MaxDepth;
i_1 += 1;
}
break :blk_1 match_1;
}) break :blk_0 true;
p.i = pos_0;
if (try p.parseskip() and (p.i < p.source.len and switch (p.source[p.i]) {
'0'...'9',
=> blk_1: {
p.i += 1;
break :blk_1 true;
},
else => false,
}) and blk_1: {
var i_1: usize = 0;
while (try p.parsedigit_float()) {
if (i_1 > max_depth) return error.MaxDepth;
i_1 += 1;
}
break :blk_1 true;
}) break :blk_0 true;
p.i = pos_0;
break :blk_0 false;
};
}