Skip to content

zig fmt does not handle shebang lines #1546

@tiehuis

Description

@tiehuis

This should be handled at the parser level.

#!/bin/zig

pub fn main() void {
    const a = 5;
}
$ zig2 fmt t.zig 
t.zig:1:1: error: Expected variable declaration or function, found Invalid
#!/bin/zig
~

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions