From 86a00a97e5d72d21c8632006c73483c4187b6d98 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Fri, 21 Jun 2024 17:31:51 +0200 Subject: [PATCH] chore: port to Zig 0.13.0 --- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 2 +- .gitignore | 2 +- README.md | 2 +- build.zig | 4 ++-- src/format.zig | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3797e1d..86b7cbb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 with: - version: 0.12.0 + version: 0.13.0 - name: Build run: zig build docs - name: Upload diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d954916..4bb880a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,6 @@ jobs: submodules: true - uses: goto-bus-stop/setup-zig@v2 with: - version: 0.12.0 + version: 0.13.0 - name: Build run: zig build test diff --git a/.gitignore b/.gitignore index fed2599..9353df3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -zig-cache/ +.zig-cache/ zig-out/ deps.zig gyro.lock diff --git a/README.md b/README.md index bfb70fb..81ea267 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This was originally code which was extracted from [lscolors](https://github.com/ziglibs/lscolors) for use in other zig libraries. More features have been added since. -`ansi-term` is designed to work with Zig 0.12.0. +`ansi-term` is designed to work with Zig 0.13.0. ## Documentation diff --git a/build.zig b/build.zig index cb05e69..9c0172e 100644 --- a/build.zig +++ b/build.zig @@ -5,11 +5,11 @@ pub fn build(b: *Build) void { const optimize = b.standardOptimizeOption(.{}); _ = b.addModule("ansi-term", .{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), }); var main_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); diff --git a/src/format.zig b/src/format.zig index e11e032..779452d 100644 --- a/src/format.zig +++ b/src/format.zig @@ -12,7 +12,7 @@ const csi = esc ++ "["; const reset = csi ++ "0m"; -const font_style_codes = std.ComptimeStringMap([]const u8, .{ +const font_style_codes = std.StaticStringMap([]const u8).initComptime(.{ .{ "bold", "1" }, .{ "dim", "2" }, .{ "italic", "3" },