From c8167011329c34a00c4233b08fd3aa0182befe2b Mon Sep 17 00:00:00 2001 From: Will Medrano Date: Wed, 11 Sep 2024 07:51:24 -0700 Subject: [PATCH] Pin to zig version 0.13.0. --- .github/workflows/test.yml | 14 +++++++------- src/Vm.zig | 2 -- src/datastructures/ErrorCollector.zig | 6 ------ 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b537134..948d260 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v2 - uses: goto-bus-stop/setup-zig@v2 - - run: zig build test - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: goto-bus-stop/setup-zig@v2 - - run: zig fmt --check . + with: + zig-version: 0.13.0 + - name: test + run: zig build test + - name: lint + run: zig fmt --check . + if: always() diff --git a/src/Vm.zig b/src/Vm.zig index 0cbab9f..ec63b32 100644 --- a/src/Vm.zig +++ b/src/Vm.zig @@ -287,7 +287,6 @@ pub fn evalNoReset(self: *Vm, func: Val, args: []const Val) Error!Val { self.env.stack.items = self.env.stack.items[0..stack_start]; return ret; } else { - @setCold(true); return .none; } }, @@ -406,7 +405,6 @@ fn executeDefine(self: *Vm, symbol: Symbol) Error!void { } fn errSymbolNotFound(self: *Vm, sym: Symbol) Error { - @setCold(true); const name = self.env.memory_manager.symbols.getName(sym) orelse "*unknown-symbol*"; try self.env.errors.addError( "Symbol {s} (id={d}) not found in global values", diff --git a/src/datastructures/ErrorCollector.zig b/src/datastructures/ErrorCollector.zig index 4e3c4ad..ae5c207 100644 --- a/src/datastructures/ErrorCollector.zig +++ b/src/datastructures/ErrorCollector.zig @@ -4,25 +4,21 @@ const std = @import("std"); errors: std.ArrayList([]const u8), pub fn init(alloc: std.mem.Allocator) ErrorCollector { - @setCold(true); return .{ .errors = std.ArrayList([]const u8).init(alloc), }; } pub fn deinit(self: *ErrorCollector) void { - @setCold(true); self.clear(); self.errors.deinit(); } pub fn allocator(self: *ErrorCollector) std.mem.Allocator { - @setCold(true); return self.errors.allocator; } pub fn clear(self: *ErrorCollector) void { - @setCold(true); for (self.errors.items) |msg| { self.errors.allocator.free(msg); } @@ -30,13 +26,11 @@ pub fn clear(self: *ErrorCollector) void { } pub fn addError(self: *ErrorCollector, comptime fmt: []const u8, args: anytype) !void { - @setCold(true); const msg = try std.fmt.allocPrint(self.allocator(), fmt, args); try self.errors.append(msg); } pub fn format(self: *const ErrorCollector, comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void { - @setCold(true); for (self.errors.items) |err| { try writer.print("{s}\n", .{err}); }