Add AST node field name with no suffix when unique - #22

This commit is contained in:
josh committed 2024-04-22 21:50:26 -04:00
1 parent cb06a56f81
commit c7a18ef821
5 files changed
+96 -70

No files matched your search

+7 -2
View File
@@ -74,8 +74,13 @@ public struct Token
<% next if name.start_with?("$") %>
public struct <%= name %>
{
<% rule_set.ast_fields.each do |name, type| %>
<%= type %> * <%= name %>;
<% rule_set.ast_fields.each do |fields| %>
union
{
<% fields.each do |field_name, type| %>
<%= type %> * <%= field_name %>;
<% end %>
}
<% end %>
}
+7 -2
View File
@@ -71,8 +71,13 @@ struct <%= name %>;
<% next if name.start_with?("$") %>
typedef struct <%= name %>
{
<% rule_set.ast_fields.each do |name, type| %>
struct <%= type %> * <%= name %>;
<% rule_set.ast_fields.each do |fields| %>
union
{
<% fields.each do |field_name, type| %>
struct <%= type %> * <%= field_name %>;
<% end %>
};
<% end %>
} <%= name %>;