File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,7 @@ typedef struct yp_node {
70
70
// existed in the original grammar and ripper, but it's not a 1:1 mapping.
71
71
yp_node_type_t type;
72
72
73
- // This represents any flags on the node. Currently, this is only a newline
74
- // flag
73
+ // This represents any flags on the node
75
74
yp_node_flags_t flags;
76
75
77
76
// This is the location of the node in the source. It's a range of bytes
@@ -81,6 +80,15 @@ typedef struct yp_node {
81
80
<%- nodes . each do |node | -%>
82
81
83
82
// <%= node . name %>
83
+ //
84
+ // Type: <%= node . type %>
85
+ <%- if ( node_flags = node . fields . find { |field | field . is_a? YARP ::FlagsField } ) -%>
86
+ // Flags:
87
+ <%- found = flags . find { |flag | flag . name == node_flags . kind } . tap { |found | raise "Expected to find #{ field . kind } " unless found } -%>
88
+ <%- found . values . each do |value | -%>
89
+ // YP_<%= found . human . upcase %> _<%= value . name %>
90
+ <%- end -%>
91
+ <%- end -%>
84
92
typedef struct yp_<%= node . human %> {
85
93
yp_node_t base;
86
94
<%- node . fields . grep_v ( YARP ::FlagsField ) . each do |field | -%>
You can’t perform that action at this time.
0 commit comments