Add AST node field name with no suffix when unique - #22
This commit is contained in:
1 parent
cb06a56f81
commit
c7a18ef821
5 files changed
+96
-70
No files matched your search
+7
-2
@@ -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
@@ -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 %>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user