herb 0.8.10-arm-linux-gnu → 0.9.0-arm-linux-gnu
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.
- checksums.yaml +4 -4
- data/Makefile +11 -3
- data/README.md +64 -34
- data/Rakefile +48 -40
- data/config.yml +317 -34
- data/ext/herb/error_helpers.c +367 -140
- data/ext/herb/error_helpers.h +1 -0
- data/ext/herb/extconf.rb +67 -28
- data/ext/herb/extension.c +317 -51
- data/ext/herb/extension.h +1 -0
- data/ext/herb/extension_helpers.c +23 -14
- data/ext/herb/extension_helpers.h +2 -2
- data/ext/herb/nodes.c +537 -270
- data/ext/herb/nodes.h +1 -0
- data/herb.gemspec +3 -2
- data/lib/herb/3.0/herb.so +0 -0
- data/lib/herb/3.1/herb.so +0 -0
- data/lib/herb/3.2/herb.so +0 -0
- data/lib/herb/3.3/herb.so +0 -0
- data/lib/herb/3.4/herb.so +0 -0
- data/lib/herb/4.0/herb.so +0 -0
- data/lib/herb/ast/helpers.rb +3 -3
- data/lib/herb/ast/node.rb +15 -2
- data/lib/herb/ast/nodes.rb +1132 -157
- data/lib/herb/bootstrap.rb +87 -0
- data/lib/herb/cli.rb +341 -31
- data/lib/herb/configuration.rb +248 -0
- data/lib/herb/defaults.yml +32 -0
- data/lib/herb/engine/compiler.rb +78 -11
- data/lib/herb/engine/debug_visitor.rb +13 -3
- data/lib/herb/engine/error_formatter.rb +13 -9
- data/lib/herb/engine/parser_error_overlay.rb +10 -6
- data/lib/herb/engine/validator.rb +8 -3
- data/lib/herb/engine/validators/nesting_validator.rb +2 -2
- data/lib/herb/engine.rb +82 -35
- data/lib/herb/errors.rb +563 -88
- data/lib/herb/lex_result.rb +1 -0
- data/lib/herb/location.rb +7 -3
- data/lib/herb/parse_result.rb +12 -2
- data/lib/herb/parser_options.rb +57 -0
- data/lib/herb/position.rb +1 -0
- data/lib/herb/prism_inspect.rb +116 -0
- data/lib/herb/project.rb +923 -331
- data/lib/herb/range.rb +1 -0
- data/lib/herb/token.rb +7 -1
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor.rb +37 -2
- data/lib/herb/warnings.rb +6 -1
- data/lib/herb.rb +35 -3
- data/sig/herb/ast/helpers.rbs +2 -2
- data/sig/herb/ast/node.rbs +12 -2
- data/sig/herb/ast/nodes.rbs +641 -128
- data/sig/herb/bootstrap.rbs +31 -0
- data/sig/herb/configuration.rbs +89 -0
- data/sig/herb/engine/compiler.rbs +9 -1
- data/sig/herb/engine/debug_visitor.rbs +2 -0
- data/sig/herb/engine/validator.rbs +5 -1
- data/sig/herb/engine.rbs +17 -3
- data/sig/herb/errors.rbs +258 -63
- data/sig/herb/location.rbs +4 -0
- data/sig/herb/parse_result.rbs +4 -2
- data/sig/herb/parser_options.rbs +42 -0
- data/sig/herb/position.rbs +1 -0
- data/sig/herb/prism_inspect.rbs +28 -0
- data/sig/herb/range.rbs +1 -0
- data/sig/herb/token.rbs +6 -0
- data/sig/herb/visitor.rbs +25 -4
- data/sig/herb/warnings.rbs +6 -1
- data/sig/herb.rbs +14 -0
- data/sig/herb_c_extension.rbs +5 -2
- data/sig/serialized_ast_errors.rbs +54 -6
- data/sig/serialized_ast_nodes.rbs +60 -6
- data/src/analyze/action_view/attribute_extraction_helpers.c +290 -0
- data/src/analyze/action_view/content_tag.c +70 -0
- data/src/analyze/action_view/link_to.c +143 -0
- data/src/analyze/action_view/registry.c +60 -0
- data/src/analyze/action_view/tag.c +64 -0
- data/src/analyze/action_view/tag_helper_node_builders.c +305 -0
- data/src/analyze/action_view/tag_helpers.c +748 -0
- data/src/analyze/action_view/turbo_frame_tag.c +88 -0
- data/src/analyze/analyze.c +882 -0
- data/src/{analyzed_ruby.c → analyze/analyzed_ruby.c} +13 -11
- data/src/analyze/builders.c +343 -0
- data/src/analyze/conditional_elements.c +594 -0
- data/src/analyze/conditional_open_tags.c +640 -0
- data/src/analyze/control_type.c +250 -0
- data/src/{analyze_helpers.c → analyze/helpers.c} +48 -23
- data/src/analyze/invalid_structures.c +193 -0
- data/src/{analyze_missing_end.c → analyze/missing_end.c} +33 -22
- data/src/analyze/parse_errors.c +84 -0
- data/src/analyze/prism_annotate.c +397 -0
- data/src/{analyze_transform.c → analyze/transform.c} +17 -3
- data/src/ast_node.c +17 -7
- data/src/ast_nodes.c +662 -387
- data/src/ast_pretty_print.c +190 -6
- data/src/errors.c +1076 -520
- data/src/extract.c +145 -49
- data/src/herb.c +52 -34
- data/src/html_util.c +241 -12
- data/src/include/analyze/action_view/attribute_extraction_helpers.h +36 -0
- data/src/include/analyze/action_view/tag_helper_handler.h +41 -0
- data/src/include/analyze/action_view/tag_helper_node_builders.h +70 -0
- data/src/include/analyze/action_view/tag_helpers.h +38 -0
- data/src/include/{analyze.h → analyze/analyze.h} +14 -4
- data/src/include/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
- data/src/include/analyze/builders.h +27 -0
- data/src/include/analyze/conditional_elements.h +9 -0
- data/src/include/analyze/conditional_open_tags.h +9 -0
- data/src/include/analyze/control_type.h +14 -0
- data/src/include/{analyze_helpers.h → analyze/helpers.h} +4 -2
- data/src/include/analyze/invalid_structures.h +11 -0
- data/src/include/analyze/prism_annotate.h +16 -0
- data/src/include/ast_node.h +11 -5
- data/src/include/ast_nodes.h +117 -38
- data/src/include/ast_pretty_print.h +5 -0
- data/src/include/element_source.h +3 -8
- data/src/include/errors.h +148 -55
- data/src/include/extract.h +21 -5
- data/src/include/herb.h +18 -6
- data/src/include/herb_prism_node.h +13 -0
- data/src/include/html_util.h +7 -2
- data/src/include/io.h +3 -1
- data/src/include/lex_helpers.h +29 -0
- data/src/include/lexer.h +1 -1
- data/src/include/lexer_peek_helpers.h +87 -13
- data/src/include/lexer_struct.h +2 -0
- data/src/include/location.h +2 -1
- data/src/include/parser.h +27 -2
- data/src/include/parser_helpers.h +19 -3
- data/src/include/pretty_print.h +10 -5
- data/src/include/prism_context.h +45 -0
- data/src/include/prism_helpers.h +10 -7
- data/src/include/prism_serialized.h +12 -0
- data/src/include/token.h +16 -4
- data/src/include/token_struct.h +10 -3
- data/src/include/utf8.h +2 -1
- data/src/include/util/hb_allocator.h +78 -0
- data/src/include/util/hb_arena.h +6 -1
- data/src/include/util/hb_arena_debug.h +12 -1
- data/src/include/util/hb_array.h +7 -3
- data/src/include/util/hb_buffer.h +6 -4
- data/src/include/util/hb_foreach.h +79 -0
- data/src/include/util/hb_narray.h +8 -4
- data/src/include/util/hb_string.h +56 -9
- data/src/include/util.h +6 -3
- data/src/include/version.h +1 -1
- data/src/io.c +3 -2
- data/src/lexer.c +42 -30
- data/src/lexer_peek_helpers.c +12 -74
- data/src/location.c +2 -2
- data/src/main.c +53 -28
- data/src/parser.c +783 -247
- data/src/parser_helpers.c +110 -23
- data/src/parser_match_tags.c +109 -48
- data/src/pretty_print.c +29 -24
- data/src/prism_helpers.c +30 -27
- data/src/ruby_parser.c +2 -0
- data/src/token.c +151 -66
- data/src/token_matchers.c +0 -1
- data/src/utf8.c +7 -6
- data/src/util/hb_allocator.c +341 -0
- data/src/util/hb_arena.c +81 -56
- data/src/util/hb_arena_debug.c +32 -17
- data/src/util/hb_array.c +30 -15
- data/src/util/hb_buffer.c +17 -21
- data/src/util/hb_narray.c +22 -7
- data/src/util/hb_string.c +49 -35
- data/src/util.c +21 -11
- data/src/visitor.c +47 -0
- data/templates/ext/herb/error_helpers.c.erb +24 -11
- data/templates/ext/herb/error_helpers.h.erb +1 -0
- data/templates/ext/herb/nodes.c.erb +50 -16
- data/templates/ext/herb/nodes.h.erb +1 -0
- data/templates/java/error_helpers.c.erb +1 -1
- data/templates/java/nodes.c.erb +30 -8
- data/templates/java/org/herb/ast/Errors.java.erb +24 -1
- data/templates/java/org/herb/ast/Nodes.java.erb +80 -21
- data/templates/javascript/packages/core/src/errors.ts.erb +16 -3
- data/templates/javascript/packages/core/src/node-type-guards.ts.erb +3 -1
- data/templates/javascript/packages/core/src/nodes.ts.erb +109 -32
- data/templates/javascript/packages/node/extension/error_helpers.cpp.erb +13 -4
- data/templates/javascript/packages/node/extension/nodes.cpp.erb +43 -4
- data/templates/lib/herb/ast/nodes.rb.erb +88 -31
- data/templates/lib/herb/errors.rb.erb +15 -3
- data/templates/lib/herb/visitor.rb.erb +2 -2
- data/templates/rust/src/ast/nodes.rs.erb +97 -44
- data/templates/rust/src/errors.rs.erb +2 -1
- data/templates/rust/src/nodes.rs.erb +167 -15
- data/templates/rust/src/union_types.rs.erb +60 -0
- data/templates/rust/src/visitor.rs.erb +81 -0
- data/templates/src/{analyze_missing_end.c.erb → analyze/missing_end.c.erb} +9 -6
- data/templates/src/{analyze_transform.c.erb → analyze/transform.c.erb} +2 -2
- data/templates/src/ast_nodes.c.erb +34 -26
- data/templates/src/ast_pretty_print.c.erb +24 -5
- data/templates/src/errors.c.erb +60 -54
- data/templates/src/include/ast_nodes.h.erb +6 -2
- data/templates/src/include/ast_pretty_print.h.erb +5 -0
- data/templates/src/include/errors.h.erb +15 -11
- data/templates/src/include/util/hb_foreach.h.erb +20 -0
- data/templates/src/parser_match_tags.c.erb +10 -4
- data/templates/src/visitor.c.erb +2 -2
- data/templates/template.rb +204 -29
- data/templates/wasm/error_helpers.cpp.erb +9 -5
- data/templates/wasm/nodes.cpp.erb +41 -4
- metadata +57 -16
- data/src/analyze.c +0 -1608
- data/src/element_source.c +0 -12
- data/src/include/util/hb_system.h +0 -9
- data/src/util/hb_system.c +0 -30
data/src/ast_pretty_print.c
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
2
|
// be modified manually. See /home/runner/work/herb/herb/templates/src/ast_pretty_print.c.erb
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#ifdef HERB_EXCLUDE_PRETTYPRINT
|
|
5
|
+
// Pretty print support excluded
|
|
6
|
+
#else
|
|
7
|
+
|
|
8
|
+
#include "include/analyze/helpers.h"
|
|
5
9
|
#include "include/ast_node.h"
|
|
6
10
|
#include "include/ast_nodes.h"
|
|
7
11
|
#include "include/errors.h"
|
|
@@ -32,14 +36,19 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
32
36
|
const AST_DOCUMENT_NODE_T* document_node = (AST_DOCUMENT_NODE_T*) node;
|
|
33
37
|
|
|
34
38
|
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
35
|
-
pretty_print_array(hb_string("children"), document_node->children, indent, relative_indent,
|
|
39
|
+
pretty_print_array(hb_string("children"), document_node->children, indent, relative_indent, false, buffer);
|
|
40
|
+
/* prism_context is internal state, not pretty printed */
|
|
41
|
+
if (document_node->prism_node.node != NULL) {
|
|
42
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, true, buffer);
|
|
43
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
44
|
+
}
|
|
36
45
|
} break;
|
|
37
46
|
|
|
38
47
|
case AST_LITERAL_NODE: {
|
|
39
48
|
const AST_LITERAL_NODE_T* literal_node = (AST_LITERAL_NODE_T*) node;
|
|
40
49
|
|
|
41
50
|
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
42
|
-
pretty_print_string_property(
|
|
51
|
+
pretty_print_string_property(literal_node->content, hb_string("content"), indent, relative_indent, true, buffer);
|
|
43
52
|
} break;
|
|
44
53
|
|
|
45
54
|
case AST_HTML_OPEN_TAG_NODE: {
|
|
@@ -53,6 +62,29 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
53
62
|
pretty_print_boolean_property(hb_string("is_void"), html_open_tag_node->is_void, indent, relative_indent, true, buffer);
|
|
54
63
|
} break;
|
|
55
64
|
|
|
65
|
+
case AST_HTML_CONDITIONAL_OPEN_TAG_NODE: {
|
|
66
|
+
const AST_HTML_CONDITIONAL_OPEN_TAG_NODE_T* html_conditional_open_tag_node = (AST_HTML_CONDITIONAL_OPEN_TAG_NODE_T*) node;
|
|
67
|
+
|
|
68
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
69
|
+
|
|
70
|
+
pretty_print_label(hb_string("conditional"), indent, relative_indent, false, buffer);
|
|
71
|
+
|
|
72
|
+
if (html_conditional_open_tag_node->conditional) {
|
|
73
|
+
hb_buffer_append(buffer, "\n");
|
|
74
|
+
pretty_print_indent(buffer, indent);
|
|
75
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
76
|
+
|
|
77
|
+
hb_buffer_append(buffer, "└── ");
|
|
78
|
+
ast_pretty_print_node((AST_NODE_T*) html_conditional_open_tag_node->conditional, indent, relative_indent + 2, buffer);
|
|
79
|
+
} else {
|
|
80
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
81
|
+
}
|
|
82
|
+
hb_buffer_append(buffer, "\n");
|
|
83
|
+
|
|
84
|
+
pretty_print_token_property(html_conditional_open_tag_node->tag_name, hb_string("tag_name"), indent, relative_indent, false, buffer);
|
|
85
|
+
pretty_print_boolean_property(hb_string("is_void"), html_conditional_open_tag_node->is_void, indent, relative_indent, true, buffer);
|
|
86
|
+
} break;
|
|
87
|
+
|
|
56
88
|
case AST_HTML_CLOSE_TAG_NODE: {
|
|
57
89
|
const AST_HTML_CLOSE_TAG_NODE_T* html_close_tag_node = (AST_HTML_CLOSE_TAG_NODE_T*) node;
|
|
58
90
|
|
|
@@ -63,6 +95,20 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
63
95
|
pretty_print_token_property(html_close_tag_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, true, buffer);
|
|
64
96
|
} break;
|
|
65
97
|
|
|
98
|
+
case AST_HTML_OMITTED_CLOSE_TAG_NODE: {
|
|
99
|
+
const AST_HTML_OMITTED_CLOSE_TAG_NODE_T* html_omitted_close_tag_node = (AST_HTML_OMITTED_CLOSE_TAG_NODE_T*) node;
|
|
100
|
+
|
|
101
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
102
|
+
pretty_print_token_property(html_omitted_close_tag_node->tag_name, hb_string("tag_name"), indent, relative_indent, true, buffer);
|
|
103
|
+
} break;
|
|
104
|
+
|
|
105
|
+
case AST_HTML_VIRTUAL_CLOSE_TAG_NODE: {
|
|
106
|
+
const AST_HTML_VIRTUAL_CLOSE_TAG_NODE_T* html_virtual_close_tag_node = (AST_HTML_VIRTUAL_CLOSE_TAG_NODE_T*) node;
|
|
107
|
+
|
|
108
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
109
|
+
pretty_print_token_property(html_virtual_close_tag_node->tag_name, hb_string("tag_name"), indent, relative_indent, true, buffer);
|
|
110
|
+
} break;
|
|
111
|
+
|
|
66
112
|
case AST_HTML_ELEMENT_NODE: {
|
|
67
113
|
const AST_HTML_ELEMENT_NODE_T* html_element_node = (AST_HTML_ELEMENT_NODE_T*) node;
|
|
68
114
|
|
|
@@ -100,7 +146,77 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
100
146
|
hb_buffer_append(buffer, "\n");
|
|
101
147
|
|
|
102
148
|
pretty_print_boolean_property(hb_string("is_void"), html_element_node->is_void, indent, relative_indent, false, buffer);
|
|
103
|
-
pretty_print_string_property(
|
|
149
|
+
pretty_print_string_property(html_element_node->element_source, hb_string("element_source"), indent, relative_indent, true, buffer);
|
|
150
|
+
} break;
|
|
151
|
+
|
|
152
|
+
case AST_HTML_CONDITIONAL_ELEMENT_NODE: {
|
|
153
|
+
const AST_HTML_CONDITIONAL_ELEMENT_NODE_T* html_conditional_element_node = (AST_HTML_CONDITIONAL_ELEMENT_NODE_T*) node;
|
|
154
|
+
|
|
155
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
156
|
+
pretty_print_string_property(html_conditional_element_node->condition, hb_string("condition"), indent, relative_indent, false, buffer);
|
|
157
|
+
|
|
158
|
+
pretty_print_label(hb_string("open_conditional"), indent, relative_indent, false, buffer);
|
|
159
|
+
|
|
160
|
+
if (html_conditional_element_node->open_conditional) {
|
|
161
|
+
hb_buffer_append(buffer, "\n");
|
|
162
|
+
pretty_print_indent(buffer, indent);
|
|
163
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
164
|
+
|
|
165
|
+
hb_buffer_append(buffer, "└── ");
|
|
166
|
+
ast_pretty_print_node((AST_NODE_T*) html_conditional_element_node->open_conditional, indent, relative_indent + 2, buffer);
|
|
167
|
+
} else {
|
|
168
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
169
|
+
}
|
|
170
|
+
hb_buffer_append(buffer, "\n");
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
pretty_print_label(hb_string("open_tag"), indent, relative_indent, false, buffer);
|
|
174
|
+
|
|
175
|
+
if (html_conditional_element_node->open_tag) {
|
|
176
|
+
hb_buffer_append(buffer, "\n");
|
|
177
|
+
pretty_print_indent(buffer, indent);
|
|
178
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
179
|
+
|
|
180
|
+
hb_buffer_append(buffer, "└── ");
|
|
181
|
+
ast_pretty_print_node((AST_NODE_T*) html_conditional_element_node->open_tag, indent, relative_indent + 2, buffer);
|
|
182
|
+
} else {
|
|
183
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
184
|
+
}
|
|
185
|
+
hb_buffer_append(buffer, "\n");
|
|
186
|
+
|
|
187
|
+
pretty_print_array(hb_string("body"), html_conditional_element_node->body, indent, relative_indent, false, buffer);
|
|
188
|
+
|
|
189
|
+
pretty_print_label(hb_string("close_tag"), indent, relative_indent, false, buffer);
|
|
190
|
+
|
|
191
|
+
if (html_conditional_element_node->close_tag) {
|
|
192
|
+
hb_buffer_append(buffer, "\n");
|
|
193
|
+
pretty_print_indent(buffer, indent);
|
|
194
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
195
|
+
|
|
196
|
+
hb_buffer_append(buffer, "└── ");
|
|
197
|
+
ast_pretty_print_node((AST_NODE_T*) html_conditional_element_node->close_tag, indent, relative_indent + 2, buffer);
|
|
198
|
+
} else {
|
|
199
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
200
|
+
}
|
|
201
|
+
hb_buffer_append(buffer, "\n");
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
pretty_print_label(hb_string("close_conditional"), indent, relative_indent, false, buffer);
|
|
205
|
+
|
|
206
|
+
if (html_conditional_element_node->close_conditional) {
|
|
207
|
+
hb_buffer_append(buffer, "\n");
|
|
208
|
+
pretty_print_indent(buffer, indent);
|
|
209
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
210
|
+
|
|
211
|
+
hb_buffer_append(buffer, "└── ");
|
|
212
|
+
ast_pretty_print_node((AST_NODE_T*) html_conditional_element_node->close_conditional, indent, relative_indent + 2, buffer);
|
|
213
|
+
} else {
|
|
214
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
215
|
+
}
|
|
216
|
+
hb_buffer_append(buffer, "\n");
|
|
217
|
+
|
|
218
|
+
pretty_print_token_property(html_conditional_element_node->tag_name, hb_string("tag_name"), indent, relative_indent, false, buffer);
|
|
219
|
+
pretty_print_string_property(html_conditional_element_node->element_source, hb_string("element_source"), indent, relative_indent, true, buffer);
|
|
104
220
|
} break;
|
|
105
221
|
|
|
106
222
|
case AST_HTML_ATTRIBUTE_VALUE_NODE: {
|
|
@@ -157,11 +273,37 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
157
273
|
|
|
158
274
|
} break;
|
|
159
275
|
|
|
276
|
+
case AST_RUBY_LITERAL_NODE: {
|
|
277
|
+
const AST_RUBY_LITERAL_NODE_T* ruby_literal_node = (AST_RUBY_LITERAL_NODE_T*) node;
|
|
278
|
+
|
|
279
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
280
|
+
pretty_print_string_property(ruby_literal_node->content, hb_string("content"), indent, relative_indent, true, buffer);
|
|
281
|
+
} break;
|
|
282
|
+
|
|
283
|
+
case AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE: {
|
|
284
|
+
const AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE_T* ruby_html_attributes_splat_node = (AST_RUBY_HTML_ATTRIBUTES_SPLAT_NODE_T*) node;
|
|
285
|
+
|
|
286
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
287
|
+
pretty_print_string_property(ruby_html_attributes_splat_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
288
|
+
pretty_print_string_property(ruby_html_attributes_splat_node->prefix, hb_string("prefix"), indent, relative_indent, true, buffer);
|
|
289
|
+
} break;
|
|
290
|
+
|
|
291
|
+
case AST_ERB_OPEN_TAG_NODE: {
|
|
292
|
+
const AST_ERB_OPEN_TAG_NODE_T* erb_open_tag_node = (AST_ERB_OPEN_TAG_NODE_T*) node;
|
|
293
|
+
|
|
294
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
295
|
+
pretty_print_token_property(erb_open_tag_node->tag_opening, hb_string("tag_opening"), indent, relative_indent, false, buffer);
|
|
296
|
+
pretty_print_token_property(erb_open_tag_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
297
|
+
pretty_print_token_property(erb_open_tag_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
298
|
+
pretty_print_token_property(erb_open_tag_node->tag_name, hb_string("tag_name"), indent, relative_indent, false, buffer);
|
|
299
|
+
pretty_print_array(hb_string("children"), erb_open_tag_node->children, indent, relative_indent, true, buffer);
|
|
300
|
+
} break;
|
|
301
|
+
|
|
160
302
|
case AST_HTML_TEXT_NODE: {
|
|
161
303
|
const AST_HTML_TEXT_NODE_T* html_text_node = (AST_HTML_TEXT_NODE_T*) node;
|
|
162
304
|
|
|
163
305
|
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
164
|
-
pretty_print_string_property(
|
|
306
|
+
pretty_print_string_property(html_text_node->content, hb_string("content"), indent, relative_indent, true, buffer);
|
|
165
307
|
} break;
|
|
166
308
|
|
|
167
309
|
case AST_HTML_COMMENT_NODE: {
|
|
@@ -236,7 +378,11 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
236
378
|
}
|
|
237
379
|
|
|
238
380
|
pretty_print_boolean_property(hb_string("parsed"), erb_content_node->parsed, indent, relative_indent, false, buffer);
|
|
239
|
-
pretty_print_boolean_property(hb_string("valid"), erb_content_node->valid, indent, relative_indent,
|
|
381
|
+
pretty_print_boolean_property(hb_string("valid"), erb_content_node->valid, indent, relative_indent, false, buffer);
|
|
382
|
+
if (erb_content_node->prism_node.node != NULL) {
|
|
383
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, true, buffer);
|
|
384
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
385
|
+
}
|
|
240
386
|
} break;
|
|
241
387
|
|
|
242
388
|
case AST_ERB_END_NODE: {
|
|
@@ -278,6 +424,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
278
424
|
hb_buffer_append(buffer, " ∅\n");
|
|
279
425
|
}
|
|
280
426
|
|
|
427
|
+
if (erb_if_node->prism_node.node != NULL) {
|
|
428
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
429
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
430
|
+
}
|
|
281
431
|
pretty_print_array(hb_string("statements"), erb_if_node->statements, indent, relative_indent, false, buffer);
|
|
282
432
|
|
|
283
433
|
pretty_print_label(hb_string("subsequent"), indent, relative_indent, false, buffer);
|
|
@@ -318,6 +468,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
318
468
|
pretty_print_token_property(erb_block_node->tag_opening, hb_string("tag_opening"), indent, relative_indent, false, buffer);
|
|
319
469
|
pretty_print_token_property(erb_block_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
320
470
|
pretty_print_token_property(erb_block_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
471
|
+
if (erb_block_node->prism_node.node != NULL) {
|
|
472
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
473
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
474
|
+
}
|
|
321
475
|
pretty_print_array(hb_string("body"), erb_block_node->body, indent, relative_indent, false, buffer);
|
|
322
476
|
|
|
323
477
|
pretty_print_label(hb_string("end_node"), indent, relative_indent, true, buffer);
|
|
@@ -367,6 +521,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
367
521
|
pretty_print_token_property(erb_case_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
368
522
|
pretty_print_token_property(erb_case_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
369
523
|
pretty_print_array(hb_string("children"), erb_case_node->children, indent, relative_indent, false, buffer);
|
|
524
|
+
if (erb_case_node->prism_node.node != NULL) {
|
|
525
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
526
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
527
|
+
}
|
|
370
528
|
pretty_print_array(hb_string("conditions"), erb_case_node->conditions, indent, relative_indent, false, buffer);
|
|
371
529
|
|
|
372
530
|
pretty_print_label(hb_string("else_clause"), indent, relative_indent, false, buffer);
|
|
@@ -408,6 +566,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
408
566
|
pretty_print_token_property(erb_case_match_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
409
567
|
pretty_print_token_property(erb_case_match_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
410
568
|
pretty_print_array(hb_string("children"), erb_case_match_node->children, indent, relative_indent, false, buffer);
|
|
569
|
+
if (erb_case_match_node->prism_node.node != NULL) {
|
|
570
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
571
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
572
|
+
}
|
|
411
573
|
pretty_print_array(hb_string("conditions"), erb_case_match_node->conditions, indent, relative_indent, false, buffer);
|
|
412
574
|
|
|
413
575
|
pretty_print_label(hb_string("else_clause"), indent, relative_indent, false, buffer);
|
|
@@ -448,6 +610,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
448
610
|
pretty_print_token_property(erb_while_node->tag_opening, hb_string("tag_opening"), indent, relative_indent, false, buffer);
|
|
449
611
|
pretty_print_token_property(erb_while_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
450
612
|
pretty_print_token_property(erb_while_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
613
|
+
if (erb_while_node->prism_node.node != NULL) {
|
|
614
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
615
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
616
|
+
}
|
|
451
617
|
pretty_print_array(hb_string("statements"), erb_while_node->statements, indent, relative_indent, false, buffer);
|
|
452
618
|
|
|
453
619
|
pretty_print_label(hb_string("end_node"), indent, relative_indent, true, buffer);
|
|
@@ -473,6 +639,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
473
639
|
pretty_print_token_property(erb_until_node->tag_opening, hb_string("tag_opening"), indent, relative_indent, false, buffer);
|
|
474
640
|
pretty_print_token_property(erb_until_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
475
641
|
pretty_print_token_property(erb_until_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
642
|
+
if (erb_until_node->prism_node.node != NULL) {
|
|
643
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
644
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
645
|
+
}
|
|
476
646
|
pretty_print_array(hb_string("statements"), erb_until_node->statements, indent, relative_indent, false, buffer);
|
|
477
647
|
|
|
478
648
|
pretty_print_label(hb_string("end_node"), indent, relative_indent, true, buffer);
|
|
@@ -498,6 +668,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
498
668
|
pretty_print_token_property(erb_for_node->tag_opening, hb_string("tag_opening"), indent, relative_indent, false, buffer);
|
|
499
669
|
pretty_print_token_property(erb_for_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
500
670
|
pretty_print_token_property(erb_for_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
671
|
+
if (erb_for_node->prism_node.node != NULL) {
|
|
672
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
673
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
674
|
+
}
|
|
501
675
|
pretty_print_array(hb_string("statements"), erb_for_node->statements, indent, relative_indent, false, buffer);
|
|
502
676
|
|
|
503
677
|
pretty_print_label(hb_string("end_node"), indent, relative_indent, true, buffer);
|
|
@@ -558,6 +732,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
558
732
|
pretty_print_token_property(erb_begin_node->tag_opening, hb_string("tag_opening"), indent, relative_indent, false, buffer);
|
|
559
733
|
pretty_print_token_property(erb_begin_node->content, hb_string("content"), indent, relative_indent, false, buffer);
|
|
560
734
|
pretty_print_token_property(erb_begin_node->tag_closing, hb_string("tag_closing"), indent, relative_indent, false, buffer);
|
|
735
|
+
if (erb_begin_node->prism_node.node != NULL) {
|
|
736
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
737
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
738
|
+
}
|
|
561
739
|
pretty_print_array(hb_string("statements"), erb_begin_node->statements, indent, relative_indent, false, buffer);
|
|
562
740
|
|
|
563
741
|
pretty_print_label(hb_string("rescue_clause"), indent, relative_indent, false, buffer);
|
|
@@ -641,6 +819,10 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
641
819
|
hb_buffer_append(buffer, " ∅\n");
|
|
642
820
|
}
|
|
643
821
|
|
|
822
|
+
if (erb_unless_node->prism_node.node != NULL) {
|
|
823
|
+
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
824
|
+
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
825
|
+
}
|
|
644
826
|
pretty_print_array(hb_string("statements"), erb_unless_node->statements, indent, relative_indent, false, buffer);
|
|
645
827
|
|
|
646
828
|
pretty_print_label(hb_string("else_clause"), indent, relative_indent, false, buffer);
|
|
@@ -708,3 +890,5 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
708
890
|
|
|
709
891
|
}
|
|
710
892
|
}
|
|
893
|
+
|
|
894
|
+
#endif
|