forked from kubkon/zig-yaml
-
Notifications
You must be signed in to change notification settings - Fork 2
chore: upgrade to Zig 0.16.0 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
067e44b
chore: upgrade to Zig 0.16.0-dev (master)
lodekeeper-z 2b9ed48
fix: treat quoted strings as strings
wemeetagain 8c1cacb
chore: add regression test
wemeetagain 6c8ce59
fix: handle typed yaml values when parsing as string pointers
lodekeeper-z efb5898
fix: remove extra requirement for doc end marker
wemeetagain a4f0db1
fix!: avoid parsing in load
wemeetagain 47c6e8d
feat: add support for flow map
wemeetagain 37bcbed
feat: allow []u8 as yaml list
wemeetagain 80ee714
fix: double-quoted string escape handling in tokenizer
lodekeeper-z 1f30a96
feat: support all YAML 1.2 double-quoted escape sequences
lodekeeper-z 846b477
fix: use heap-allocated empty slice for list_empty
lodekeeper-z 84dfc91
fix: handle null/empty YAML values in optional typed parsing
lodekeeper-z 8bf8674
feat: support YAML 1.2 special float values (.inf, .nan)
lodekeeper-z 3f378f3
fix: stringify null as "null" and special floats as .inf/.nan
lodekeeper-z b45ca87
feat: migrate spec tests to Zig 0.16 std.Io API and re-enable in build
lodekeeper-z 83cd03a
test: add 74 comprehensive unit tests
lodekeeper-z a7ff26c
style: use trailing slash for directory entries in .gitignore
GrapeBaBa 1204e77
fix: migrate StringArrayHashMap to unmanaged in spec tests
GrapeBaBa 4c3adda
fix: address Copilot review comments
GrapeBaBa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| .gyro | ||
| .zigmod | ||
| .gyro/ | ||
| .zigmod/ | ||
| deps.zig | ||
| zig-cache | ||
| .zig-cache | ||
| zig-out | ||
| zig-cache/ | ||
| .zig-cache/ | ||
| zig-out/ | ||
| zig-pkg/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,64 +1,65 @@ | ||
| const std = @import("std"); | ||
| const SpecTest = @import("test/spec.zig"); | ||
|
|
||
| pub fn build(b: *std.Build) void { | ||
| const target = b.standardTargetOptions(.{}); | ||
| const optimize = b.standardOptimizeOption(.{}); | ||
|
|
||
| const enable_logging = b.option(bool, "log", "Whether to enable logging") orelse false; | ||
| const yaml_module = b.addModule("yaml", .{ | ||
| .root_source_file = b.path("src/lib.zig"), | ||
| }); | ||
|
|
||
| const yaml_tests = b.addTest(.{ | ||
| .root_source_file = b.path("src/lib.zig"), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
|
|
||
| const example = b.addExecutable(.{ | ||
| .name = "yaml", | ||
| .root_source_file = b.path("examples/yaml.zig"), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| .root_module = b.createModule(.{ | ||
| .root_source_file = b.path("src/lib.zig"), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }), | ||
| }); | ||
| example.root_module.addImport("yaml", yaml_module); | ||
|
|
||
| const example_opts = b.addOptions(); | ||
| example.root_module.addOptions("build_options", example_opts); | ||
| example_opts.addOption(bool, "enable_logging", enable_logging); | ||
|
|
||
| b.installArtifact(example); | ||
|
|
||
| const run_cmd = b.addRunArtifact(example); | ||
| run_cmd.step.dependOn(b.getInstallStep()); | ||
| if (b.args) |args| { | ||
| run_cmd.addArgs(args); | ||
| } | ||
|
|
||
| const run_step = b.step("run", "Run example program parser"); | ||
| run_step.dependOn(&run_cmd.step); | ||
|
|
||
| const test_step = b.step("test", "Run library tests"); | ||
| test_step.dependOn(&b.addRunArtifact(yaml_tests).step); | ||
|
|
||
| var e2e_tests = b.addTest(.{ | ||
| const e2e_test_module = b.createModule(.{ | ||
| .root_source_file = b.path("test/test.zig"), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
| e2e_tests.root_module.addImport("yaml", yaml_module); | ||
| e2e_test_module.addImport("yaml", yaml_module); | ||
|
|
||
| const e2e_tests = b.addTest(.{ | ||
| .root_module = e2e_test_module, | ||
| }); | ||
| test_step.dependOn(&b.addRunArtifact(e2e_tests).step); | ||
|
|
||
| // Comprehensive unit tests | ||
| const comprehensive_test_module = b.createModule(.{ | ||
| .root_source_file = b.path("test/comprehensive_test.zig"), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
| comprehensive_test_module.addImport("yaml", yaml_module); | ||
|
|
||
| const comprehensive_tests = b.addTest(.{ | ||
| .root_module = comprehensive_test_module, | ||
| }); | ||
| test_step.dependOn(&b.addRunArtifact(comprehensive_tests).step); | ||
|
|
||
| // YAML Test Suite spec tests | ||
| const enable_spec_tests = b.option(bool, "enable-spec-tests", "Enable YAML Test Suite") orelse false; | ||
| if (enable_spec_tests) { | ||
| const gen = SpecTest.create(b); | ||
| var spec_tests = b.addTest(.{ | ||
| .root_source_file = gen.path(), | ||
| const SpecTest = @import("test/spec.zig"); | ||
| const spec_test = SpecTest.create(b); | ||
|
|
||
| const spec_test_module = b.createModule(.{ | ||
| .root_source_file = spec_test.path(), | ||
| .target = target, | ||
| .optimize = optimize, | ||
| }); | ||
| spec_tests.root_module.addImport("yaml", yaml_module); | ||
| spec_test_module.addImport("yaml", yaml_module); | ||
|
|
||
| const spec_tests = b.addTest(.{ | ||
| .root_module = spec_test_module, | ||
| }); | ||
| test_step.dependOn(&b.addRunArtifact(spec_tests).step); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.