Compare commits
No commits in common. "0e49d3f6aac90aa7380db59ccefc0e07c6287d1e" and "cf21c48771fd3e186f41d64d04c43d109a4a64d8" have entirely different histories.
0e49d3f6aa
...
cf21c48771
19
LICENSE
Normal file
19
LICENSE
Normal 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.
|
13
build.zig
13
build.zig
@ -20,14 +20,17 @@ pub fn build(b: *std.Build) void {
|
|||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
const example_step = b.step("example", "build example");
|
||||||
|
|
||||||
|
const ex_exe = b.addExecutable(.{
|
||||||
.name = "yamltest",
|
.name = "yamltest",
|
||||||
.root_source_file = .{ .path = "src/main.zig" },
|
.root_source_file = .{ .path = "example/main.zig" },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
});
|
});
|
||||||
exe.linkLibrary(libyaml);
|
ex_exe.linkLibrary(libyaml);
|
||||||
exe.addModule("yaml", yaml_zig);
|
ex_exe.addModule("yaml", yaml_zig);
|
||||||
|
|
||||||
b.installArtifact(exe);
|
const install = b.addInstallArtifact(ex_exe, .{});
|
||||||
|
example_step.dependOn(&install.step);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.{
|
.{
|
||||||
.name = "libyaml.zig",
|
.name = "zaye",
|
||||||
.version = "0.0.1",
|
.version = "0.0.1",
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"src",
|
"src",
|
||||||
|
@ -7,11 +7,14 @@ pub fn main() !void {
|
|||||||
defer _ = gpa.deinit();
|
defer _ = gpa.deinit();
|
||||||
const allocator = gpa.allocator();
|
const allocator = gpa.allocator();
|
||||||
|
|
||||||
const slurp = try std.fs.cwd().readFileAlloc(
|
const slurp = std.fs.cwd().readFileAlloc(
|
||||||
allocator,
|
allocator,
|
||||||
"test.yaml",
|
"test.yaml",
|
||||||
1024 * 1024 * 1024,
|
1024 * 1024 * 1024,
|
||||||
);
|
) catch |err| {
|
||||||
|
std.debug.print("couldn't open test.yaml in the cwd\n", .{});
|
||||||
|
return err;
|
||||||
|
};
|
||||||
defer allocator.free(slurp);
|
defer allocator.free(slurp);
|
||||||
|
|
||||||
var diag = yaml.ParseDiagnostic{ .message = "?????" };
|
var diag = yaml.ParseDiagnostic{ .message = "?????" };
|
@ -1,7 +1,7 @@
|
|||||||
# ZAYE Ain't a Yaml Emitter
|
# ZAYE Ain't a Yaml Emitter
|
||||||
|
|
||||||
zaye is a very simple libyaml-based YAML parser for zig. In the spirit of describing
|
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.
|
changes in the future, then this will have been a poor naming choice.
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user