aboutsummaryrefslogtreecommitdiff
path: root/src/argument.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/argument.zig')
-rw-r--r--src/argument.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/argument.zig b/src/argument.zig
index 75bb7bf..7912397 100644
--- a/src/argument.zig
+++ b/src/argument.zig
@@ -26,7 +26,7 @@ fn help(err: ?anyerror) noreturn {
\\
\\ -m, --min-length n Minimum length of sentential string.
\\
- \\ recognize [grammar] [options]
+ \\ benchmark [grammar] [options]
\\ Options:
\\ -e, --entry label Name of the entry point. (default: main)
\\
@@ -70,7 +70,7 @@ fn check_flags(arg: []const u8, comptime flags: []const []const u8) bool {
}
pub const Mode = enum {
- recognize,
+ benchmark,
generate,
};
@@ -115,7 +115,7 @@ pub const Entry = struct {
}
};
-pub const RecognizeArgs = struct {
+pub const BenchmarkArgs = struct {
input: Entry,
grammar: Grammar,
entry: []const u8,
@@ -132,7 +132,7 @@ pub const GenerateArgs = struct {
pub const Args = union(Mode) {
const Self = @This();
- recognize: RecognizeArgs,
+ benchmark: BenchmarkArgs,
generate: GenerateArgs,
pub fn parse(allocator: std.mem.Allocator) Self {
@@ -145,7 +145,7 @@ pub const Args = union(Mode) {
defer allocator.free(text);
switch (mode) {
- .recognize => {
+ .benchmark => {
var input: ?Entry = null;
var entry: []const u8 = "main";
@@ -164,7 +164,7 @@ pub const Args = union(Mode) {
) catch |e| help(e);
return Self {
- .recognize = .{
+ .benchmark = .{
.input = input orelse Entry.stdin(),
.grammar = grammar,
.entry = entry,
@@ -213,7 +213,7 @@ pub const Args = union(Mode) {
pub fn deinit(self: *Self) void {
switch (self.*) {
- .recognize => |*rec| {
+ .benchmark => |*rec| {
rec.grammar.deinit();
},
.generate => |*gen| {