Store tokens in Hash by name

This commit is contained in:
josh committed 2021-09-27 21:40:12 -04:00
1 parent 280b749e38
commit f3ed678fe1
3 files changed
+13 -15

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ class <%= classname %>
{
enum
{
<% @tokens.each_with_index do |token, index| %>
<% @tokens.each_with_index do |(name, token), index| %>
<% if token.name %>
TOKEN_<%= token.c_name %> = <%= index %>,
<% end %>
@@ -18,7 +18,7 @@ class <%= classname %>
}
static immutable string TokenNames[] = [
<% @tokens.each_with_index do |token, index| %>
<% @tokens.each_with_index do |(name, token), index| %>
<% if token.name %>
"<%= token.name %>",
<% else %>