complete adding lex_fn

This commit is contained in:
josh committed 2026-04-10 16:03:45 -04:00
1 parent e2db9c95c5
commit 0e5b0b1f8a
7 files changed
+101 -16

No files matched your search

+8
View File
@@ -86,6 +86,14 @@ public union <%= @grammar.prefix %>value_t
<%= typestring %> v_<%= name %>;
<% end %>
}
/** Parser value constructor(s). */
<% @grammar.ptypes.each do |name, typestring| %>
public <%= @grammar.prefix %>value_t <%= @grammar.prefix %>value<%= name == "default" ? "" : "_#{name}" %>(T)(T v)
{
return <%= @grammar.prefix %>value_t(v_<%= name %>: v);
}
<% end %>
<% end %>
<% if @grammar.tree %>
+8
View File
@@ -69,6 +69,14 @@ typedef union
<%= typestring %> v_<%= name %>;
<% end %>
} <%= @grammar.prefix %>value_t;
/** Parser value constructor(s). */
<% @grammar.ptypes.each do |name, typestring| %>
static inline <%= @grammar.prefix %>value_t <%= @grammar.prefix %>value<%= name == "default" ? "" : "_#{name}" %>(<%= typestring %> v)
{
return (<%= @grammar.prefix %>value_t){.v_<%= name %> = v};
}
<% end %>
<% end %>
<% if @grammar.tree %>