Skip to content

Commit b8f076d

Browse files
committed
Update to Zig version 0.16.0-dev.627+e6e4792a5
1 parent 8c6716d commit b8f076d

30 files changed

+127
-131
lines changed

.github/workflows/all-debug-compile-only.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Zig
2020
uses: mlugg/setup-zig@v2
2121
with:
22-
version: 0.15.0-dev.1149+4e6a04929
22+
version: 0.16.0-dev.627+e6e4792a5
2323

2424
- name: Enable all debug flags
2525
run: scripts/enable-all-debug-flags.sh

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Zig
1919
uses: mlugg/setup-zig@v2
2020
with:
21-
version: 0.15.0-dev.1149+4e6a04929
21+
version: 0.16.0-dev.627+e6e4792a5
2222

2323
- name: Run tests
2424
run: zig build test --summary all

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You need the Zig compiler, preferably one built with the known-good version
3939
commit. You can find the source code, instructions for building, and more on the
4040
[Zig repository](https://github.com/ziglang/zig).
4141

42-
Latest Zig version known to work is [0.15.0-dev.1149+4e6a04929](https://github.com/ziglang/zig/commit/4e6a04929).
42+
Latest Zig version known to work is [0.16.0-dev.627+e6e4792a5](https://github.com/ziglang/zig/commit/e6e4792a5).
4343
Earlier and later versions may work but there are no guarantees.
4444

4545
## Building zigSelf

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
.dependencies = .{
1313
.@"zig-args" = .{
14-
.url = "https://github.com/ikskuh/zig-args/archive/4c305bcb45fd3c4b74b7bf7f907cf3fc12f415a2.tar.gz",
15-
.hash = "args-0.0.0-CiLiquDRAADuU_ueSmGquhHAuhDxxlfBokGj01ZdVYHt",
14+
.url = "https://github.com/ikskuh/zig-args/archive/8ae26b44a884ff20dca98ee84c098e8f8e94902f.tar.gz",
15+
.hash = "args-0.0.0-CiLiqojRAACGzDRO7A9dw7kWSchNk29caJZkXuMCb0Cn",
1616
},
1717
.tracy = .{
1818
.url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.1.tar.gz",

src/language/ASTPrinter.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const Allocator = std.mem.Allocator;
88
const AST = @import("./ast.zig");
99

1010
indent_width: usize,
11+
allocator: Allocator,
1112
branches: std.ArrayList(Branch),
1213
current_indent: usize = 0,
1314
is_stem: bool = false,
@@ -27,12 +28,13 @@ const Branch = struct { indent: usize, concluded: bool };
2728
pub fn init(indent_width: usize, allocator: Allocator) ASTPrinter {
2829
return .{
2930
.indent_width = indent_width,
30-
.branches = std.ArrayList(Branch).init(allocator),
31+
.allocator = allocator,
32+
.branches = .empty,
3133
};
3234
}
3335

3436
pub fn deinit(self: *ASTPrinter) void {
35-
self.branches.deinit();
37+
self.branches.deinit(self.allocator);
3638
}
3739

3840
const StemIsLast = enum { Last, NotLast };
@@ -44,7 +46,7 @@ fn setStem(self: *ASTPrinter, is_last: StemIsLast) void {
4446
}
4547

4648
fn indent(self: *ASTPrinter) void {
47-
self.branches.append(.{ .indent = self.current_indent, .concluded = false }) catch unreachable;
49+
self.branches.append(self.allocator, .{ .indent = self.current_indent, .concluded = false }) catch unreachable;
4850
self.current_indent += self.indent_width;
4951
}
5052

src/language/Diagnostics.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ const DiagnosticList = std.ArrayList(Diagnostic);
3737
pub fn init(allocator: Allocator) !Diagnostics {
3838
return Diagnostics{
3939
.allocator = allocator,
40-
.diagnostics = DiagnosticList.init(allocator),
40+
.diagnostics = .empty,
4141
};
4242
}
4343

4444
pub fn deinit(self: *Diagnostics) void {
4545
for (self.diagnostics.items) |*diagnostic| {
4646
diagnostic.deinit(self.allocator);
4747
}
48-
self.diagnostics.deinit();
48+
self.diagnostics.deinit(self.allocator);
4949
}
5050

5151
pub fn reportDiagnostic(self: *Diagnostics, comptime level: DiagnosticLevel, location: Location, comptime message: []const u8) !void {
52-
try self.diagnostics.append(Diagnostic{ .level = level, .location = location, .message = message, .message_is_allocated = false });
52+
try self.diagnostics.append(self.allocator, .{ .level = level, .location = location, .message = message, .message_is_allocated = false });
5353
}
5454

5555
pub fn reportDiagnosticFormatted(self: *Diagnostics, comptime level: DiagnosticLevel, location: Location, comptime message: []const u8, args: anytype) !void {
5656
const formatted_message = try std.fmt.allocPrint(self.allocator, message, args);
57-
try self.diagnostics.append(Diagnostic{ .level = level, .location = location, .message = formatted_message, .message_is_allocated = true });
57+
try self.diagnostics.append(self.allocator, .{ .level = level, .location = location, .message = formatted_message, .message_is_allocated = true });
5858
}

src/language/Location.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ line_start: usize,
1414
/// Points to the newline.
1515
line_end: usize,
1616

17-
pub fn format(self: Location, writer: *std.io.Writer) !void {
17+
pub fn format(self: Location, writer: *std.Io.Writer) !void {
1818
try writer.printInt(self.line, 10, .lower, .{});
1919
try writer.writeByte(':');
2020
try writer.printInt(self.column, 10, .lower, .{});

src/language/LocationRange.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const LocationRange = @This();
1313
start: Location,
1414
end: Location,
1515

16-
pub fn format(range: LocationRange, writer: *std.io.Writer) !void {
16+
pub fn format(range: LocationRange, writer: *std.Io.Writer) !void {
1717
try range.start.format(writer);
1818
try writer.writeByte('-');
1919

0 commit comments

Comments
 (0)