From 15454f926a1ce4a797a76a34815988cf13846149 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 29 Jun 2021 22:49:12 -0400 Subject: [PATCH] Add TokenNames array --- assets/parser.d.erb | 10 ++++++++++ 1 file changed, 10 insertions(+) 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;