feat: cheaper runtime value type, float and int arithmetic rules

This commit is contained in:
Brett Broadhurst 2026-03-29 02:24:02 -06:00
parent 9b5cd4038f
commit 92e8bcd866
Failed to generate hash of commit
13 changed files with 630 additions and 448 deletions

View file

@ -1,5 +1,6 @@
const std = @import("std");
const ink = @import("ink");
const Story = ink.Story;
const fatal = std.process.fatal;
var stdin_buffer: [4096]u8 align(std.heap.page_size_min) = undefined;
@ -88,7 +89,7 @@ fn mainArgs(
const stderr = std.fs.File.stderr();
var stderr_writer = stderr.writer(&stderr_buffer);
var story = ink.Story.loadFromString(gpa, source_bytes, .{
var story = Story.loadFromString(gpa, source_bytes, .{
.error_writer = &stderr_writer.interface,
.dump_writer = &stdout_writer.interface,
.use_color = use_color,
@ -107,7 +108,7 @@ fn mainArgs(
return if (!compile_only) run(gpa, &story);
}
fn run(gpa: std.mem.Allocator, story: *ink.Story) !void {
fn run(gpa: std.mem.Allocator, story: *Story) !void {
const stdin = std.fs.File.stdin();
var stdin_reader = stdin.reader(&stdin_buffer);