add random debug statements

This commit is contained in:
Luna 2020-05-30 23:57:34 -03:00
parent 7d519b73b6
commit d518369314
2 changed files with 11 additions and 2 deletions

View file

@ -124,7 +124,7 @@ pub const NewCommand = struct {
} }
pub fn print(base: *const @This()) void { pub fn print(base: *const @This()) void {
std.debug.warn("{}\n", .{base.tag}); std.debug.warn("tag: {}\n", .{base.tag});
} }
pub const Noop = struct { pub const Noop = struct {

View file

@ -381,6 +381,7 @@ pub const Runner = struct {
) !void { ) !void {
comptime const typ = lang.NewCommand.tagToType(tag); comptime const typ = lang.NewCommand.tagToType(tag);
const command = cmd.cast(typ).?; const command = cmd.cast(typ).?;
std.debug.warn("{} {}\n", .{ command.path.ptr, command.path.len });
std.debug.warn("{}\n", .{command}); std.debug.warn("{}\n", .{command});
} }
@ -795,7 +796,15 @@ pub const Runner = struct {
) !void { ) !void {
for (cmds.items) |cmd| { for (cmds.items) |cmd| {
cmd.print(); 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.*);
} }
} }
}; };