diff --git a/src/lang.zig b/src/lang.zig index 07d3d50..77ec179 100644 --- a/src/lang.zig +++ b/src/lang.zig @@ -124,7 +124,7 @@ pub const NewCommand = struct { } pub fn print(base: *const @This()) void { - std.debug.warn("{}\n", .{base.tag}); + std.debug.warn("tag: {}\n", .{base.tag}); } pub const Noop = struct { diff --git a/src/runner.zig b/src/runner.zig index 024fa42..a27c945 100644 --- a/src/runner.zig +++ b/src/runner.zig @@ -381,6 +381,7 @@ pub const Runner = struct { ) !void { comptime const typ = lang.NewCommand.tagToType(tag); const command = cmd.cast(typ).?; + std.debug.warn("{} {}\n", .{ command.path.ptr, command.path.len }); std.debug.warn("{}\n", .{command}); } @@ -795,7 +796,15 @@ pub const Runner = struct { ) !void { for (cmds.items) |cmd| { cmd.print(); - try self.newRunCommand(cmd); + + switch (cmd.tag) { + .load => { + const proper_cmd = cmd.cast(lang.NewCommand.Load).?; + std.debug.warn("got load! {}\n", .{proper_cmd}); + }, + else => @panic("TODO"), + } + try self.newRunCommand(cmd.*); } } };