@herb-tools/node 0.8.10 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/binding.gyp +27 -8
  2. package/dist/herb-node.cjs +41 -12
  3. package/dist/herb-node.cjs.map +1 -1
  4. package/dist/herb-node.esm.js +8 -1
  5. package/dist/herb-node.esm.js.map +1 -1
  6. package/dist/types/node-backend.d.ts +3 -1
  7. package/extension/error_helpers.cpp +598 -73
  8. package/extension/error_helpers.h +20 -3
  9. package/extension/extension_helpers.cpp +40 -35
  10. package/extension/extension_helpers.h +2 -2
  11. package/extension/herb.cpp +194 -64
  12. package/extension/libherb/analyze/action_view/attribute_extraction_helpers.c +303 -0
  13. package/extension/libherb/analyze/action_view/attribute_extraction_helpers.h +36 -0
  14. package/extension/libherb/analyze/action_view/content_tag.c +78 -0
  15. package/extension/libherb/analyze/action_view/link_to.c +167 -0
  16. package/extension/libherb/analyze/action_view/registry.c +83 -0
  17. package/extension/libherb/analyze/action_view/tag.c +70 -0
  18. package/extension/libherb/analyze/action_view/tag_helper_handler.h +43 -0
  19. package/extension/libherb/analyze/action_view/tag_helper_node_builders.c +305 -0
  20. package/extension/libherb/analyze/action_view/tag_helper_node_builders.h +70 -0
  21. package/extension/libherb/analyze/action_view/tag_helpers.c +815 -0
  22. package/extension/libherb/analyze/action_view/tag_helpers.h +38 -0
  23. package/extension/libherb/analyze/action_view/turbo_frame_tag.c +88 -0
  24. package/extension/libherb/analyze/analyze.c +885 -0
  25. package/extension/libherb/{include → analyze}/analyze.h +14 -4
  26. package/extension/libherb/{analyzed_ruby.c → analyze/analyzed_ruby.c} +13 -11
  27. package/extension/libherb/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
  28. package/extension/libherb/analyze/builders.c +343 -0
  29. package/extension/libherb/analyze/builders.h +27 -0
  30. package/extension/libherb/analyze/conditional_elements.c +594 -0
  31. package/extension/libherb/analyze/conditional_elements.h +9 -0
  32. package/extension/libherb/analyze/conditional_open_tags.c +640 -0
  33. package/extension/libherb/analyze/conditional_open_tags.h +9 -0
  34. package/extension/libherb/analyze/control_type.c +250 -0
  35. package/extension/libherb/analyze/control_type.h +14 -0
  36. package/extension/libherb/{analyze_helpers.c → analyze/helpers.c} +48 -23
  37. package/extension/libherb/{analyze_helpers.h → analyze/helpers.h} +4 -2
  38. package/extension/libherb/analyze/invalid_structures.c +193 -0
  39. package/extension/libherb/analyze/invalid_structures.h +11 -0
  40. package/extension/libherb/{analyze_missing_end.c → analyze/missing_end.c} +33 -22
  41. package/extension/libherb/analyze/parse_errors.c +84 -0
  42. package/extension/libherb/analyze/prism_annotate.c +399 -0
  43. package/extension/libherb/analyze/prism_annotate.h +16 -0
  44. package/extension/libherb/analyze/render_nodes.c +761 -0
  45. package/extension/libherb/analyze/render_nodes.h +11 -0
  46. package/extension/libherb/{analyze_transform.c → analyze/transform.c} +24 -3
  47. package/extension/libherb/ast_node.c +17 -7
  48. package/extension/libherb/ast_node.h +11 -5
  49. package/extension/libherb/ast_nodes.c +760 -388
  50. package/extension/libherb/ast_nodes.h +155 -39
  51. package/extension/libherb/ast_pretty_print.c +265 -7
  52. package/extension/libherb/ast_pretty_print.h +6 -1
  53. package/extension/libherb/element_source.h +3 -8
  54. package/extension/libherb/errors.c +1455 -520
  55. package/extension/libherb/errors.h +207 -56
  56. package/extension/libherb/extract.c +145 -49
  57. package/extension/libherb/extract.h +21 -5
  58. package/extension/libherb/herb.c +52 -34
  59. package/extension/libherb/herb.h +18 -6
  60. package/extension/libherb/herb_prism_node.h +13 -0
  61. package/extension/libherb/html_util.c +241 -12
  62. package/extension/libherb/html_util.h +7 -2
  63. package/extension/libherb/include/analyze/action_view/attribute_extraction_helpers.h +36 -0
  64. package/extension/libherb/include/analyze/action_view/tag_helper_handler.h +43 -0
  65. package/extension/libherb/include/analyze/action_view/tag_helper_node_builders.h +70 -0
  66. package/extension/libherb/include/analyze/action_view/tag_helpers.h +38 -0
  67. package/extension/libherb/{analyze.h → include/analyze/analyze.h} +14 -4
  68. package/extension/libherb/include/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
  69. package/extension/libherb/include/analyze/builders.h +27 -0
  70. package/extension/libherb/include/analyze/conditional_elements.h +9 -0
  71. package/extension/libherb/include/analyze/conditional_open_tags.h +9 -0
  72. package/extension/libherb/include/analyze/control_type.h +14 -0
  73. package/extension/libherb/include/{analyze_helpers.h → analyze/helpers.h} +4 -2
  74. package/extension/libherb/include/analyze/invalid_structures.h +11 -0
  75. package/extension/libherb/include/analyze/prism_annotate.h +16 -0
  76. package/extension/libherb/include/analyze/render_nodes.h +11 -0
  77. package/extension/libherb/include/ast_node.h +11 -5
  78. package/extension/libherb/include/ast_nodes.h +155 -39
  79. package/extension/libherb/include/ast_pretty_print.h +6 -1
  80. package/extension/libherb/include/element_source.h +3 -8
  81. package/extension/libherb/include/errors.h +207 -56
  82. package/extension/libherb/include/extract.h +21 -5
  83. package/extension/libherb/include/herb.h +18 -6
  84. package/extension/libherb/include/herb_prism_node.h +13 -0
  85. package/extension/libherb/include/html_util.h +7 -2
  86. package/extension/libherb/include/io.h +3 -1
  87. package/extension/libherb/include/lex_helpers.h +29 -0
  88. package/extension/libherb/include/lexer.h +1 -1
  89. package/extension/libherb/include/lexer_peek_helpers.h +87 -13
  90. package/extension/libherb/include/lexer_struct.h +2 -0
  91. package/extension/libherb/include/location.h +2 -1
  92. package/extension/libherb/include/parser.h +28 -2
  93. package/extension/libherb/include/parser_helpers.h +19 -3
  94. package/extension/libherb/include/pretty_print.h +10 -5
  95. package/extension/libherb/include/prism_context.h +45 -0
  96. package/extension/libherb/include/prism_helpers.h +10 -7
  97. package/extension/libherb/include/prism_serialized.h +12 -0
  98. package/extension/libherb/include/token.h +16 -4
  99. package/extension/libherb/include/token_struct.h +10 -3
  100. package/extension/libherb/include/utf8.h +2 -1
  101. package/extension/libherb/include/util/hb_allocator.h +78 -0
  102. package/extension/libherb/include/util/hb_arena.h +6 -1
  103. package/extension/libherb/include/util/hb_arena_debug.h +12 -1
  104. package/extension/libherb/include/util/hb_array.h +7 -3
  105. package/extension/libherb/include/util/hb_buffer.h +6 -4
  106. package/extension/libherb/include/util/hb_foreach.h +79 -0
  107. package/extension/libherb/include/util/hb_narray.h +8 -4
  108. package/extension/libherb/include/util/hb_string.h +56 -9
  109. package/extension/libherb/include/util.h +6 -3
  110. package/extension/libherb/include/version.h +1 -1
  111. package/extension/libherb/io.c +3 -2
  112. package/extension/libherb/io.h +3 -1
  113. package/extension/libherb/lex_helpers.h +29 -0
  114. package/extension/libherb/lexer.c +42 -30
  115. package/extension/libherb/lexer.h +1 -1
  116. package/extension/libherb/lexer_peek_helpers.c +12 -74
  117. package/extension/libherb/lexer_peek_helpers.h +87 -13
  118. package/extension/libherb/lexer_struct.h +2 -0
  119. package/extension/libherb/location.c +2 -2
  120. package/extension/libherb/location.h +2 -1
  121. package/extension/libherb/main.c +53 -28
  122. package/extension/libherb/parser.c +784 -247
  123. package/extension/libherb/parser.h +28 -2
  124. package/extension/libherb/parser_helpers.c +110 -23
  125. package/extension/libherb/parser_helpers.h +19 -3
  126. package/extension/libherb/parser_match_tags.c +130 -49
  127. package/extension/libherb/pretty_print.c +29 -24
  128. package/extension/libherb/pretty_print.h +10 -5
  129. package/extension/libherb/prism_context.h +45 -0
  130. package/extension/libherb/prism_helpers.c +30 -27
  131. package/extension/libherb/prism_helpers.h +10 -7
  132. package/extension/libherb/prism_serialized.h +12 -0
  133. package/extension/libherb/ruby_parser.c +2 -0
  134. package/extension/libherb/token.c +151 -66
  135. package/extension/libherb/token.h +16 -4
  136. package/extension/libherb/token_matchers.c +0 -1
  137. package/extension/libherb/token_struct.h +10 -3
  138. package/extension/libherb/utf8.c +7 -6
  139. package/extension/libherb/utf8.h +2 -1
  140. package/extension/libherb/util/hb_allocator.c +341 -0
  141. package/extension/libherb/util/hb_allocator.h +78 -0
  142. package/extension/libherb/util/hb_arena.c +81 -56
  143. package/extension/libherb/util/hb_arena.h +6 -1
  144. package/extension/libherb/util/hb_arena_debug.c +32 -17
  145. package/extension/libherb/util/hb_arena_debug.h +12 -1
  146. package/extension/libherb/util/hb_array.c +30 -15
  147. package/extension/libherb/util/hb_array.h +7 -3
  148. package/extension/libherb/util/hb_buffer.c +17 -21
  149. package/extension/libherb/util/hb_buffer.h +6 -4
  150. package/extension/libherb/util/hb_foreach.h +79 -0
  151. package/extension/libherb/util/hb_narray.c +22 -7
  152. package/extension/libherb/util/hb_narray.h +8 -4
  153. package/extension/libherb/util/hb_string.c +49 -35
  154. package/extension/libherb/util/hb_string.h +56 -9
  155. package/extension/libherb/util.c +21 -11
  156. package/extension/libherb/util.h +6 -3
  157. package/extension/libherb/version.h +1 -1
  158. package/extension/libherb/visitor.c +68 -1
  159. package/extension/nodes.cpp +593 -6
  160. package/extension/nodes.h +10 -1
  161. package/package.json +12 -8
  162. package/src/node-backend.ts +11 -1
  163. package/dist/types/index-cjs.d.cts +0 -1
  164. package/extension/libherb/analyze.c +0 -1608
  165. package/extension/libherb/element_source.c +0 -12
  166. package/extension/libherb/include/util/hb_system.h +0 -9
  167. package/extension/libherb/util/hb_system.c +0 -30
  168. package/extension/libherb/util/hb_system.h +0 -9
  169. package/src/index-cjs.cts +0 -22
  170. /package/dist/types/{index-esm.d.mts → index.d.ts} +0 -0
  171. /package/src/{index-esm.mts → index.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  // NOTE: This file is generated by the templates/template.rb script and should not
2
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/src/include/ast_nodes.h.erb
2
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/src/include/ast_nodes.h.erb
3
3
 
4
4
  #ifndef HERB_AST_NODES_H
5
5
  #define HERB_AST_NODES_H
@@ -7,11 +7,15 @@
7
7
  #include <stdbool.h>
8
8
  #include <prism.h>
9
9
 
10
- #include "analyzed_ruby.h"
10
+ #include "analyze/analyzed_ruby.h"
11
11
  #include "element_source.h"
12
+ #include "herb_prism_node.h"
13
+ #include "prism_context.h"
14
+ #include "prism_serialized.h"
12
15
  #include "location.h"
13
16
  #include "position.h"
14
17
  #include "token_struct.h"
18
+ #include "util/hb_allocator.h"
15
19
  #include "util/hb_array.h"
16
20
  #include "util/hb_buffer.h"
17
21
  #include "util/hb_string.h"
@@ -20,11 +24,18 @@ typedef enum {
20
24
  AST_DOCUMENT_NODE,
21
25
  AST_LITERAL_NODE,
22
26
  AST_HTML_OPEN_TAG_NODE,
27
+ AST_HTML_CONDITIONAL_OPEN_TAG_NODE,
23
28
  AST_HTML_CLOSE_TAG_NODE,
29
+ AST_HTML_OMITTED_CLOSE_TAG_NODE,
30
+ AST_HTML_VIRTUAL_CLOSE_TAG_NODE,
24
31
  AST_HTML_ELEMENT_NODE,
32
+ AST_HTML_CONDITIONAL_ELEMENT_NODE,
25
33
  AST_HTML_ATTRIBUTE_VALUE_NODE,
26
34
  AST_HTML_ATTRIBUTE_NAME_NODE,
27
35
  AST_HTML_ATTRIBUTE_NODE,
36
+ AST_RUBY_LITERAL_NODE,
37
+ AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE,
38
+ AST_ERB_OPEN_TAG_NODE,
28
39
  AST_HTML_TEXT_NODE,
29
40
  AST_HTML_COMMENT_NODE,
30
41
  AST_HTML_DOCTYPE_NODE,
@@ -46,6 +57,8 @@ typedef enum {
46
57
  AST_ERB_ENSURE_NODE,
47
58
  AST_ERB_BEGIN_NODE,
48
59
  AST_ERB_UNLESS_NODE,
60
+ AST_RUBY_RENDER_LOCAL_NODE,
61
+ AST_ERB_RENDER_NODE,
49
62
  AST_ERB_YIELD_NODE,
50
63
  AST_ERB_IN_NODE,
51
64
  } ast_node_type_T;
@@ -61,11 +74,13 @@ typedef struct AST_NODE_STRUCT {
61
74
  typedef struct AST_DOCUMENT_NODE_STRUCT {
62
75
  AST_NODE_T base;
63
76
  hb_array_T* children;
77
+ herb_prism_context_T* prism_context;
78
+ herb_prism_node_T prism_node;
64
79
  } AST_DOCUMENT_NODE_T;
65
80
 
66
81
  typedef struct AST_LITERAL_NODE_STRUCT {
67
82
  AST_NODE_T base;
68
- const char* content;
83
+ hb_string_T content;
69
84
  } AST_LITERAL_NODE_T;
70
85
 
71
86
  typedef struct AST_HTML_OPEN_TAG_NODE_STRUCT {
@@ -77,6 +92,13 @@ typedef struct AST_HTML_OPEN_TAG_NODE_STRUCT {
77
92
  bool is_void;
78
93
  } AST_HTML_OPEN_TAG_NODE_T;
79
94
 
95
+ typedef struct AST_HTML_CONDITIONAL_OPEN_TAG_NODE_STRUCT {
96
+ AST_NODE_T base;
97
+ AST_NODE_T* conditional;
98
+ token_T* tag_name;
99
+ bool is_void;
100
+ } AST_HTML_CONDITIONAL_OPEN_TAG_NODE_T;
101
+
80
102
  typedef struct AST_HTML_CLOSE_TAG_NODE_STRUCT {
81
103
  AST_NODE_T base;
82
104
  token_T* tag_opening;
@@ -85,16 +107,38 @@ typedef struct AST_HTML_CLOSE_TAG_NODE_STRUCT {
85
107
  token_T* tag_closing;
86
108
  } AST_HTML_CLOSE_TAG_NODE_T;
87
109
 
110
+ typedef struct AST_HTML_OMITTED_CLOSE_TAG_NODE_STRUCT {
111
+ AST_NODE_T base;
112
+ token_T* tag_name;
113
+ } AST_HTML_OMITTED_CLOSE_TAG_NODE_T;
114
+
115
+ typedef struct AST_HTML_VIRTUAL_CLOSE_TAG_NODE_STRUCT {
116
+ AST_NODE_T base;
117
+ token_T* tag_name;
118
+ } AST_HTML_VIRTUAL_CLOSE_TAG_NODE_T;
119
+
88
120
  typedef struct AST_HTML_ELEMENT_NODE_STRUCT {
89
121
  AST_NODE_T base;
90
- struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag;
122
+ AST_NODE_T* open_tag;
91
123
  token_T* tag_name;
92
124
  hb_array_T* body;
93
- struct AST_HTML_CLOSE_TAG_NODE_STRUCT* close_tag;
125
+ AST_NODE_T* close_tag;
94
126
  bool is_void;
95
- element_source_t source;
127
+ hb_string_T element_source;
96
128
  } AST_HTML_ELEMENT_NODE_T;
97
129
 
130
+ typedef struct AST_HTML_CONDITIONAL_ELEMENT_NODE_STRUCT {
131
+ AST_NODE_T base;
132
+ hb_string_T condition;
133
+ AST_NODE_T* open_conditional;
134
+ struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag;
135
+ hb_array_T* body;
136
+ AST_NODE_T* close_tag;
137
+ AST_NODE_T* close_conditional;
138
+ token_T* tag_name;
139
+ hb_string_T element_source;
140
+ } AST_HTML_CONDITIONAL_ELEMENT_NODE_T;
141
+
98
142
  typedef struct AST_HTML_ATTRIBUTE_VALUE_NODE_STRUCT {
99
143
  AST_NODE_T base;
100
144
  token_T* open_quote;
@@ -115,9 +159,29 @@ typedef struct AST_HTML_ATTRIBUTE_NODE_STRUCT {
115
159
  struct AST_HTML_ATTRIBUTE_VALUE_NODE_STRUCT* value;
116
160
  } AST_HTML_ATTRIBUTE_NODE_T;
117
161
 
162
+ typedef struct AST_RUBY_LITERAL_NODE_STRUCT {
163
+ AST_NODE_T base;
164
+ hb_string_T content;
165
+ } AST_RUBY_LITERAL_NODE_T;
166
+
167
+ typedef struct AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE_STRUCT {
168
+ AST_NODE_T base;
169
+ hb_string_T content;
170
+ hb_string_T prefix;
171
+ } AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE_T;
172
+
173
+ typedef struct AST_ERB_OPEN_TAG_NODE_STRUCT {
174
+ AST_NODE_T base;
175
+ token_T* tag_opening;
176
+ token_T* content;
177
+ token_T* tag_closing;
178
+ token_T* tag_name;
179
+ hb_array_T* children;
180
+ } AST_ERB_OPEN_TAG_NODE_T;
181
+
118
182
  typedef struct AST_HTML_TEXT_NODE_STRUCT {
119
183
  AST_NODE_T base;
120
- const char* content;
184
+ hb_string_T content;
121
185
  } AST_HTML_TEXT_NODE_T;
122
186
 
123
187
  typedef struct AST_HTML_COMMENT_NODE_STRUCT {
@@ -161,6 +225,7 @@ typedef struct AST_ERB_CONTENT_NODE_STRUCT {
161
225
  analyzed_ruby_T* analyzed_ruby;
162
226
  bool parsed;
163
227
  bool valid;
228
+ herb_prism_node_T prism_node;
164
229
  } AST_ERB_CONTENT_NODE_T;
165
230
 
166
231
  typedef struct AST_ERB_END_NODE_STRUCT {
@@ -184,8 +249,9 @@ typedef struct AST_ERB_IF_NODE_STRUCT {
184
249
  token_T* content;
185
250
  token_T* tag_closing;
186
251
  location_T* then_keyword;
252
+ herb_prism_node_T prism_node;
187
253
  hb_array_T* statements;
188
- struct AST_NODE_STRUCT* subsequent;
254
+ AST_NODE_T* subsequent;
189
255
  struct AST_ERB_END_NODE_STRUCT* end_node;
190
256
  } AST_ERB_IF_NODE_T;
191
257
 
@@ -194,6 +260,7 @@ typedef struct AST_ERB_BLOCK_NODE_STRUCT {
194
260
  token_T* tag_opening;
195
261
  token_T* content;
196
262
  token_T* tag_closing;
263
+ herb_prism_node_T prism_node;
197
264
  hb_array_T* body;
198
265
  struct AST_ERB_END_NODE_STRUCT* end_node;
199
266
  } AST_ERB_BLOCK_NODE_T;
@@ -213,6 +280,7 @@ typedef struct AST_ERB_CASE_NODE_STRUCT {
213
280
  token_T* content;
214
281
  token_T* tag_closing;
215
282
  hb_array_T* children;
283
+ herb_prism_node_T prism_node;
216
284
  hb_array_T* conditions;
217
285
  struct AST_ERB_ELSE_NODE_STRUCT* else_clause;
218
286
  struct AST_ERB_END_NODE_STRUCT* end_node;
@@ -224,6 +292,7 @@ typedef struct AST_ERB_CASE_MATCH_NODE_STRUCT {
224
292
  token_T* content;
225
293
  token_T* tag_closing;
226
294
  hb_array_T* children;
295
+ herb_prism_node_T prism_node;
227
296
  hb_array_T* conditions;
228
297
  struct AST_ERB_ELSE_NODE_STRUCT* else_clause;
229
298
  struct AST_ERB_END_NODE_STRUCT* end_node;
@@ -234,6 +303,7 @@ typedef struct AST_ERB_WHILE_NODE_STRUCT {
234
303
  token_T* tag_opening;
235
304
  token_T* content;
236
305
  token_T* tag_closing;
306
+ herb_prism_node_T prism_node;
237
307
  hb_array_T* statements;
238
308
  struct AST_ERB_END_NODE_STRUCT* end_node;
239
309
  } AST_ERB_WHILE_NODE_T;
@@ -243,6 +313,7 @@ typedef struct AST_ERB_UNTIL_NODE_STRUCT {
243
313
  token_T* tag_opening;
244
314
  token_T* content;
245
315
  token_T* tag_closing;
316
+ herb_prism_node_T prism_node;
246
317
  hb_array_T* statements;
247
318
  struct AST_ERB_END_NODE_STRUCT* end_node;
248
319
  } AST_ERB_UNTIL_NODE_T;
@@ -252,6 +323,7 @@ typedef struct AST_ERB_FOR_NODE_STRUCT {
252
323
  token_T* tag_opening;
253
324
  token_T* content;
254
325
  token_T* tag_closing;
326
+ herb_prism_node_T prism_node;
255
327
  hb_array_T* statements;
256
328
  struct AST_ERB_END_NODE_STRUCT* end_node;
257
329
  } AST_ERB_FOR_NODE_T;
@@ -278,6 +350,7 @@ typedef struct AST_ERB_BEGIN_NODE_STRUCT {
278
350
  token_T* tag_opening;
279
351
  token_T* content;
280
352
  token_T* tag_closing;
353
+ herb_prism_node_T prism_node;
281
354
  hb_array_T* statements;
282
355
  struct AST_ERB_RESCUE_NODE_STRUCT* rescue_clause;
283
356
  struct AST_ERB_ELSE_NODE_STRUCT* else_clause;
@@ -291,11 +364,45 @@ typedef struct AST_ERB_UNLESS_NODE_STRUCT {
291
364
  token_T* content;
292
365
  token_T* tag_closing;
293
366
  location_T* then_keyword;
367
+ herb_prism_node_T prism_node;
294
368
  hb_array_T* statements;
295
369
  struct AST_ERB_ELSE_NODE_STRUCT* else_clause;
296
370
  struct AST_ERB_END_NODE_STRUCT* end_node;
297
371
  } AST_ERB_UNLESS_NODE_T;
298
372
 
373
+ typedef struct AST_RUBY_RENDER_LOCAL_NODE_STRUCT {
374
+ AST_NODE_T base;
375
+ token_T* name;
376
+ struct AST_RUBY_LITERAL_NODE_STRUCT* value;
377
+ } AST_RUBY_RENDER_LOCAL_NODE_T;
378
+
379
+ typedef struct AST_ERB_RENDER_NODE_STRUCT {
380
+ AST_NODE_T base;
381
+ token_T* tag_opening;
382
+ token_T* content;
383
+ token_T* tag_closing;
384
+ analyzed_ruby_T* analyzed_ruby;
385
+ herb_prism_node_T prism_node;
386
+ token_T* partial;
387
+ token_T* template_path;
388
+ token_T* layout;
389
+ token_T* file;
390
+ token_T* inline_template;
391
+ token_T* body;
392
+ token_T* plain;
393
+ token_T* html;
394
+ token_T* renderable;
395
+ token_T* collection;
396
+ token_T* object;
397
+ token_T* as_name;
398
+ token_T* spacer_template;
399
+ token_T* formats;
400
+ token_T* variants;
401
+ token_T* handlers;
402
+ token_T* content_type;
403
+ hb_array_T* locals;
404
+ } AST_ERB_RENDER_NODE_T;
405
+
299
406
  typedef struct AST_ERB_YIELD_NODE_STRUCT {
300
407
  AST_NODE_T base;
301
408
  token_T* tag_opening;
@@ -312,37 +419,46 @@ typedef struct AST_ERB_IN_NODE_STRUCT {
312
419
  hb_array_T* statements;
313
420
  } AST_ERB_IN_NODE_T;
314
421
 
315
- AST_DOCUMENT_NODE_T* ast_document_node_init(hb_array_T* children, position_T start_position, position_T end_position, hb_array_T* errors);
316
- AST_LITERAL_NODE_T* ast_literal_node_init(const char* content, position_T start_position, position_T end_position, hb_array_T* errors);
317
- AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, token_T* tag_name, token_T* tag_closing, hb_array_T* children, bool is_void, position_T start_position, position_T end_position, hb_array_T* errors);
318
- AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, token_T* tag_name, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors);
319
- AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag, token_T* tag_name, hb_array_T* body, struct AST_HTML_CLOSE_TAG_NODE_STRUCT* close_tag, bool is_void, element_source_t source, position_T start_position, position_T end_position, hb_array_T* errors);
320
- AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* open_quote, hb_array_T* children, token_T* close_quote, bool quoted, position_T start_position, position_T end_position, hb_array_T* errors);
321
- AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(hb_array_T* children, position_T start_position, position_T end_position, hb_array_T* errors);
322
- AST_HTML_ATTRIBUTE_NODE_T* ast_html_attribute_node_init(struct AST_HTML_ATTRIBUTE_NAME_NODE_STRUCT* name, token_T* equals, struct AST_HTML_ATTRIBUTE_VALUE_NODE_STRUCT* value, position_T start_position, position_T end_position, hb_array_T* errors);
323
- AST_HTML_TEXT_NODE_T* ast_html_text_node_init(const char* content, position_T start_position, position_T end_position, hb_array_T* errors);
324
- AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, hb_array_T* children, token_T* comment_end, position_T start_position, position_T end_position, hb_array_T* errors);
325
- AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors);
326
- AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors);
327
- AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors);
328
- AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T start_position, position_T end_position, hb_array_T* errors);
329
- AST_ERB_CONTENT_NODE_T* ast_erb_content_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, analyzed_ruby_T* analyzed_ruby, bool parsed, bool valid, position_T start_position, position_T end_position, hb_array_T* errors);
330
- AST_ERB_END_NODE_T* ast_erb_end_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors);
331
- AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors);
332
- AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, hb_array_T* statements, struct AST_NODE_STRUCT* subsequent, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
333
- AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* body, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
334
- AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors);
335
- AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* children, hb_array_T* conditions, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
336
- AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* children, hb_array_T* conditions, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
337
- AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
338
- AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
339
- AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
340
- AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* subsequent, position_T start_position, position_T end_position, hb_array_T* errors);
341
- AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors);
342
- AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* rescue_clause, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_ENSURE_NODE_STRUCT* ensure_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
343
- AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, hb_array_T* statements, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors);
344
- AST_ERB_YIELD_NODE_T* ast_erb_yield_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors);
345
- AST_ERB_IN_NODE_T* ast_erb_in_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors);
422
+ AST_DOCUMENT_NODE_T* ast_document_node_init(hb_array_T* children, herb_prism_context_T* prism_context, herb_prism_node_T prism_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
423
+ AST_LITERAL_NODE_T* ast_literal_node_init(hb_string_T content, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
424
+ AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, token_T* tag_name, token_T* tag_closing, hb_array_T* children, bool is_void, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
425
+ AST_HTML_CONDITIONAL_OPEN_TAG_NODE_T* ast_html_conditional_open_tag_node_init(AST_NODE_T* conditional, token_T* tag_name, bool is_void, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
426
+ AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, token_T* tag_name, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
427
+ AST_HTML_OMITTED_CLOSE_TAG_NODE_T* ast_html_omitted_close_tag_node_init(token_T* tag_name, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
428
+ AST_HTML_VIRTUAL_CLOSE_TAG_NODE_T* ast_html_virtual_close_tag_node_init(token_T* tag_name, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
429
+ AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(AST_NODE_T* open_tag, token_T* tag_name, hb_array_T* body, AST_NODE_T* close_tag, bool is_void, hb_string_T element_source, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
430
+ AST_HTML_CONDITIONAL_ELEMENT_NODE_T* ast_html_conditional_element_node_init(hb_string_T condition, AST_NODE_T* open_conditional, struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag, hb_array_T* body, AST_NODE_T* close_tag, AST_NODE_T* close_conditional, token_T* tag_name, hb_string_T element_source, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
431
+ AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* open_quote, hb_array_T* children, token_T* close_quote, bool quoted, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
432
+ AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(hb_array_T* children, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
433
+ AST_HTML_ATTRIBUTE_NODE_T* ast_html_attribute_node_init(struct AST_HTML_ATTRIBUTE_NAME_NODE_STRUCT* name, token_T* equals, struct AST_HTML_ATTRIBUTE_VALUE_NODE_STRUCT* value, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
434
+ AST_RUBY_LITERAL_NODE_T* ast_ruby_literal_node_init(hb_string_T content, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
435
+ AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE_T* ast_ruby_html_attributes_splat_node_init(hb_string_T content, hb_string_T prefix, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
436
+ AST_ERB_OPEN_TAG_NODE_T* ast_erb_open_tag_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, token_T* tag_name, hb_array_T* children, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
437
+ AST_HTML_TEXT_NODE_T* ast_html_text_node_init(hb_string_T content, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
438
+ AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, hb_array_T* children, token_T* comment_end, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
439
+ AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
440
+ AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
441
+ AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, hb_array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
442
+ AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
443
+ AST_ERB_CONTENT_NODE_T* ast_erb_content_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, analyzed_ruby_T* analyzed_ruby, bool parsed, bool valid, herb_prism_node_T prism_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
444
+ AST_ERB_END_NODE_T* ast_erb_end_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
445
+ AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
446
+ AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, herb_prism_node_T prism_node, hb_array_T* statements, AST_NODE_T* subsequent, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
447
+ AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, herb_prism_node_T prism_node, hb_array_T* body, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
448
+ AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
449
+ AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* children, herb_prism_node_T prism_node, hb_array_T* conditions, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
450
+ AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* children, herb_prism_node_T prism_node, hb_array_T* conditions, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
451
+ AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, herb_prism_node_T prism_node, hb_array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
452
+ AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, herb_prism_node_T prism_node, hb_array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
453
+ AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, herb_prism_node_T prism_node, hb_array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
454
+ AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* subsequent, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
455
+ AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
456
+ AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, herb_prism_node_T prism_node, hb_array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* rescue_clause, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_ENSURE_NODE_STRUCT* ensure_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
457
+ AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, herb_prism_node_T prism_node, hb_array_T* statements, struct AST_ERB_ELSE_NODE_STRUCT* else_clause, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
458
+ AST_RUBY_RENDER_LOCAL_NODE_T* ast_ruby_render_local_node_init(token_T* name, struct AST_RUBY_LITERAL_NODE_STRUCT* value, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
459
+ AST_ERB_RENDER_NODE_T* ast_erb_render_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, analyzed_ruby_T* analyzed_ruby, herb_prism_node_T prism_node, token_T* partial, token_T* template_path, token_T* layout, token_T* file, token_T* inline_template, token_T* body, token_T* plain, token_T* html, token_T* renderable, token_T* collection, token_T* object, token_T* as_name, token_T* spacer_template, token_T* formats, token_T* variants, token_T* handlers, token_T* content_type, hb_array_T* locals, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
460
+ AST_ERB_YIELD_NODE_T* ast_erb_yield_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
461
+ AST_ERB_IN_NODE_T* ast_erb_in_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, location_T* then_keyword, hb_array_T* statements, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
346
462
 
347
463
  hb_string_T ast_node_type_to_string(AST_NODE_T* node);
348
464
  hb_string_T ast_node_human_type(AST_NODE_T* node);