Use comptime for fully declarative LV2 and Custom commands #14

Merged
luna merged 69 commits from declarative-commands into master 2020-06-02 21:37:47 +00:00
2 changed files with 11 additions and 2 deletions
Showing only changes of commit d518369314 - Show all commits

View File

@ -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 {

View File

@ -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.*);
}
}
};