Compare commits

...

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

6 changed files with 34 additions and 20 deletions

19
LICENSE Normal file
View File

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

View File

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

View File

@ -7,11 +7,14 @@ pub fn main() !void {
defer _ = gpa.deinit();
const allocator = gpa.allocator();
const slurp = try std.fs.cwd().readFileAlloc(
const slurp = 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 = "?????" };

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 this
things by defining what they aren't, it is not capable of emitting YAML. If that
changes in the future, then this will have been a poor naming choice.
## Status

View File

@ -1,11 +0,0 @@
- 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}]]]]]]]]]]]