Skip to content

Commit 090f80d

Browse files
committed
update to zig 0.17.0-dev.702+18b3c78a9
1 parent 39dc8b3 commit 090f80d

5 files changed

Lines changed: 37 additions & 36 deletions

File tree

build.zig

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ fn setupTestStep(
139139

140140
const unit_tests = b.addTest(.{
141141
.root_module = superhtml,
142-
.filters = b.args orelse &.{},
143142
});
144143

145144
const run_unit_tests = b.addRunArtifact(unit_tests);
145+
146146
test_step.dependOn(&run_unit_tests.step);
147147
}
148148

@@ -174,7 +174,7 @@ fn setupCliTool(
174174
super_cli.root_module.addOptions("build_options", options);
175175

176176
const run_exe = b.addRunArtifact(super_cli);
177-
if (b.args) |args| run_exe.addArgs(args);
177+
run_exe.addPassthruArgs();
178178
const run_exe_step = b.step("run", "Run the SuperHTML CLI");
179179
run_exe_step.dependOn(&run_exe.step);
180180

@@ -373,15 +373,16 @@ const Version = union(Kind) {
373373
};
374374
}
375375
};
376+
376377
fn getGitVersion(b: *std.Build) Version {
377-
const git_path = b.findProgram(&.{"git"}, &.{}) catch return .unknown;
378+
const git_path = b.findProgram(.{ .names = &.{"git"} }) orelse return .unknown;
378379
var out: u8 = undefined;
379380
const git_describe = std.mem.trim(
380381
u8,
381382
b.runAllowFail(&[_][]const u8{
382-
git_path, "-C",
383-
b.build_root.path.?, "describe",
384-
"--match", "*.*.*",
383+
git_path, "-C",
384+
b.root.root_dir.path.?, "describe",
385+
"--match", "*.*.*",
385386
"--tags",
386387
}, &out, .ignore) catch return .unknown,
387388
" \n\r",

build.zig.zon

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
.name = .superhtml,
33
.version = "0.6.2",
44
.fingerprint = 0xc5e9aede3c1db363,
5-
.minimum_zig_version = "0.16.0",
5+
.minimum_zig_version = "0.17.0-dev.702+18b3c78a9",
66
.dependencies = .{
77
.known_folders = .{
8-
.url = "git+https://github.com/ziglibs/known-folders#175f5596b3d2ee3c658282bb07885580895a0e73",
9-
.hash = "known_folders-0.0.0-Fy-PJk7KAAC41mQXzmFyGa0Q7tvmQjatENkREa6Gc4zu",
8+
.url = "git+https://github.com/ziglibs/known-folders#207c34a16e4365edc20d92c7892f962b3bed46e8",
9+
.hash = "known_folders-0.0.0-Fy-PJsbKAACbDh9bBxR0MMThxZSS6A9RH4apWphNHY70",
1010
},
1111
.tracy = .{
1212
.url = "git+https://github.com/kristoff-it/tracy#67d2d89e351048c76fc6d161e0ac09d8a831dc60",
1313
.hash = "tracy-0.0.0-4Xw-1pwwAABTfMgoDP1unCbZDZhJEfict7XCBGF6IdIn",
1414
},
1515
.lsp_kit = .{
16-
.url = "git+https://github.com/zigtools/lsp-kit#ec325a3c33d1da7708cf513355208f74d9560580",
17-
.hash = "lsp_kit-0.1.0-bi_PL_kyDACVTEhLaMq2-PJx0MocqRyjXDAN0ybMUyQQ",
16+
.url = "git+https://github.com/zigtools/lsp-kit#dcbb8dd686d85a8f178a4389e730d41dd727b991",
17+
.hash = "lsp_kit-0.1.0-bi_PL2UzDADxFRnnSjhhN7-ZTi9fDMom827yIp_ptc8l",
1818
},
1919
.scripty = .{
20-
.url = "git+https://github.com/kristoff-it/scripty#9c1e5903acd2a591f87f577b2ea08895e7168b9d",
21-
.hash = "scripty-0.1.0-LKK5OzcUAQDVndpJNPAm4eC_-G0HaXUdQejzb9X6C2vq",
20+
.url = "git+https://github.com/kristoff-it/scripty#ad75ad546bc7dd2ece4acd23404e25cd65a4bde9",
21+
.hash = "scripty-0.1.0-LKK5O-sUAQDifuGq_k00NAdEgJjNxXoFTt9js_A7Yx4F",
2222
},
2323
},
2424
.paths = .{

src/cli/logging.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn setup(io: Io, gpa: Allocator, environ: *std.process.Environ.Map) void {
5454
}
5555

5656
fn setupInternal(io: Io, gpa: Allocator, environ: *std.process.Environ.Map) !void {
57-
var cache_base = try folders.open(io, gpa, environ.*, .cache, .{}) orelse return error.Failure;
57+
var cache_base = try folders.open(io, gpa, environ, .cache, .{}) orelse return error.Failure;
5858
errdefer cache_base.close(io);
5959

6060
const log_path = "superhtml.log";

src/html/Element.zig

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ pub inline fn modelRejects(
248248
descendant_element.meta.categories_superset,
249249
);
250250

251-
inline for (std.meta.fields(Categories)) |f| {
252-
if (@field(intersection, f.name) and @hasField(Reasons.Categories, f.name)) {
251+
inline for (comptime std.meta.fieldNames(Categories)) |f_name| {
252+
if (@field(intersection, f_name) and @hasField(Reasons.Categories, f_name)) {
253253
// if this is not a runtime property, report it as the reason
254-
if (!@field(descendant_element.model.categories, f.name)) {
254+
if (!@field(descendant_element.model.categories, f_name)) {
255255
return .{
256-
.reason = @field(descendant_element.reasons.categories, f.name).accept,
256+
.reason = @field(descendant_element.reasons.categories, f_name).accept,
257257
.span = parent_span,
258258
};
259259
}
@@ -299,12 +299,12 @@ pub inline fn modelRejects(
299299
descendant_rt_model.categories,
300300
);
301301

302-
inline for (std.meta.fields(Categories)) |f| {
303-
if (@field(intersection, f.name) and @hasField(Reasons.Categories, f.name)) {
302+
inline for (comptime std.meta.fieldNames(Categories)) |f_name| {
303+
if (@field(intersection, f_name) and @hasField(Reasons.Categories, f_name)) {
304304
// if this is not a runtime property, report it as the reason
305-
if (!@field(descendant_element.model.categories, f.name)) {
305+
if (!@field(descendant_element.model.categories, f_name)) {
306306
return .{
307-
.reason = @field(descendant_element.reasons.categories, f.name).reject,
307+
.reason = @field(descendant_element.reasons.categories, f_name).reject,
308308
.span = parent_span,
309309
};
310310
}
@@ -717,14 +717,14 @@ const KindMap = std.StaticStringMapWithEql(
717717
);
718718

719719
pub const elements: KindMap = blk: {
720-
const fields = std.meta.fields(Ast.Kind)[8..];
721-
assert(std.mem.eql(u8, fields[0].name, "a"));
720+
const field_names = std.meta.fieldNames(Ast.Kind)[8..];
721+
assert(std.mem.eql(u8, field_names[0], "a"));
722722

723723
const KV = struct { []const u8, Ast.Kind };
724724
var keys: []const KV = &.{};
725-
for (fields) |f| keys = keys ++ &[_]KV{.{
726-
f.name,
727-
@enumFromInt(f.value),
725+
for (field_names) |f_name| keys = keys ++ &[_]KV{.{
726+
f_name,
727+
@field(Ast.Kind, f_name),
728728
}};
729729

730730
break :blk .initComptime(keys);
@@ -733,15 +733,15 @@ pub const elements: KindMap = blk: {
733733
pub const all_completions = blk: {
734734
var ac: std.EnumArray(Ast.Kind, Ast.Completion) = undefined;
735735

736-
const fields = std.meta.fields(Ast.Kind)[8..];
737-
assert(std.mem.eql(u8, fields[0].name, "a"));
738-
for (ac.values[8..], fields, all.values[8..]) |*completion, f, elem| {
736+
const field_names = std.meta.fieldNames(Ast.Kind)[8..];
737+
assert(std.mem.eql(u8, field_names[0], "a"));
738+
for (ac.values[8..], field_names, all.values[8..]) |*completion, f_name, elem| {
739739
completion.* = .{
740-
.label = f.name,
741-
.value = if (@field(Ast.Kind, f.name).isVoid())
742-
f.name ++ "$1>"
740+
.label = f_name,
741+
.value = if (@field(Ast.Kind, f_name).isVoid())
742+
f_name ++ "$1>"
743743
else
744-
f.name ++ "$1>$0</" ++ f.name ++ ">",
744+
f_name ++ "$1>$0</" ++ f_name ++ ">",
745745
.desc = elem.desc,
746746
.kind = .element_open,
747747
};

src/template.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,12 +1233,12 @@ pub fn SuperTemplate(comptime ScriptyVM: type) type {
12331233
}
12341234

12351235
pub fn setContext(tpl: Template, script_ctx: RootRef) void {
1236-
script_ctx.loop = if (tpl.loop_stack.getLastOrNull()) |last|
1236+
script_ctx.loop = if (tpl.loop_stack.getLast()) |last|
12371237
last.iterator
12381238
else
12391239
null;
12401240

1241-
script_ctx.@"if" = if (tpl.if_stack.getLastOrNull()) |last|
1241+
script_ctx.@"if" = if (tpl.if_stack.getLast()) |last|
12421242
last.value
12431243
else
12441244
null;

0 commit comments

Comments
 (0)