authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-05 20:39:56 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-06-05 20:39:56 -07:00
log0a970854c1f5c8c11b6ab3ec50328ab8ec137fe5
tree2d84c46decf62420f2cacdf0b1a04836bb0a3f9f
parent6680b93989318cf36c98eadbb1e86452bfc6bb11

inline ansi red foreground code and remove `libs/zig-ansi` submodule


6 files changed, 6 insertions(+), 15 deletions(-)

.gitmodules-3
...@@ -1,6 +1,3 @@...@@ -1,6 +1,3 @@
1[submodule "libs/yaml"]1[submodule "libs/yaml"]
2 path = libs/yaml2 path = libs/yaml
3 url = https://github.com/yaml/libyaml3 url = https://github.com/yaml/libyaml
4[submodule "libs/zig-ansi"]
5 path = libs/zig-ansi
6 url = https://github.com/nektro/zig-ansi
build.zig-1
...@@ -41,7 +41,6 @@ pub fn build(b: *Builder) void {...@@ -41,7 +41,6 @@ pub fn build(b: *Builder) void {
41 exe.addCSourceFile("./libs/yaml/src/writer.c", &.{});41 exe.addCSourceFile("./libs/yaml/src/writer.c", &.{});
4242
43 exe.addPackagePath("zigmod", "./src/lib.zig");43 exe.addPackagePath("zigmod", "./src/lib.zig");
44 exe.addPackagePath("ansi", "./libs/zig-ansi/src/lib.zig");
45 } else {44 } else {
46 deps.addAllTo(exe);45 deps.addAllTo(exe);
47 }46 }
deps.zig-2
...@@ -71,12 +71,10 @@ pub const package_data = struct {...@@ -71,12 +71,10 @@ pub const package_data = struct {
7171
72pub const packages = &[_]std.build.Pkg{72pub const packages = &[_]std.build.Pkg{
73 package_data._89ujp8gq842x,73 package_data._89ujp8gq842x,
74 package_data._s84v9o48ucb0,
75};74};
7675
77pub const pkgs = struct {76pub const pkgs = struct {
78 pub const zigmod = packages[0];77 pub const zigmod = packages[0];
79 pub const ansi = packages[1];
80};78};
8179
82pub const c_include_dirs = &[_][]const u8{80pub const c_include_dirs = &[_][]const u8{
libs/zig-ansi deleted-1
...@@ -1 +0,0 @@
1Subproject commit 876c32c42044a5e1554f4662b4b9bdfad7ee5086
src/util/funcs.zig+4-3
...@@ -1,8 +1,6 @@...@@ -1,8 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const gpa = std.heap.c_allocator;2const gpa = std.heap.c_allocator;
33
4const ansi = @import("ansi");
5
6const u = @import("index.zig");4const u = @import("index.zig");
75
8//6//
...@@ -17,9 +15,12 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {...@@ -17,9 +15,12 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {
17 std.debug.print(fmt ++ "\n", args);15 std.debug.print(fmt ++ "\n", args);
18}16}
1917
18const ansi_red = "\x1B[31m";
19const ansi_reset = "\x1B[39m";
20
20pub fn assert(ok: bool, comptime fmt: []const u8, args: anytype) void {21pub fn assert(ok: bool, comptime fmt: []const u8, args: anytype) void {
21 if (!ok) {22 if (!ok) {
22 print(comptime ansi.color.Fg(.Red, "error: " ++ fmt), args);23 print(ansi_red ++ fmt ++ ansi_reset, args);
23 std.os.exit(1);24 std.os.exit(1);
24 }25 }
25}26}
zig.mod+2-5
...@@ -25,12 +25,12 @@ dependencies:...@@ -25,12 +25,12 @@ dependencies:
25 - src/scanner.c25 - src/scanner.c
26 - src/writer.c26 - src/writer.c
2727
28 - src: git https://github.com/nektro/zig-ansi
29
30 # Entries above this line are needed to bootstrap and kept as git submodules28 # Entries above this line are needed to bootstrap and kept as git submodules
31 # --------29 # --------
32 # Entries below this line are only fetched with zigmod itself 30 # Entries below this line are only fetched with zigmod itself
3331
32 - src: git https://github.com/nektro/zig-ansi
33
34 - src: git https://github.com/ziglibs/known-folders34 - src: git https://github.com/ziglibs/known-folders
3535
36 - src: git https://github.com/nektro/zig-licenses36 - src: git https://github.com/nektro/zig-licenses
...@@ -40,6 +40,3 @@ dependencies:...@@ -40,6 +40,3 @@ dependencies:
40 - src: git https://github.com/nektro/zig-json40 - src: git https://github.com/nektro/zig-json
4141
42 - src: http https://aquila.red/1/nektro/range/v0.1.tar.gz sha256-d2f72fdd8cdb8 0 142 - src: http https://aquila.red/1/nektro/range/v0.1.tar.gz sha256-d2f72fdd8cdb8 0 1
43
44dev_dependencies:
45 - src: git https://github.com/nektro/zig-ansi