Skip to content

Commit

Permalink
Merge pull request #12 from priddis/fix-build-errors
Browse files Browse the repository at this point in the history
Fix build errors when building with latest zig version
  • Loading branch information
Techatrix authored Feb 16, 2024
2 parents 956d76d + a98c572 commit fe870dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn build(b: *std.build.Builder) void {
const test_step = b.step("test", "Run all the tests");
test_step.dependOn(b.getInstallStep());

var tests = b.addTest(.{
const tests = b.addTest(.{
.root_source_file = .{ .path = "tests/tests.zig" },
.target = target,
});
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = "lspmm-zig",
.version = "0.1.0",

.paths = .{"build.zig", "build.zig.zon", "src"},
.dependencies = .{},
}
4 changes: 2 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn isOrActuallyEnum(ort: MetaModel.OrType) bool {

fn isTypeNull(typ: MetaModel.Type) bool {
if (typ != .@"or") return false;
var ort = typ.@"or";
const ort = typ.@"or";
return (ort.items.len == 2 and ort.items[1] == .base and ort.items[1].base.name == .null) or (ort.items[ort.items.len - 1] == .base and ort.items[ort.items.len - 1].base.name == .null);
}

Expand Down Expand Up @@ -163,7 +163,7 @@ fn writeType(meta_model: MetaModel, writer: anytype, typ: MetaModel.Type) @TypeO
}
try writer.writeByte('}');
} else {
var has_null = ort.items[ort.items.len - 1] == .base and ort.items[ort.items.len - 1].base.name == .null;
const has_null = ort.items[ort.items.len - 1] == .base and ort.items[ort.items.len - 1].base.name == .null;

if (has_null) try writer.writeByte('?');

Expand Down

0 comments on commit fe870dc

Please sign in to comment.