diff options
Diffstat (limited to 'src/generator.zig')
| -rw-r--r-- | src/generator.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/generator.zig b/src/generator.zig index 8d0c888..0676834 100644 --- a/src/generator.zig +++ b/src/generator.zig @@ -22,7 +22,7 @@ pub fn Generator(T: type) type { self.generate_sentential_recursive( grammar, &string, - grammar.entry_point().name, + grammar.entry_point().id, max_depth ) catch |err| switch (err) { error.MaxDepth => { @@ -41,14 +41,14 @@ pub fn Generator(T: type) type { self: *Self, grammar: *Grammar, string: *std.ArrayList(u8), - n: u8, + id: usize, max_depth: usize ) GenError!void { if (max_depth == 0) { return error.MaxDepth; } - const rules = grammar.non_terminal_by_name(n).rules(); + const rules = grammar.non_terminal_by_id(id).rules(); const index = self.inner.next(rules.len); const rule = rules[index]; |