| ... | ... | @@ -52,7 +52,7 @@ pub fn wasi_cwd() fs.Dir { |
| 52 | 52 | return .{ .fd = cwd_fd }; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | pub fn getWasiPreopen(name: []const u8) Compilation.Directory { |
| 55 | fn getWasiPreopen(name: []const u8) Compilation.Directory { |
| 56 | 56 | return .{ |
| 57 | 57 | .path = name, |
| 58 | 58 | .handle = .{ |
| ... | ... | @@ -68,11 +68,11 @@ pub fn fatal(comptime format: []const u8, args: anytype) noreturn { |
| 68 | 68 | |
| 69 | 69 | /// There are many assumptions in the entire codebase that Zig source files can |
| 70 | 70 | /// be byte-indexed with a u32 integer. |
| 71 | | pub const max_src_size = std.math.maxInt(u32); |
| 71 | const max_src_size = std.math.maxInt(u32); |
| 72 | 72 | |
| 73 | | pub const debug_extensions_enabled = builtin.mode == .Debug; |
| 73 | const debug_extensions_enabled = builtin.mode == .Debug; |
| 74 | 74 | |
| 75 | | pub const Color = enum { |
| 75 | const Color = enum { |
| 76 | 76 | auto, |
| 77 | 77 | off, |
| 78 | 78 | on, |
| ... | ... | @@ -234,7 +234,7 @@ fn verifyLibcxxCorrectlyLinked() void { |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | | pub fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 237 | fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 238 | 238 | if (args.len <= 1) { |
| 239 | 239 | std.log.info("{s}", .{usage}); |
| 240 | 240 | fatal("expected command argument", .{}); |
| ... | ... | @@ -778,7 +778,7 @@ const CliModule = struct { |
| 778 | 778 | rc_source_files_start: usize, |
| 779 | 779 | rc_source_files_end: usize, |
| 780 | 780 | |
| 781 | | pub const Dep = struct { |
| 781 | const Dep = struct { |
| 782 | 782 | key: []const u8, |
| 783 | 783 | value: []const u8, |
| 784 | 784 | }; |
| ... | ... | @@ -4933,7 +4933,7 @@ fn detectRcIncludeDirs(arena: Allocator, zig_lib_dir: []const u8, auto_includes: |
| 4933 | 4933 | } |
| 4934 | 4934 | } |
| 4935 | 4935 | |
| 4936 | | pub const usage_libc = |
| 4936 | const usage_libc = |
| 4937 | 4937 | \\Usage: zig libc |
| 4938 | 4938 | \\ |
| 4939 | 4939 | \\ Detect the native libc installation and print the resulting |
| ... | ... | @@ -4952,7 +4952,7 @@ pub const usage_libc = |
| 4952 | 4952 | \\ |
| 4953 | 4953 | ; |
| 4954 | 4954 | |
| 4955 | | pub fn cmdLibC(gpa: Allocator, args: []const []const u8) !void { |
| 4955 | fn cmdLibC(gpa: Allocator, args: []const []const u8) !void { |
| 4956 | 4956 | var input_file: ?[]const u8 = null; |
| 4957 | 4957 | var target_arch_os_abi: []const u8 = "native"; |
| 4958 | 4958 | var print_includes: bool = false; |
| ... | ... | @@ -5063,7 +5063,7 @@ pub fn cmdLibC(gpa: Allocator, args: []const []const u8) !void { |
| 5063 | 5063 | } |
| 5064 | 5064 | } |
| 5065 | 5065 | |
| 5066 | | pub const usage_init = |
| 5066 | const usage_init = |
| 5067 | 5067 | \\Usage: zig init |
| 5068 | 5068 | \\ |
| 5069 | 5069 | \\ Initializes a `zig build` project in the current working |
| ... | ... | @@ -5075,7 +5075,7 @@ pub const usage_init = |
| 5075 | 5075 | \\ |
| 5076 | 5076 | ; |
| 5077 | 5077 | |
| 5078 | | pub fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 5078 | fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 5079 | 5079 | { |
| 5080 | 5080 | var i: usize = 0; |
| 5081 | 5081 | while (i < args.len) : (i += 1) { |
| ... | ... | @@ -5126,7 +5126,7 @@ pub fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void |
| 5126 | 5126 | return cleanExit(); |
| 5127 | 5127 | } |
| 5128 | 5128 | |
| 5129 | | pub const usage_build = |
| 5129 | const usage_build = |
| 5130 | 5130 | \\Usage: zig build [steps] [options] |
| 5131 | 5131 | \\ |
| 5132 | 5132 | \\ Build a project from build.zig. |
| ... | ... | @@ -5150,7 +5150,7 @@ pub const usage_build = |
| 5150 | 5150 | \\ |
| 5151 | 5151 | ; |
| 5152 | 5152 | |
| 5153 | | pub fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 5153 | fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 5154 | 5154 | var progress: std.Progress = .{ .dont_print_on_dumb = true }; |
| 5155 | 5155 | |
| 5156 | 5156 | var build_file: ?[]const u8 = null; |
| ... | ... | @@ -5772,7 +5772,7 @@ fn readSourceFileToEndAlloc( |
| 5772 | 5772 | return source_code; |
| 5773 | 5773 | } |
| 5774 | 5774 | |
| 5775 | | pub const usage_fmt = |
| 5775 | const usage_fmt = |
| 5776 | 5776 | \\Usage: zig fmt [file]... |
| 5777 | 5777 | \\ |
| 5778 | 5778 | \\ Formats the input files and modifies them in-place. |
| ... | ... | @@ -5803,7 +5803,7 @@ const Fmt = struct { |
| 5803 | 5803 | const SeenMap = std.AutoHashMap(fs.File.INode, void); |
| 5804 | 5804 | }; |
| 5805 | 5805 | |
| 5806 | | pub fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 5806 | fn cmdFmt(gpa: Allocator, arena: Allocator, args: []const []const u8) !void { |
| 5807 | 5807 | var color: Color = .auto; |
| 5808 | 5808 | var stdin_flag: bool = false; |
| 5809 | 5809 | var check_flag: bool = false; |
| ... | ... | @@ -6190,7 +6190,7 @@ pub fn putAstErrorsIntoBundle( |
| 6190 | 6190 | try Compilation.addZirErrorMessages(wip_errors, &file); |
| 6191 | 6191 | } |
| 6192 | 6192 | |
| 6193 | | pub const info_zen = |
| 6193 | const info_zen = |
| 6194 | 6194 | \\ |
| 6195 | 6195 | \\ * Communicate intent precisely. |
| 6196 | 6196 | \\ * Edge cases matter. |
| ... | ... | @@ -6655,7 +6655,7 @@ const usage_ast_check = |
| 6655 | 6655 | \\ |
| 6656 | 6656 | ; |
| 6657 | 6657 | |
| 6658 | | pub fn cmdAstCheck( |
| 6658 | fn cmdAstCheck( |
| 6659 | 6659 | gpa: Allocator, |
| 6660 | 6660 | arena: Allocator, |
| 6661 | 6661 | args: []const []const u8, |
| ... | ... | @@ -6816,7 +6816,7 @@ pub fn cmdAstCheck( |
| 6816 | 6816 | } |
| 6817 | 6817 | |
| 6818 | 6818 | /// This is only enabled for debug builds. |
| 6819 | | pub fn cmdDumpZir( |
| 6819 | fn cmdDumpZir( |
| 6820 | 6820 | gpa: Allocator, |
| 6821 | 6821 | arena: Allocator, |
| 6822 | 6822 | args: []const []const u8, |
| ... | ... | @@ -6876,7 +6876,7 @@ pub fn cmdDumpZir( |
| 6876 | 6876 | } |
| 6877 | 6877 | |
| 6878 | 6878 | /// This is only enabled for debug builds. |
| 6879 | | pub fn cmdChangelist( |
| 6879 | fn cmdChangelist( |
| 6880 | 6880 | gpa: Allocator, |
| 6881 | 6881 | arena: Allocator, |
| 6882 | 6882 | args: []const []const u8, |
| ... | ... | @@ -7377,7 +7377,7 @@ fn parseRcIncludes(arg: []const u8) Compilation.RcIncludes { |
| 7377 | 7377 | fatal("unsupported rc includes type: '{s}'", .{arg}); |
| 7378 | 7378 | } |
| 7379 | 7379 | |
| 7380 | | pub const usage_fetch = |
| 7380 | const usage_fetch = |
| 7381 | 7381 | \\Usage: zig fetch [options] <url> |
| 7382 | 7382 | \\Usage: zig fetch [options] <path> |
| 7383 | 7383 | \\ |