diff --git a/assets/parser.d.erb b/assets/parser.d.erb index bfd3b79..f94f53c 100644 --- a/assets/parser.d.erb +++ b/assets/parser.d.erb @@ -13,6 +13,16 @@ class <%= classname %> <% end %> } + static immutable string TokenNames[] = [ +<% @grammar.tokens.each_with_index do |token, index| %> +<% if token.name %> + "<%= token.name %>", +<% else %> + null, +<% end %> +<% end %> + ]; + private struct Transition { uint first;