@herb-tools/node 0.7.4 → 0.7.5

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 (56) hide show
  1. package/binding.gyp +0 -1
  2. package/dist/herb-node.esm.js +1 -1
  3. package/extension/error_helpers.cpp +1 -1
  4. package/extension/error_helpers.h +1 -1
  5. package/extension/extension_helpers.cpp +9 -27
  6. package/extension/extension_helpers.h +3 -3
  7. package/extension/libherb/analyze.c +43 -80
  8. package/extension/libherb/ast_node.c +10 -13
  9. package/extension/libherb/ast_node.h +3 -3
  10. package/extension/libherb/ast_nodes.c +32 -34
  11. package/extension/libherb/ast_nodes.h +33 -33
  12. package/extension/libherb/ast_pretty_print.c +1 -1
  13. package/extension/libherb/ast_pretty_print.h +1 -1
  14. package/extension/libherb/buffer.c +10 -1
  15. package/extension/libherb/errors.c +36 -36
  16. package/extension/libherb/errors.h +22 -22
  17. package/extension/libherb/include/ast_node.h +3 -3
  18. package/extension/libherb/include/ast_nodes.h +33 -33
  19. package/extension/libherb/include/ast_pretty_print.h +1 -1
  20. package/extension/libherb/include/errors.h +22 -22
  21. package/extension/libherb/include/lexer_peek_helpers.h +8 -6
  22. package/extension/libherb/include/lexer_struct.h +10 -9
  23. package/extension/libherb/include/location.h +10 -13
  24. package/extension/libherb/include/parser_helpers.h +1 -1
  25. package/extension/libherb/include/position.h +3 -14
  26. package/extension/libherb/include/pretty_print.h +1 -1
  27. package/extension/libherb/include/prism_helpers.h +1 -1
  28. package/extension/libherb/include/range.h +4 -13
  29. package/extension/libherb/include/token.h +0 -3
  30. package/extension/libherb/include/token_struct.h +2 -2
  31. package/extension/libherb/include/version.h +1 -1
  32. package/extension/libherb/lexer.c +3 -2
  33. package/extension/libherb/lexer_peek_helpers.c +10 -4
  34. package/extension/libherb/lexer_peek_helpers.h +8 -6
  35. package/extension/libherb/lexer_struct.h +10 -9
  36. package/extension/libherb/location.c +9 -37
  37. package/extension/libherb/location.h +10 -13
  38. package/extension/libherb/parser.c +98 -119
  39. package/extension/libherb/parser_helpers.c +15 -15
  40. package/extension/libherb/parser_helpers.h +1 -1
  41. package/extension/libherb/position.h +3 -14
  42. package/extension/libherb/pretty_print.c +7 -12
  43. package/extension/libherb/pretty_print.h +1 -1
  44. package/extension/libherb/prism_helpers.c +7 -7
  45. package/extension/libherb/prism_helpers.h +1 -1
  46. package/extension/libherb/range.c +2 -35
  47. package/extension/libherb/range.h +4 -13
  48. package/extension/libherb/token.c +25 -29
  49. package/extension/libherb/token.h +0 -3
  50. package/extension/libherb/token_struct.h +2 -2
  51. package/extension/libherb/version.h +1 -1
  52. package/extension/libherb/visitor.c +1 -1
  53. package/extension/nodes.cpp +1 -1
  54. package/extension/nodes.h +1 -1
  55. package/package.json +2 -2
  56. package/extension/libherb/position.c +0 -33
@@ -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.7.4/templates/src/ast_nodes.c.erb
2
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.7.5/templates/src/ast_nodes.c.erb
3
3
 
4
4
  #include <stdio.h>
5
5
  #include <stdbool.h>
@@ -15,7 +15,7 @@
15
15
  #include "include/util.h"
16
16
 
17
17
 
18
- AST_DOCUMENT_NODE_T* ast_document_node_init(array_T* children, position_T* start_position, position_T* end_position, array_T* errors) {
18
+ AST_DOCUMENT_NODE_T* ast_document_node_init(array_T* children, position_T start_position, position_T end_position, array_T* errors) {
19
19
  AST_DOCUMENT_NODE_T* document_node = malloc(sizeof(AST_DOCUMENT_NODE_T));
20
20
 
21
21
  ast_node_init(&document_node->base, AST_DOCUMENT_NODE, start_position, end_position, errors);
@@ -25,7 +25,7 @@ AST_DOCUMENT_NODE_T* ast_document_node_init(array_T* children, position_T* start
25
25
  return document_node;
26
26
  }
27
27
 
28
- AST_LITERAL_NODE_T* ast_literal_node_init(const char* content, position_T* start_position, position_T* end_position, array_T* errors) {
28
+ AST_LITERAL_NODE_T* ast_literal_node_init(const char* content, position_T start_position, position_T end_position, array_T* errors) {
29
29
  AST_LITERAL_NODE_T* literal_node = malloc(sizeof(AST_LITERAL_NODE_T));
30
30
 
31
31
  ast_node_init(&literal_node->base, AST_LITERAL_NODE, start_position, end_position, errors);
@@ -35,7 +35,7 @@ AST_LITERAL_NODE_T* ast_literal_node_init(const char* content, position_T* start
35
35
  return literal_node;
36
36
  }
37
37
 
38
- AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, token_T* tag_name, token_T* tag_closing, array_T* children, bool is_void, position_T* start_position, position_T* end_position, array_T* errors) {
38
+ AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, token_T* tag_name, token_T* tag_closing, array_T* children, bool is_void, position_T start_position, position_T end_position, array_T* errors) {
39
39
  AST_HTML_OPEN_TAG_NODE_T* html_open_tag_node = malloc(sizeof(AST_HTML_OPEN_TAG_NODE_T));
40
40
 
41
41
  ast_node_init(&html_open_tag_node->base, AST_HTML_OPEN_TAG_NODE, start_position, end_position, errors);
@@ -49,7 +49,7 @@ AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, toke
49
49
  return html_open_tag_node;
50
50
  }
51
51
 
52
- AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, token_T* tag_name, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors) {
52
+ AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, token_T* tag_name, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors) {
53
53
  AST_HTML_CLOSE_TAG_NODE_T* html_close_tag_node = malloc(sizeof(AST_HTML_CLOSE_TAG_NODE_T));
54
54
 
55
55
  ast_node_init(&html_close_tag_node->base, AST_HTML_CLOSE_TAG_NODE, start_position, end_position, errors);
@@ -62,7 +62,7 @@ AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, to
62
62
  return html_close_tag_node;
63
63
  }
64
64
 
65
- AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag, token_T* tag_name, 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, array_T* errors) {
65
+ AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag, token_T* tag_name, 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, array_T* errors) {
66
66
  AST_HTML_ELEMENT_NODE_T* html_element_node = malloc(sizeof(AST_HTML_ELEMENT_NODE_T));
67
67
 
68
68
  ast_node_init(&html_element_node->base, AST_HTML_ELEMENT_NODE, start_position, end_position, errors);
@@ -77,7 +77,7 @@ AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(struct AST_HTML_OPEN_TAG_NOD
77
77
  return html_element_node;
78
78
  }
79
79
 
80
- AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* open_quote, array_T* children, token_T* close_quote, bool quoted, position_T* start_position, position_T* end_position, array_T* errors) {
80
+ AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* open_quote, array_T* children, token_T* close_quote, bool quoted, position_T start_position, position_T end_position, array_T* errors) {
81
81
  AST_HTML_ATTRIBUTE_VALUE_NODE_T* html_attribute_value_node = malloc(sizeof(AST_HTML_ATTRIBUTE_VALUE_NODE_T));
82
82
 
83
83
  ast_node_init(&html_attribute_value_node->base, AST_HTML_ATTRIBUTE_VALUE_NODE, start_position, end_position, errors);
@@ -90,7 +90,7 @@ AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* ope
90
90
  return html_attribute_value_node;
91
91
  }
92
92
 
93
- AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(array_T* children, position_T* start_position, position_T* end_position, array_T* errors) {
93
+ AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(array_T* children, position_T start_position, position_T end_position, array_T* errors) {
94
94
  AST_HTML_ATTRIBUTE_NAME_NODE_T* html_attribute_name_node = malloc(sizeof(AST_HTML_ATTRIBUTE_NAME_NODE_T));
95
95
 
96
96
  ast_node_init(&html_attribute_name_node->base, AST_HTML_ATTRIBUTE_NAME_NODE, start_position, end_position, errors);
@@ -100,7 +100,7 @@ AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(array_T* child
100
100
  return html_attribute_name_node;
101
101
  }
102
102
 
103
- 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, array_T* errors) {
103
+ 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, array_T* errors) {
104
104
  AST_HTML_ATTRIBUTE_NODE_T* html_attribute_node = malloc(sizeof(AST_HTML_ATTRIBUTE_NODE_T));
105
105
 
106
106
  ast_node_init(&html_attribute_node->base, AST_HTML_ATTRIBUTE_NODE, start_position, end_position, errors);
@@ -112,7 +112,7 @@ AST_HTML_ATTRIBUTE_NODE_T* ast_html_attribute_node_init(struct AST_HTML_ATTRIBUT
112
112
  return html_attribute_node;
113
113
  }
114
114
 
115
- AST_HTML_TEXT_NODE_T* ast_html_text_node_init(const char* content, position_T* start_position, position_T* end_position, array_T* errors) {
115
+ AST_HTML_TEXT_NODE_T* ast_html_text_node_init(const char* content, position_T start_position, position_T end_position, array_T* errors) {
116
116
  AST_HTML_TEXT_NODE_T* html_text_node = malloc(sizeof(AST_HTML_TEXT_NODE_T));
117
117
 
118
118
  ast_node_init(&html_text_node->base, AST_HTML_TEXT_NODE, start_position, end_position, errors);
@@ -122,7 +122,7 @@ AST_HTML_TEXT_NODE_T* ast_html_text_node_init(const char* content, position_T* s
122
122
  return html_text_node;
123
123
  }
124
124
 
125
- AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, array_T* children, token_T* comment_end, position_T* start_position, position_T* end_position, array_T* errors) {
125
+ AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, array_T* children, token_T* comment_end, position_T start_position, position_T end_position, array_T* errors) {
126
126
  AST_HTML_COMMENT_NODE_T* html_comment_node = malloc(sizeof(AST_HTML_COMMENT_NODE_T));
127
127
 
128
128
  ast_node_init(&html_comment_node->base, AST_HTML_COMMENT_NODE, start_position, end_position, errors);
@@ -134,7 +134,7 @@ AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, arra
134
134
  return html_comment_node;
135
135
  }
136
136
 
137
- AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors) {
137
+ AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors) {
138
138
  AST_HTML_DOCTYPE_NODE_T* html_doctype_node = malloc(sizeof(AST_HTML_DOCTYPE_NODE_T));
139
139
 
140
140
  ast_node_init(&html_doctype_node->base, AST_HTML_DOCTYPE_NODE, start_position, end_position, errors);
@@ -146,7 +146,7 @@ AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, array_
146
146
  return html_doctype_node;
147
147
  }
148
148
 
149
- AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors) {
149
+ AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors) {
150
150
  AST_XML_DECLARATION_NODE_T* xml_declaration_node = malloc(sizeof(AST_XML_DECLARATION_NODE_T));
151
151
 
152
152
  ast_node_init(&xml_declaration_node->base, AST_XML_DECLARATION_NODE, start_position, end_position, errors);
@@ -158,7 +158,7 @@ AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening,
158
158
  return xml_declaration_node;
159
159
  }
160
160
 
161
- AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors) {
161
+ AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors) {
162
162
  AST_CDATA_NODE_T* cdata_node = malloc(sizeof(AST_CDATA_NODE_T));
163
163
 
164
164
  ast_node_init(&cdata_node->base, AST_CDATA_NODE, start_position, end_position, errors);
@@ -170,7 +170,7 @@ AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, array_T* children, t
170
170
  return cdata_node;
171
171
  }
172
172
 
173
- AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T* start_position, position_T* end_position, array_T* errors) {
173
+ AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T start_position, position_T end_position, array_T* errors) {
174
174
  AST_WHITESPACE_NODE_T* whitespace_node = malloc(sizeof(AST_WHITESPACE_NODE_T));
175
175
 
176
176
  ast_node_init(&whitespace_node->base, AST_WHITESPACE_NODE, start_position, end_position, errors);
@@ -180,7 +180,7 @@ AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T* star
180
180
  return whitespace_node;
181
181
  }
182
182
 
183
- 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, array_T* errors) {
183
+ 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, array_T* errors) {
184
184
  AST_ERB_CONTENT_NODE_T* erb_content_node = malloc(sizeof(AST_ERB_CONTENT_NODE_T));
185
185
 
186
186
  ast_node_init(&erb_content_node->base, AST_ERB_CONTENT_NODE, start_position, end_position, errors);
@@ -195,7 +195,7 @@ AST_ERB_CONTENT_NODE_T* ast_erb_content_node_init(token_T* tag_opening, token_T*
195
195
  return erb_content_node;
196
196
  }
197
197
 
198
- 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, array_T* errors) {
198
+ 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, array_T* errors) {
199
199
  AST_ERB_END_NODE_T* erb_end_node = malloc(sizeof(AST_ERB_END_NODE_T));
200
200
 
201
201
  ast_node_init(&erb_end_node->base, AST_ERB_END_NODE, start_position, end_position, errors);
@@ -207,7 +207,7 @@ AST_ERB_END_NODE_T* ast_erb_end_node_init(token_T* tag_opening, token_T* content
207
207
  return erb_end_node;
208
208
  }
209
209
 
210
- AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors) {
210
+ AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors) {
211
211
  AST_ERB_ELSE_NODE_T* erb_else_node = malloc(sizeof(AST_ERB_ELSE_NODE_T));
212
212
 
213
213
  ast_node_init(&erb_else_node->base, AST_ERB_ELSE_NODE, start_position, end_position, errors);
@@ -220,7 +220,7 @@ AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* conte
220
220
  return erb_else_node;
221
221
  }
222
222
 
223
- AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_NODE_STRUCT* subsequent, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors) {
223
+ AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_NODE_STRUCT* subsequent, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors) {
224
224
  AST_ERB_IF_NODE_T* erb_if_node = malloc(sizeof(AST_ERB_IF_NODE_T));
225
225
 
226
226
  ast_node_init(&erb_if_node->base, AST_ERB_IF_NODE, start_position, end_position, errors);
@@ -235,7 +235,7 @@ AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content,
235
235
  return erb_if_node;
236
236
  }
237
237
 
238
- AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* body, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors) {
238
+ AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* body, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors) {
239
239
  AST_ERB_BLOCK_NODE_T* erb_block_node = malloc(sizeof(AST_ERB_BLOCK_NODE_T));
240
240
 
241
241
  ast_node_init(&erb_block_node->base, AST_ERB_BLOCK_NODE, start_position, end_position, errors);
@@ -249,7 +249,7 @@ AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* con
249
249
  return erb_block_node;
250
250
  }
251
251
 
252
- AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors) {
252
+ AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors) {
253
253
  AST_ERB_WHEN_NODE_T* erb_when_node = malloc(sizeof(AST_ERB_WHEN_NODE_T));
254
254
 
255
255
  ast_node_init(&erb_when_node->base, AST_ERB_WHEN_NODE, start_position, end_position, errors);
@@ -262,7 +262,7 @@ AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* conte
262
262
  return erb_when_node;
263
263
  }
264
264
 
265
- AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors) {
265
+ AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors) {
266
266
  AST_ERB_CASE_NODE_T* erb_case_node = malloc(sizeof(AST_ERB_CASE_NODE_T));
267
267
 
268
268
  ast_node_init(&erb_case_node->base, AST_ERB_CASE_NODE, start_position, end_position, errors);
@@ -278,7 +278,7 @@ AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* conte
278
278
  return erb_case_node;
279
279
  }
280
280
 
281
- AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors) {
281
+ AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors) {
282
282
  AST_ERB_CASE_MATCH_NODE_T* erb_case_match_node = malloc(sizeof(AST_ERB_CASE_MATCH_NODE_T));
283
283
 
284
284
  ast_node_init(&erb_case_match_node->base, AST_ERB_CASE_MATCH_NODE, start_position, end_position, errors);
@@ -294,7 +294,7 @@ AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, to
294
294
  return erb_case_match_node;
295
295
  }
296
296
 
297
- AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors) {
297
+ AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors) {
298
298
  AST_ERB_WHILE_NODE_T* erb_while_node = malloc(sizeof(AST_ERB_WHILE_NODE_T));
299
299
 
300
300
  ast_node_init(&erb_while_node->base, AST_ERB_WHILE_NODE, start_position, end_position, errors);
@@ -308,7 +308,7 @@ AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* con
308
308
  return erb_while_node;
309
309
  }
310
310
 
311
- AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors) {
311
+ AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors) {
312
312
  AST_ERB_UNTIL_NODE_T* erb_until_node = malloc(sizeof(AST_ERB_UNTIL_NODE_T));
313
313
 
314
314
  ast_node_init(&erb_until_node->base, AST_ERB_UNTIL_NODE, start_position, end_position, errors);
@@ -322,7 +322,7 @@ AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* con
322
322
  return erb_until_node;
323
323
  }
324
324
 
325
- AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors) {
325
+ AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors) {
326
326
  AST_ERB_FOR_NODE_T* erb_for_node = malloc(sizeof(AST_ERB_FOR_NODE_T));
327
327
 
328
328
  ast_node_init(&erb_for_node->base, AST_ERB_FOR_NODE, start_position, end_position, errors);
@@ -336,7 +336,7 @@ AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content
336
336
  return erb_for_node;
337
337
  }
338
338
 
339
- AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* subsequent, position_T* start_position, position_T* end_position, array_T* errors) {
339
+ AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* subsequent, position_T start_position, position_T end_position, array_T* errors) {
340
340
  AST_ERB_RESCUE_NODE_T* erb_rescue_node = malloc(sizeof(AST_ERB_RESCUE_NODE_T));
341
341
 
342
342
  ast_node_init(&erb_rescue_node->base, AST_ERB_RESCUE_NODE, start_position, end_position, errors);
@@ -350,7 +350,7 @@ AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* c
350
350
  return erb_rescue_node;
351
351
  }
352
352
 
353
- AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors) {
353
+ AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors) {
354
354
  AST_ERB_ENSURE_NODE_T* erb_ensure_node = malloc(sizeof(AST_ERB_ENSURE_NODE_T));
355
355
 
356
356
  ast_node_init(&erb_ensure_node->base, AST_ERB_ENSURE_NODE, start_position, end_position, errors);
@@ -363,7 +363,7 @@ AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* c
363
363
  return erb_ensure_node;
364
364
  }
365
365
 
366
- AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors) {
366
+ AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors) {
367
367
  AST_ERB_BEGIN_NODE_T* erb_begin_node = malloc(sizeof(AST_ERB_BEGIN_NODE_T));
368
368
 
369
369
  ast_node_init(&erb_begin_node->base, AST_ERB_BEGIN_NODE, start_position, end_position, errors);
@@ -380,7 +380,7 @@ AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* con
380
380
  return erb_begin_node;
381
381
  }
382
382
 
383
- AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors) {
383
+ AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors) {
384
384
  AST_ERB_UNLESS_NODE_T* erb_unless_node = malloc(sizeof(AST_ERB_UNLESS_NODE_T));
385
385
 
386
386
  ast_node_init(&erb_unless_node->base, AST_ERB_UNLESS_NODE, start_position, end_position, errors);
@@ -395,7 +395,7 @@ AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* c
395
395
  return erb_unless_node;
396
396
  }
397
397
 
398
- 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, array_T* errors) {
398
+ 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, array_T* errors) {
399
399
  AST_ERB_YIELD_NODE_T* erb_yield_node = malloc(sizeof(AST_ERB_YIELD_NODE_T));
400
400
 
401
401
  ast_node_init(&erb_yield_node->base, AST_ERB_YIELD_NODE, start_position, end_position, errors);
@@ -407,7 +407,7 @@ AST_ERB_YIELD_NODE_T* ast_erb_yield_node_init(token_T* tag_opening, token_T* con
407
407
  return erb_yield_node;
408
408
  }
409
409
 
410
- AST_ERB_IN_NODE_T* ast_erb_in_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors) {
410
+ AST_ERB_IN_NODE_T* ast_erb_in_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors) {
411
411
  AST_ERB_IN_NODE_T* erb_in_node = malloc(sizeof(AST_ERB_IN_NODE_T));
412
412
 
413
413
  ast_node_init(&erb_in_node->base, AST_ERB_IN_NODE, start_position, end_position, errors);
@@ -508,8 +508,6 @@ void ast_free_base_node(AST_NODE_T* node) {
508
508
  array_free(&node->errors);
509
509
  }
510
510
 
511
- if (node->location) { location_free(node->location); }
512
-
513
511
  free(node);
514
512
  }
515
513
 
@@ -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.7.4/templates/src/include/ast_nodes.h.erb
2
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.7.5/templates/src/include/ast_nodes.h.erb
3
3
 
4
4
  #ifndef HERB_AST_NODES_H
5
5
  #define HERB_AST_NODES_H
@@ -51,7 +51,7 @@ typedef enum {
51
51
 
52
52
  typedef struct AST_NODE_STRUCT {
53
53
  ast_node_type_T type;
54
- location_T* location;
54
+ location_T location;
55
55
  // maybe a range too?
56
56
  array_T* errors;
57
57
  } AST_NODE_T;
@@ -307,37 +307,37 @@ typedef struct AST_ERB_IN_NODE_STRUCT {
307
307
  array_T* statements;
308
308
  } AST_ERB_IN_NODE_T;
309
309
 
310
- AST_DOCUMENT_NODE_T* ast_document_node_init(array_T* children, position_T* start_position, position_T* end_position, array_T* errors);
311
- AST_LITERAL_NODE_T* ast_literal_node_init(const char* content, position_T* start_position, position_T* end_position, array_T* errors);
312
- AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, token_T* tag_name, token_T* tag_closing, array_T* children, bool is_void, position_T* start_position, position_T* end_position, array_T* errors);
313
- AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, token_T* tag_name, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors);
314
- AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag, token_T* tag_name, 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, array_T* errors);
315
- AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* open_quote, array_T* children, token_T* close_quote, bool quoted, position_T* start_position, position_T* end_position, array_T* errors);
316
- AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(array_T* children, position_T* start_position, position_T* end_position, array_T* errors);
317
- 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, array_T* errors);
318
- AST_HTML_TEXT_NODE_T* ast_html_text_node_init(const char* content, position_T* start_position, position_T* end_position, array_T* errors);
319
- AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, array_T* children, token_T* comment_end, position_T* start_position, position_T* end_position, array_T* errors);
320
- AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors);
321
- AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors);
322
- AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T* start_position, position_T* end_position, array_T* errors);
323
- AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T* start_position, position_T* end_position, array_T* errors);
324
- 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, array_T* errors);
325
- 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, array_T* errors);
326
- AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors);
327
- AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_NODE_STRUCT* subsequent, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors);
328
- AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* body, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors);
329
- AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors);
330
- AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors);
331
- AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors);
332
- AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors);
333
- AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors);
334
- AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T* start_position, position_T* end_position, array_T* errors);
335
- AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* subsequent, position_T* start_position, position_T* end_position, array_T* errors);
336
- AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors);
337
- AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors);
338
- AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors);
339
- 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, array_T* errors);
340
- AST_ERB_IN_NODE_T* ast_erb_in_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T* start_position, position_T* end_position, array_T* errors);
310
+ AST_DOCUMENT_NODE_T* ast_document_node_init(array_T* children, position_T start_position, position_T end_position, array_T* errors);
311
+ AST_LITERAL_NODE_T* ast_literal_node_init(const char* content, position_T start_position, position_T end_position, array_T* errors);
312
+ AST_HTML_OPEN_TAG_NODE_T* ast_html_open_tag_node_init(token_T* tag_opening, token_T* tag_name, token_T* tag_closing, array_T* children, bool is_void, position_T start_position, position_T end_position, array_T* errors);
313
+ AST_HTML_CLOSE_TAG_NODE_T* ast_html_close_tag_node_init(token_T* tag_opening, token_T* tag_name, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors);
314
+ AST_HTML_ELEMENT_NODE_T* ast_html_element_node_init(struct AST_HTML_OPEN_TAG_NODE_STRUCT* open_tag, token_T* tag_name, 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, array_T* errors);
315
+ AST_HTML_ATTRIBUTE_VALUE_NODE_T* ast_html_attribute_value_node_init(token_T* open_quote, array_T* children, token_T* close_quote, bool quoted, position_T start_position, position_T end_position, array_T* errors);
316
+ AST_HTML_ATTRIBUTE_NAME_NODE_T* ast_html_attribute_name_node_init(array_T* children, position_T start_position, position_T end_position, array_T* errors);
317
+ 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, array_T* errors);
318
+ AST_HTML_TEXT_NODE_T* ast_html_text_node_init(const char* content, position_T start_position, position_T end_position, array_T* errors);
319
+ AST_HTML_COMMENT_NODE_T* ast_html_comment_node_init(token_T* comment_start, array_T* children, token_T* comment_end, position_T start_position, position_T end_position, array_T* errors);
320
+ AST_HTML_DOCTYPE_NODE_T* ast_html_doctype_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors);
321
+ AST_XML_DECLARATION_NODE_T* ast_xml_declaration_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors);
322
+ AST_CDATA_NODE_T* ast_cdata_node_init(token_T* tag_opening, array_T* children, token_T* tag_closing, position_T start_position, position_T end_position, array_T* errors);
323
+ AST_WHITESPACE_NODE_T* ast_whitespace_node_init(token_T* value, position_T start_position, position_T end_position, array_T* errors);
324
+ 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, array_T* errors);
325
+ 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, array_T* errors);
326
+ AST_ERB_ELSE_NODE_T* ast_erb_else_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors);
327
+ AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_NODE_STRUCT* subsequent, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors);
328
+ AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* body, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors);
329
+ AST_ERB_WHEN_NODE_T* ast_erb_when_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors);
330
+ AST_ERB_CASE_NODE_T* ast_erb_case_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors);
331
+ AST_ERB_CASE_MATCH_NODE_T* ast_erb_case_match_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* children, 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, array_T* errors);
332
+ AST_ERB_WHILE_NODE_T* ast_erb_while_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors);
333
+ AST_ERB_UNTIL_NODE_T* ast_erb_until_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors);
334
+ AST_ERB_FOR_NODE_T* ast_erb_for_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_END_NODE_STRUCT* end_node, position_T start_position, position_T end_position, array_T* errors);
335
+ AST_ERB_RESCUE_NODE_T* ast_erb_rescue_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, struct AST_ERB_RESCUE_NODE_STRUCT* subsequent, position_T start_position, position_T end_position, array_T* errors);
336
+ AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors);
337
+ AST_ERB_BEGIN_NODE_T* ast_erb_begin_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors);
338
+ AST_ERB_UNLESS_NODE_T* ast_erb_unless_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, 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, array_T* errors);
339
+ 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, array_T* errors);
340
+ AST_ERB_IN_NODE_T* ast_erb_in_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, array_T* statements, position_T start_position, position_T end_position, array_T* errors);
341
341
 
342
342
  const char* ast_node_type_to_string(AST_NODE_T* node);
343
343
  const char* ast_node_human_type(AST_NODE_T* node);
@@ -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.7.4/templates/src/ast_pretty_print.c.erb
2
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.7.5/templates/src/ast_pretty_print.c.erb
3
3
 
4
4
  #include "include/ast_node.h"
5
5
  #include "include/ast_nodes.h"
@@ -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.7.4/templates/src/include/ast_pretty_print.h.erb
2
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.7.5/templates/src/include/ast_pretty_print.h.erb
3
3
 
4
4
  #ifndef HERB_AST_PRETTY_PRINT_H
5
5
  #define HERB_AST_PRETTY_PRINT_H
@@ -114,7 +114,16 @@ bool buffer_expand_capacity(buffer_T* buffer) {
114
114
  bool buffer_expand_if_needed(buffer_T* buffer, const size_t required_length) {
115
115
  if (buffer_has_capacity(buffer, required_length)) { return true; }
116
116
 
117
- return buffer_resize(buffer, buffer->capacity + (required_length * 2));
117
+ bool should_double_capacity = required_length < buffer->capacity;
118
+ size_t new_capacity = 0;
119
+
120
+ if (should_double_capacity) {
121
+ new_capacity = buffer->capacity * 2;
122
+ } else {
123
+ new_capacity = buffer->capacity + (required_length * 2);
124
+ }
125
+
126
+ return buffer_resize(buffer, new_capacity);
118
127
  }
119
128
 
120
129
  /**