Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

parseNUMBERLITERAL

Public Function
std.zig.parser_generated_oracle.Parser.parseNUMBERLITERAL
pub fn parseNUMBERLITERAL(p: *Parser) Error!bool

Params

Errors

MaxDepth

File

zig/parser_generated_oracle.zig:3963
3963
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;
        };
    }