Compare commits

..

No commits in common. "b00ab8e839967612cbc813e144398db9ae0bff94" and "b0525f23862d98900799be4d0c1c031eb3a5ff9b" have entirely different histories.

2 changed files with 53 additions and 2 deletions

View file

@ -3,7 +3,11 @@ const std = @import("std");
const plugin = @import("plugin.zig");
const custom = @import("custom.zig");
pub const ParseError = error{ParseFail};
pub const ParseError = error{
OutOfMemory,
ArgRequired,
ParseFail,
};
pub const CommandType = enum {
/// "LV2 Commands" are commands that receive split, index, and then receive
@ -477,6 +481,9 @@ pub const Command = struct {
};
pub const CommandList = std.ArrayList(*Command);
pub const ArgList = std.ArrayList([]const u8);
pub const KeywordMap = std.StringHashMap(CommandType);
/// A parser.
pub const Lang = struct {
@ -646,6 +653,8 @@ pub const Lang = struct {
self.doError("Unknown command '{}' ({})", .{ command_string, command_string.len });
continue;
}
// try cmds.append(cmd);
}
if (self.has_error) return ParseError.ParseFail;

View file

@ -2,7 +2,49 @@ const langs = @import("lang.zig");
pub fn printList(list: langs.CommandList, stream: var) !void {
for (list.items) |cmd| {
const command = @tagName(cmd.tag);
var command = switch (cmd.command) {
.Noop => "noop",
.Load => "load",
.Quicksave => "quicksave",
.RunQS => "runqs",
.Amp => "amp",
.RFlanger => "rflanger",
.Eq => "eq",
.Phaser => "phaser",
.Mbeq => "mbeq",
.Chorus => "chorus",
.PitchScaler => "pitchscaler",
.Reverb => "reverb",
.Highpass => "highpass",
.Delay => "delay",
.Vinyl => "vinyl",
.RevDelay => "revdelay",
.Gate => "gate",
.Detune => "detune",
.Overdrive => "overdrive",
.Degrade => "Degrade",
.RePsycho => "repsycho",
.TalkBox => "talkbox",
.DynComp => "dyncomp",
.ThruZero => "thruzero",
.Foverdrive => "foverdrive",
.Gverb => "gverb",
.Invert => "invert",
.TapeDelay => "tapedelay",
.ModDelay => "moddelay",
.MultiChorus => "multichorus",
.Saturator => "saturator",
.VintageDelay => "vintagedelay",
.Noise => "noise",
.WildNoise => "wildnoise",
.Write => "write",
.Embed => "embed",
.Rotate => "rotate",
};
try stream.print("{}", .{command});
for (cmd.args.items) |arg| {