From cacb1e6e946579dd4f51d575c3d74245922bd3f5 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 26 Jun 2024 16:45:45 +0200 Subject: [PATCH] chore: zig 0.14.0-dev.121+ab4c461b7 --- README.md | 2 +- build.zig | 2 +- src/Token.zig | 2 +- src/ext/clap | 2 +- src/memory.zig | 6 +++--- src/obj.zig | 2 +- src/vm.zig | 1 - 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c2c6eaf0..85314ed5 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ A small/lightweight statically typed scripting language written in Zig ## How to build and install -_Latest zig version supported: 0.13.0-dev.347+30a35a897_ +_Latest zig version supported: 0.14.0-dev.121+ab4c461b7_ ### Requirements - Since this is built with Zig, you should be able to build buzz on a wide variety of architectures even though this has only been tested on x86/M1. diff --git a/build.zig b/build.zig index 9138326f..6a71d8e9 100644 --- a/build.zig +++ b/build.zig @@ -98,7 +98,7 @@ fn getBuzzPrefix(b: *Build) ![]const u8 { pub fn build(b: *Build) !void { // Check minimum zig version const current_zig = builtin.zig_version; - const min_zig = std.SemanticVersion.parse("0.13.0-dev.347+30a35a897") catch return; + const min_zig = std.SemanticVersion.parse("0.14.0-dev.121+ab4c461b7") catch return; if (current_zig.order(min_zig).compare(.lt)) { @panic(b.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig })); } diff --git a/src/Token.zig b/src/Token.zig index c80a32da..1bf93cfc 100644 --- a/src/Token.zig +++ b/src/Token.zig @@ -57,7 +57,7 @@ pub fn getLines(self: Self, allocator: mem.Allocator, before: usize, after: usiz const before_index = if (self.line > 0) self.line - @min(before, self.line) else self.line; const after_index = if (self.line > 0) self.line + after else self.line; - var it = std.mem.split(u8, self.source, "\n"); + var it = std.mem.splitScalar(u8, self.source, '\n'); var current: usize = 0; while (it.next()) |line| : (current += 1) { if (current >= before_index and current <= after_index) { diff --git a/src/ext/clap b/src/ext/clap index 60cd46aa..c0193e92 160000 --- a/src/ext/clap +++ b/src/ext/clap @@ -1 +1 @@ -Subproject commit 60cd46aacff4960104703da9ba683077b1e3c76c +Subproject commit c0193e9247335a6c1688b946325060289405de2a diff --git a/src/memory.zig b/src/memory.zig index 103cf376..598baa09 100644 --- a/src/memory.zig +++ b/src/memory.zig @@ -186,7 +186,7 @@ pub const GarbageCollector = struct { next_gc: usize = if (builtin.mode == .Debug) 1024 else 1024 * BuildOptions.initial_gc, next_full_gc: usize = if (builtin.mode == .Debug) 1024 else 1024 * BuildOptions.initial_gc, last_gc: ?Mode = null, - objects: std.TailQueue(*Obj) = .{}, + objects: std.DoublyLinkedList(*Obj) = .{}, gray_stack: std.ArrayList(*Obj), active_vms: std.AutoHashMap(*VM, void), // Obj being collected, useful to avoid setting object instance dirty while running its collector method @@ -403,7 +403,7 @@ pub const GarbageCollector = struct { } fn addObject(self: *Self, obj: *Obj) !void { - const new_node = try self.allocator.create(std.TailQueue(*Obj).Node); + const new_node = try self.allocator.create(std.DoublyLinkedList(*Obj).Node); new_node.* = .{ .data = obj, }; @@ -937,7 +937,7 @@ pub const GarbageCollector = struct { const swept: usize = self.bytes_allocated; var obj_count: usize = 0; - var obj_node: ?*std.TailQueue(*Obj).Node = self.objects.first; + var obj_node: ?*std.DoublyLinkedList(*Obj).Node = self.objects.first; var count: usize = 0; while (obj_node) |node| : (count += 1) { if (node.data.is_marked) { diff --git a/src/obj.zig b/src/obj.zig index 0a26f8ea..7e44ef68 100644 --- a/src/obj.zig +++ b/src/obj.zig @@ -60,7 +60,7 @@ pub const Obj = struct { is_marked: bool = false, // True when old obj and was modified is_dirty: bool = false, - node: ?*std.TailQueue(*Obj).Node = null, + node: ?*std.DoublyLinkedList(*Obj).Node = null, pub inline fn cast(obj: *Obj, comptime T: type, obj_type: ObjType) ?*T { if (obj.obj_type != obj_type) { diff --git a/src/vm.zig b/src/vm.zig index 8c4fbd62..6183c5a9 100644 --- a/src/vm.zig +++ b/src/vm.zig @@ -1459,7 +1459,6 @@ pub const VM = struct { switch (err) { Error.RuntimeError => return, else => { - std.debug.print("{}\n", .{err}); self.panic("Out of memory"); unreachable; },