Compare commits

...

2 Commits

Author SHA1 Message Date
a9f2298132
fix useless var
Unlike lists, this isn't mutated for maps because there's no
intermediate builder object being used for maps (lists are assembled
with an ArrayList, after which they are converted to plain slices).
2024-05-12 18:49:22 -07:00
2b643c5221
build: update for zig-0.12.0 2024-05-12 18:45:27 -07:00
3 changed files with 5 additions and 7 deletions

View File

@ -9,10 +9,8 @@ pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const yaml_zig = b.addModule("zaye", .{
.source_file = .{ .path = "src/zaye.zig" },
.root_source_file = .{ .path = "src/zaye.zig" },
});
// yaml_zig.addIncludePath(.{ .path = b.getInstallPath(.header, "") });
// _ = yaml_zig;
const libyaml = libyaml_build.libyamlLib(b, .{
.name = "libyaml",
@ -29,7 +27,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});
ex_exe.linkLibrary(libyaml);
ex_exe.addModule("yaml", yaml_zig);
ex_exe.root_module.addImport("yaml", yaml_zig);
const install = b.addInstallArtifact(ex_exe, .{});
example_step.dependOn(&install.step);

View File

@ -5,7 +5,7 @@ const std = @import("std");
const LibyamlOptions = struct {
name: []const u8,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
};
@ -23,7 +23,7 @@ pub fn libyamlLib(
lib.linkLibC();
lib.addIncludePath(.{ .path = include_prefix });
lib.addCSourceFiles(&sources, &cflags);
lib.addCSourceFiles(.{ .files = &sources, .flags = &cflags });
lib.defineCMacro("YAML_VERSION_MAJOR", "0");
lib.defineCMacro("YAML_VERSION_MINOR", "2");
lib.defineCMacro("YAML_VERSION_PATCH", "5");

View File

@ -266,7 +266,7 @@ pub const Value = union(enum) {
}
fn endMap(self: *Builder, diag: *ParseDiagnostic) !void {
var top = self.container_stack.pop();
const top = self.container_stack.pop();
if (top != .map) {
diag.setMessage("map ended when a map was not the top container");