Updated to zig 16
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
.zig-cache
|
||||
zig-out
|
||||
zig-pkg
|
||||
|
||||
+15
-1
@@ -1,7 +1,7 @@
|
||||
# The No Vibe Coders Open Source License
|
||||
|
||||
```
|
||||
Copyright (C) 2025 William Welna (wwelna@occultusterra.com)
|
||||
Copyright (C) 2026 William Welna (wwelna@occultusterra.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -20,6 +20,20 @@ In addition, the following restrictions apply:
|
||||
that used an Artificial Intelligence (AI) model and/or Large Language Model
|
||||
(LLM) to generate any portion of that other software's source code, binaries,
|
||||
or artwork.
|
||||
* The usage of this software is not authorized in the state of California nor are
|
||||
residents of California authorized to be in possession of this software, either
|
||||
in source or compiled binary form.
|
||||
* The usage of this software is not authorized in the state of Colorado nor are
|
||||
residents of Colorado authorized to be in possession of this software, either
|
||||
in source or compiled binary form.
|
||||
* The usage and/or possession of this software, in either source or compiled
|
||||
binary form, is not authorized in any legal jurisdiction where there is a
|
||||
requirement of any age verification mechanism and/or identity verification
|
||||
mechanism as a requirement to use this software under threat of criminal
|
||||
and/or civil penalties.
|
||||
* If the unauthorized usage of this software results in financial penalties
|
||||
towards the developer, William Welna, the responsible individual, corporation,
|
||||
or other legal entity agrees to fully cover said financial penalties.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
|
||||
@@ -61,10 +61,10 @@ Unless it is a valid instruction, it treats it as a NOOP. It has complete compat
|
||||
|X|POP Two Byte Values from the Stack, XOR the Byte Values together, and PUSH result back onto the Stack|
|
||||
|I|POP Byte from the Stack, Invert Bits, and PUSH result back onto the Stack|
|
||||
|
||||
## The No Vibe Coders Open Source License
|
||||
# The No Vibe Coders Open Source License
|
||||
|
||||
```
|
||||
Copyright (C) 2025 William Welna (wwelna@occultusterra.com)
|
||||
Copyright (C) 2026 William Welna (wwelna@occultusterra.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -83,6 +83,20 @@ In addition, the following restrictions apply:
|
||||
that used an Artificial Intelligence (AI) model and/or Large Language Model
|
||||
(LLM) to generate any portion of that other software's source code, binaries,
|
||||
or artwork.
|
||||
* The usage of this software is not authorized in the state of California nor are
|
||||
residents of California authorized to be in possession of this software, either
|
||||
in source or compiled binary form.
|
||||
* The usage of this software is not authorized in the state of Colorado nor are
|
||||
residents of Colorado authorized to be in possession of this software, either
|
||||
in source or compiled binary form.
|
||||
* The usage and/or possession of this software, in either source or compiled
|
||||
binary form, is not authorized in any legal jurisdiction where there is a
|
||||
requirement of any age verification mechanism and/or identity verification
|
||||
mechanism as a requirement to use this software under threat of criminal
|
||||
and/or civil penalties.
|
||||
* If the unauthorized usage of this software results in financial penalties
|
||||
towards the developer, William Welna, the responsible individual, corporation,
|
||||
or other legal entity agrees to fully cover said financial penalties.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
@@ -91,4 +105,4 @@ 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.
|
||||
```
|
||||
```
|
||||
|
||||
@@ -18,12 +18,12 @@ pub fn build(b: *std.Build) void {
|
||||
.imports = &.{
|
||||
.{ .name = "inferius", .module = mod },
|
||||
},
|
||||
//.link_libc = true,
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
const clap = b.dependency("clap", .{});
|
||||
exe.root_module.addImport("clap", clap.module("clap"));
|
||||
exe.linkLibC();
|
||||
|
||||
b.installArtifact(exe);
|
||||
|
||||
|
||||
+3
-3
@@ -2,11 +2,11 @@
|
||||
.name = .inferius,
|
||||
.version = "0.0.1",
|
||||
.fingerprint = 0xe30472b6da223d0e,
|
||||
.minimum_zig_version = "0.15.2",
|
||||
.minimum_zig_version = "0.16.0",
|
||||
.dependencies = .{
|
||||
.clap = .{
|
||||
.url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.11.0.tar.gz",
|
||||
.hash = "clap-0.11.0-oBajB-HnAQDPCKYzwF7rO3qDFwRcD39Q0DALlTSz5H7e",
|
||||
.url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.12.0.tar.gz",
|
||||
.hash = "clap-0.12.0-oBajB7foAQDqlSwaSG5g0yq7xGbQARUsBk5T64gAOqP5",
|
||||
},
|
||||
},
|
||||
.paths = .{
|
||||
|
||||
+18
-4
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2025 William Welna (wwelna@occultusterra.com)
|
||||
// Copyright (C) 2026 William Welna (wwelna@occultusterra.com)
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -17,6 +17,20 @@
|
||||
// that used an Artificial Intelligence (AI) model and/or Large Language Model
|
||||
// (LLM) to generate any portion of that other software's source code, binaries,
|
||||
// or artwork.
|
||||
// * The usage of this software is not authorized in the state of California nor are
|
||||
// residents of California authorized to be in possession of this software, either
|
||||
// in source or compiled binary form.
|
||||
// * The usage of this software is not authorized in the state of Colorado nor are
|
||||
// residents of Colorado authorized to be in possession of this software, either
|
||||
// in source or compiled binary form.
|
||||
// * The usage and/or possession of this software, in either source or compiled
|
||||
// binary form, is not authorized in any legal jurisdiction where there is a
|
||||
// requirement of any age verification mechanism and/or identity verification
|
||||
// mechanism as a requirement to use this software under threat of criminal
|
||||
// and/or civil penalties.
|
||||
// * If the unauthorized usage of this software results in financial penalties
|
||||
// towards the developer, William Welna, the responsible individual, corporation,
|
||||
// or other legal entity agrees to fully cover said financial penalties.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
@@ -50,10 +64,10 @@ pub const inferiusInterpretor = struct {
|
||||
output: std.ArrayList(u8),
|
||||
stack: std.ArrayList(u8),
|
||||
allocator: std.mem.Allocator,
|
||||
stdout: ?*std.io.Writer,
|
||||
stdin: ?*std.io.Reader,
|
||||
stdout: ?*std.Io.Writer,
|
||||
stdin: ?*std.Io.Reader,
|
||||
|
||||
pub fn init(allocator: std.mem.Allocator, size: usize, program: []const u8, stdin: ?*std.io.Reader, stdout: ?*std.io.Writer) !inferiusInterpretor {
|
||||
pub fn init(allocator: std.mem.Allocator, size: usize, program: []const u8, stdin: ?*std.Io.Reader, stdout: ?*std.Io.Writer) !inferiusInterpretor {
|
||||
const mem = try allocator.alloc(u8, size);
|
||||
@memset(mem, 0);
|
||||
return .{
|
||||
|
||||
+34
-20
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2025 William Welna (wwelna@occultusterra.com)
|
||||
// Copyright (C) 2026 William Welna (wwelna@occultusterra.com)
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -17,6 +17,20 @@
|
||||
// that used an Artificial Intelligence (AI) model and/or Large Language Model
|
||||
// (LLM) to generate any portion of that other software's source code, binaries,
|
||||
// or artwork.
|
||||
// * The usage of this software is not authorized in the state of California nor are
|
||||
// residents of California authorized to be in possession of this software, either
|
||||
// in source or compiled binary form.
|
||||
// * The usage of this software is not authorized in the state of Colorado nor are
|
||||
// residents of Colorado authorized to be in possession of this software, either
|
||||
// in source or compiled binary form.
|
||||
// * The usage and/or possession of this software, in either source or compiled
|
||||
// binary form, is not authorized in any legal jurisdiction where there is a
|
||||
// requirement of any age verification mechanism and/or identity verification
|
||||
// mechanism as a requirement to use this software under threat of criminal
|
||||
// and/or civil penalties.
|
||||
// * If the unauthorized usage of this software results in financial penalties
|
||||
// towards the developer, William Welna, the responsible individual, corporation,
|
||||
// or other legal entity agrees to fully cover said financial penalties.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
@@ -32,46 +46,44 @@ const std = @import("std");
|
||||
const clap = @import("clap");
|
||||
const inferius = @import("inferius");
|
||||
|
||||
pub fn halp(mauh: *std.io.Writer) !void {
|
||||
pub fn halp(mauh: *std.Io.Writer) !void {
|
||||
try mauh.print("Quod est superius est sicut quod inferius, et quod inferius est sicut quod est superius.\n", .{});
|
||||
try mauh.flush();
|
||||
}
|
||||
|
||||
pub fn version(mauh: *std.io.Writer) !void {
|
||||
pub fn version(mauh: *std.Io.Writer) !void {
|
||||
try mauh.print("inferius {s}\n", .{VERSION_STRING});
|
||||
try mauh.flush();
|
||||
}
|
||||
|
||||
pub fn main() !void {
|
||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
const allocator = gpa.allocator();
|
||||
pub fn main(init: std.process.Init) !void {
|
||||
const allocator = init.gpa;
|
||||
|
||||
var stdout_buffer: [128]u8 = undefined;
|
||||
var stdin_buffer: [128]u8 = undefined;
|
||||
|
||||
var stdout_writer_wrapper = std.fs.File.stdout().writer(&stdout_buffer);
|
||||
const stdout: *std.io.Writer = &stdout_writer_wrapper.interface;
|
||||
var stdout_file_writer: std.Io.File.Writer = .init(.stdout(), init.io, &stdout_buffer);
|
||||
var stdout = &stdout_file_writer.interface;
|
||||
|
||||
var stdin_reader_wrapper = std.fs.File.stdin().reader(&stdin_buffer);
|
||||
const stdin: *std.io.Reader = &stdin_reader_wrapper.interface;
|
||||
var stdin_reader = std.Io.File.stdin().reader(init.io, &stdin_buffer);
|
||||
const stdin: *std.Io.Reader = &stdin_reader.interface;
|
||||
|
||||
var memory: usize = 30000;
|
||||
|
||||
const params = comptime clap.parseParamsComptime(
|
||||
\\-h, --help Display this help and exit.
|
||||
\\-v, --version Display Version
|
||||
\\-m, --memory <usize> Size of scratch buffer, default to 30,000 bytes
|
||||
\\<str>...
|
||||
\\
|
||||
\\-h, --help Display this help and exit.
|
||||
\\-v, --version Display Version
|
||||
\\-m, --memory <usize> Size of scratch buffer, default to 30,000 bytes
|
||||
\\<str>... Filename
|
||||
);
|
||||
|
||||
var diag = clap.Diagnostic{};
|
||||
var res = clap.parse(clap.Help, ¶ms, clap.parsers.default, .{
|
||||
var res = clap.parse(clap.Help, ¶ms, clap.parsers.default, init.minimal.args, .{
|
||||
.diagnostic = &diag,
|
||||
.allocator = allocator,
|
||||
}) catch |err| {
|
||||
try diag.reportToFile(.stderr(), err);
|
||||
return;
|
||||
}) catch {
|
||||
try version(stdout);
|
||||
return clap.helpToFile(init.io, .stderr(), clap.Help, ¶ms, .{});
|
||||
};
|
||||
defer res.deinit();
|
||||
|
||||
@@ -85,7 +97,7 @@ pub fn main() !void {
|
||||
}
|
||||
if (res.args.memory) |m| memory = m;
|
||||
if (res.positionals[0].len > 0 and res.positionals[0].len < 3) {
|
||||
const d = std.fs.cwd().readFileAlloc(allocator, res.positionals[0][0], 1024 ^ 2) catch |err| {
|
||||
const d = std.Io.Dir.cwd().readFileAlloc(init.io, res.positionals[0][0], allocator, .unlimited) catch |err| {
|
||||
std.debug.print("Can't open '{s}': {s}\n", .{ res.positionals[0][0], @errorName(err) });
|
||||
return;
|
||||
};
|
||||
@@ -101,4 +113,6 @@ pub fn main() !void {
|
||||
try stdout.flush();
|
||||
return;
|
||||
}
|
||||
try version(stdout);
|
||||
try clap.helpToFile(init.io, .stderr(), clap.Help, ¶ms, .{});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user