Compare commits

...

No commits in common. "cf21c48771fd3e186f41d64d04c43d109a4a64d8" and "0e49d3f6aac90aa7380db59ccefc0e07c6287d1e" have entirely different histories.

6 changed files with 20 additions and 34 deletions

19
LICENSE
View File

@ -1,19 +0,0 @@
Copyright (c) 2024 torque@epicyclic.dev
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -20,17 +20,14 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});
const example_step = b.step("example", "build example");
const ex_exe = b.addExecutable(.{
const exe = b.addExecutable(.{
.name = "yamltest",
.root_source_file = .{ .path = "example/main.zig" },
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
ex_exe.linkLibrary(libyaml);
ex_exe.addModule("yaml", yaml_zig);
exe.linkLibrary(libyaml);
exe.addModule("yaml", yaml_zig);
const install = b.addInstallArtifact(ex_exe, .{});
example_step.dependOn(&install.step);
b.installArtifact(exe);
}

View File

@ -1,5 +1,5 @@
.{
.name = "zaye",
.name = "libyaml.zig",
.version = "0.0.1",
.paths = .{
"src",

View File

@ -1,7 +1,7 @@
# ZAYE Ain't a Yaml Emitter
zaye is a very simple libyaml-based YAML parser for zig. In the spirit of describing
things by defining what they aren't, it is not capable of emitting YAML. If that
things by defining what they aren't, it is not capable of emitting YAML. If this
changes in the future, then this will have been a poor naming choice.
## Status

View File

@ -7,14 +7,11 @@ pub fn main() !void {
defer _ = gpa.deinit();
const allocator = gpa.allocator();
const slurp = std.fs.cwd().readFileAlloc(
const slurp = try std.fs.cwd().readFileAlloc(
allocator,
"test.yaml",
1024 * 1024 * 1024,
) catch |err| {
std.debug.print("couldn't open test.yaml in the cwd\n", .{});
return err;
};
);
defer allocator.free(slurp);
var diag = yaml.ParseDiagnostic{ .message = "?????" };

11
test.yaml Normal file
View File

@ -0,0 +1,11 @@
- one
- "two"
- "three\nfour\""
- 2024-01-01 00:00:00Z
- "*notanchor"
-
2024-01-01 00:00:00Z: ok
another key:
value
"": null
- [1, [2, 3, [4, [5, 6, 7,[[[[[[[{1: 2}]]]]]]]]]]]