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

parsenewline

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

Params

Errors

MaxDepth

File

zig/parser_generated_oracle.zig:3672
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
    pub fn parsenewline(p: *Parser) Error!bool {
        const def_index = @backingInt(Def.defnewline);
        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: {
                const pos_1 = p.i;
                const match_1 = blk_3: {
                    const pos_3 = p.i;
                    if (blk_4: {
                        if (std.mem.startsWith(u8, p.source[p.i..], "\n")) {
                            p.i += 1;
                            break :blk_4 true;
                        }
                        break :blk_4 false;
                    }) break :blk_3 true;
                    p.i = pos_3;
                    if (blk_4: {
                        if (std.mem.startsWith(u8, p.source[p.i..], "\r\n")) {
                            p.i += 2;
                            break :blk_4 true;
                        }
                        break :blk_4 false;
                    }) break :blk_3 true;
                    p.i = pos_3;
                    if (try p.parseeof()) break :blk_3 true;
                    p.i = pos_3;
                    break :blk_3 false;
                };
                p.i = pos_1;
                break :blk_1 match_1;
            }) break :blk_0 true;
            p.i = pos_0;
            break :blk_0 false;
        };
    }