herb 0.9.4-aarch64-linux-gnu → 0.9.5-aarch64-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/config.yml +57 -21
- data/ext/herb/nodes.c +93 -55
- 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/nodes.rb +212 -78
- data/lib/herb/engine/compiler.rb +4 -6
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor.rb +8 -2
- data/sig/herb/ast/nodes.rbs +85 -34
- data/sig/herb/visitor.rbs +5 -2
- data/sig/serialized_ast_nodes.rbs +20 -9
- data/src/analyze/action_view/javascript_tag.c +38 -0
- data/src/analyze/action_view/tag_helper_node_builders.c +23 -2
- data/src/analyze/action_view/tag_helpers.c +53 -14
- data/src/analyze/analyze.c +21 -0
- data/src/analyze/analyze_helpers.c +406 -0
- data/src/analyze/builders.c +1 -0
- data/src/analyze/missing_end.c +16 -0
- data/src/analyze/parse_errors.c +3 -2
- data/src/analyze/render_nodes.c +231 -35
- data/src/analyze/strict_locals.c +22 -338
- data/src/analyze/transform.c +23 -2
- data/src/ast/ast_nodes.c +114 -57
- data/src/ast/ast_pretty_print.c +109 -25
- data/src/include/analyze/action_view/tag_helper_handler.h +3 -0
- data/src/include/analyze/action_view/tag_helper_node_builders.h +7 -0
- data/src/include/analyze/helpers.h +18 -0
- data/src/include/ast/ast_nodes.h +27 -13
- data/src/include/version.h +1 -1
- data/src/parser/match_tags.c +37 -6
- data/src/parser.c +8 -0
- data/src/visitor.c +50 -7
- metadata +1 -1
data/src/ast/ast_nodes.c
CHANGED
|
@@ -376,7 +376,7 @@ AST_ERB_IF_NODE_T* ast_erb_if_node_init(token_T* tag_opening, token_T* content,
|
|
|
376
376
|
return erb_if_node;
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
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_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) {
|
|
379
|
+
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, hb_array_T* block_arguments, 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) {
|
|
380
380
|
AST_ERB_BLOCK_NODE_T* erb_block_node = hb_allocator_alloc(allocator, sizeof(AST_ERB_BLOCK_NODE_T));
|
|
381
381
|
|
|
382
382
|
if (!erb_block_node) { return NULL; }
|
|
@@ -388,6 +388,7 @@ AST_ERB_BLOCK_NODE_T* ast_erb_block_node_init(token_T* tag_opening, token_T* con
|
|
|
388
388
|
erb_block_node->tag_closing = token_copy(tag_closing, allocator);
|
|
389
389
|
erb_block_node->prism_node = prism_node;
|
|
390
390
|
erb_block_node->body = body;
|
|
391
|
+
erb_block_node->block_arguments = block_arguments;
|
|
391
392
|
erb_block_node->rescue_clause = rescue_clause;
|
|
392
393
|
erb_block_node->else_clause = else_clause;
|
|
393
394
|
erb_block_node->ensure_clause = ensure_clause;
|
|
@@ -584,7 +585,36 @@ AST_RUBY_RENDER_LOCAL_NODE_T* ast_ruby_render_local_node_init(token_T* name, str
|
|
|
584
585
|
return ruby_render_local_node;
|
|
585
586
|
}
|
|
586
587
|
|
|
587
|
-
|
|
588
|
+
AST_RUBY_RENDER_KEYWORDS_NODE_T* ast_ruby_render_keywords_node_init(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) {
|
|
589
|
+
AST_RUBY_RENDER_KEYWORDS_NODE_T* ruby_render_keywords_node = hb_allocator_alloc(allocator, sizeof(AST_RUBY_RENDER_KEYWORDS_NODE_T));
|
|
590
|
+
|
|
591
|
+
if (!ruby_render_keywords_node) { return NULL; }
|
|
592
|
+
|
|
593
|
+
ast_node_init(&ruby_render_keywords_node->base, AST_RUBY_RENDER_KEYWORDS_NODE, start_position, end_position, errors, allocator);
|
|
594
|
+
|
|
595
|
+
ruby_render_keywords_node->partial = token_copy(partial, allocator);
|
|
596
|
+
ruby_render_keywords_node->template_path = token_copy(template_path, allocator);
|
|
597
|
+
ruby_render_keywords_node->layout = token_copy(layout, allocator);
|
|
598
|
+
ruby_render_keywords_node->file = token_copy(file, allocator);
|
|
599
|
+
ruby_render_keywords_node->inline_template = token_copy(inline_template, allocator);
|
|
600
|
+
ruby_render_keywords_node->body = token_copy(body, allocator);
|
|
601
|
+
ruby_render_keywords_node->plain = token_copy(plain, allocator);
|
|
602
|
+
ruby_render_keywords_node->html = token_copy(html, allocator);
|
|
603
|
+
ruby_render_keywords_node->renderable = token_copy(renderable, allocator);
|
|
604
|
+
ruby_render_keywords_node->collection = token_copy(collection, allocator);
|
|
605
|
+
ruby_render_keywords_node->object = token_copy(object, allocator);
|
|
606
|
+
ruby_render_keywords_node->as_name = token_copy(as_name, allocator);
|
|
607
|
+
ruby_render_keywords_node->spacer_template = token_copy(spacer_template, allocator);
|
|
608
|
+
ruby_render_keywords_node->formats = token_copy(formats, allocator);
|
|
609
|
+
ruby_render_keywords_node->variants = token_copy(variants, allocator);
|
|
610
|
+
ruby_render_keywords_node->handlers = token_copy(handlers, allocator);
|
|
611
|
+
ruby_render_keywords_node->content_type = token_copy(content_type, allocator);
|
|
612
|
+
ruby_render_keywords_node->locals = locals;
|
|
613
|
+
|
|
614
|
+
return ruby_render_keywords_node;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
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, struct AST_RUBY_RENDER_KEYWORDS_NODE_STRUCT* keywords, hb_array_T* body, hb_array_T* block_arguments, 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) {
|
|
588
618
|
AST_ERB_RENDER_NODE_T* erb_render_node = hb_allocator_alloc(allocator, sizeof(AST_ERB_RENDER_NODE_T));
|
|
589
619
|
|
|
590
620
|
if (!erb_render_node) { return NULL; }
|
|
@@ -596,41 +626,30 @@ AST_ERB_RENDER_NODE_T* ast_erb_render_node_init(token_T* tag_opening, token_T* c
|
|
|
596
626
|
erb_render_node->tag_closing = token_copy(tag_closing, allocator);
|
|
597
627
|
erb_render_node->analyzed_ruby = analyzed_ruby;
|
|
598
628
|
erb_render_node->prism_node = prism_node;
|
|
599
|
-
erb_render_node->
|
|
600
|
-
erb_render_node->
|
|
601
|
-
erb_render_node->
|
|
602
|
-
erb_render_node->
|
|
603
|
-
erb_render_node->
|
|
604
|
-
erb_render_node->
|
|
605
|
-
erb_render_node->
|
|
606
|
-
erb_render_node->html = token_copy(html, allocator);
|
|
607
|
-
erb_render_node->renderable = token_copy(renderable, allocator);
|
|
608
|
-
erb_render_node->collection = token_copy(collection, allocator);
|
|
609
|
-
erb_render_node->object = token_copy(object, allocator);
|
|
610
|
-
erb_render_node->as_name = token_copy(as_name, allocator);
|
|
611
|
-
erb_render_node->spacer_template = token_copy(spacer_template, allocator);
|
|
612
|
-
erb_render_node->formats = token_copy(formats, allocator);
|
|
613
|
-
erb_render_node->variants = token_copy(variants, allocator);
|
|
614
|
-
erb_render_node->handlers = token_copy(handlers, allocator);
|
|
615
|
-
erb_render_node->content_type = token_copy(content_type, allocator);
|
|
616
|
-
erb_render_node->locals = locals;
|
|
629
|
+
erb_render_node->keywords = keywords;
|
|
630
|
+
erb_render_node->body = body;
|
|
631
|
+
erb_render_node->block_arguments = block_arguments;
|
|
632
|
+
erb_render_node->rescue_clause = rescue_clause;
|
|
633
|
+
erb_render_node->else_clause = else_clause;
|
|
634
|
+
erb_render_node->ensure_clause = ensure_clause;
|
|
635
|
+
erb_render_node->end_node = end_node;
|
|
617
636
|
|
|
618
637
|
return erb_render_node;
|
|
619
638
|
}
|
|
620
639
|
|
|
621
|
-
|
|
622
|
-
|
|
640
|
+
AST_RUBY_PARAMETER_NODE_T* ast_ruby_parameter_node_init(token_T* name, struct AST_RUBY_LITERAL_NODE_STRUCT* default_value, hb_string_T kind, bool required, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator) {
|
|
641
|
+
AST_RUBY_PARAMETER_NODE_T* ruby_parameter_node = hb_allocator_alloc(allocator, sizeof(AST_RUBY_PARAMETER_NODE_T));
|
|
623
642
|
|
|
624
|
-
if (!
|
|
643
|
+
if (!ruby_parameter_node) { return NULL; }
|
|
625
644
|
|
|
626
|
-
ast_node_init(&
|
|
645
|
+
ast_node_init(&ruby_parameter_node->base, AST_RUBY_PARAMETER_NODE, start_position, end_position, errors, allocator);
|
|
627
646
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
647
|
+
ruby_parameter_node->name = token_copy(name, allocator);
|
|
648
|
+
ruby_parameter_node->default_value = default_value;
|
|
649
|
+
ruby_parameter_node->kind = hb_string_copy(kind, allocator);
|
|
650
|
+
ruby_parameter_node->required = required;
|
|
632
651
|
|
|
633
|
-
return
|
|
652
|
+
return ruby_parameter_node;
|
|
634
653
|
}
|
|
635
654
|
|
|
636
655
|
AST_ERB_STRICT_LOCALS_NODE_T* ast_erb_strict_locals_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, analyzed_ruby_T* analyzed_ruby, herb_prism_node_T prism_node, hb_array_T* locals, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator) {
|
|
@@ -719,8 +738,9 @@ hb_string_T ast_node_type_to_string(AST_NODE_T* node) {
|
|
|
719
738
|
case AST_ERB_BEGIN_NODE: return hb_string("AST_ERB_BEGIN_NODE");
|
|
720
739
|
case AST_ERB_UNLESS_NODE: return hb_string("AST_ERB_UNLESS_NODE");
|
|
721
740
|
case AST_RUBY_RENDER_LOCAL_NODE: return hb_string("AST_RUBY_RENDER_LOCAL_NODE");
|
|
741
|
+
case AST_RUBY_RENDER_KEYWORDS_NODE: return hb_string("AST_RUBY_RENDER_KEYWORDS_NODE");
|
|
722
742
|
case AST_ERB_RENDER_NODE: return hb_string("AST_ERB_RENDER_NODE");
|
|
723
|
-
case
|
|
743
|
+
case AST_RUBY_PARAMETER_NODE: return hb_string("AST_RUBY_PARAMETER_NODE");
|
|
724
744
|
case AST_ERB_STRICT_LOCALS_NODE: return hb_string("AST_ERB_STRICT_LOCALS_NODE");
|
|
725
745
|
case AST_ERB_YIELD_NODE: return hb_string("AST_ERB_YIELD_NODE");
|
|
726
746
|
case AST_ERB_IN_NODE: return hb_string("AST_ERB_IN_NODE");
|
|
@@ -768,8 +788,9 @@ hb_string_T ast_node_human_type(AST_NODE_T* node) {
|
|
|
768
788
|
case AST_ERB_BEGIN_NODE: return hb_string("ERBBeginNode");
|
|
769
789
|
case AST_ERB_UNLESS_NODE: return hb_string("ERBUnlessNode");
|
|
770
790
|
case AST_RUBY_RENDER_LOCAL_NODE: return hb_string("RubyRenderLocalNode");
|
|
791
|
+
case AST_RUBY_RENDER_KEYWORDS_NODE: return hb_string("RubyRenderKeywordsNode");
|
|
771
792
|
case AST_ERB_RENDER_NODE: return hb_string("ERBRenderNode");
|
|
772
|
-
case
|
|
793
|
+
case AST_RUBY_PARAMETER_NODE: return hb_string("RubyParameterNode");
|
|
773
794
|
case AST_ERB_STRICT_LOCALS_NODE: return hb_string("ERBStrictLocalsNode");
|
|
774
795
|
case AST_ERB_YIELD_NODE: return hb_string("ERBYieldNode");
|
|
775
796
|
case AST_ERB_IN_NODE: return hb_string("ERBInNode");
|
|
@@ -1108,6 +1129,14 @@ static void ast_free_erb_block_node(AST_ERB_BLOCK_NODE_T* erb_block_node, hb_all
|
|
|
1108
1129
|
|
|
1109
1130
|
hb_array_free(&erb_block_node->body);
|
|
1110
1131
|
}
|
|
1132
|
+
if (erb_block_node->block_arguments != NULL) {
|
|
1133
|
+
for (size_t i = 0; i < hb_array_size(erb_block_node->block_arguments); i++) {
|
|
1134
|
+
AST_NODE_T* child = hb_array_get(erb_block_node->block_arguments, i);
|
|
1135
|
+
if (child) { ast_node_free(child, allocator); }
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
hb_array_free(&erb_block_node->block_arguments);
|
|
1139
|
+
}
|
|
1111
1140
|
ast_node_free((AST_NODE_T*) erb_block_node->rescue_clause, allocator);
|
|
1112
1141
|
ast_node_free((AST_NODE_T*) erb_block_node->else_clause, allocator);
|
|
1113
1142
|
ast_node_free((AST_NODE_T*) erb_block_node->ensure_clause, allocator);
|
|
@@ -1322,6 +1351,36 @@ static void ast_free_ruby_render_local_node(AST_RUBY_RENDER_LOCAL_NODE_T* ruby_r
|
|
|
1322
1351
|
ast_free_base_node(&ruby_render_local_node->base, allocator);
|
|
1323
1352
|
}
|
|
1324
1353
|
|
|
1354
|
+
static void ast_free_ruby_render_keywords_node(AST_RUBY_RENDER_KEYWORDS_NODE_T* ruby_render_keywords_node, hb_allocator_T* allocator) {
|
|
1355
|
+
if (ruby_render_keywords_node->partial != NULL) { token_free(ruby_render_keywords_node->partial, allocator); }
|
|
1356
|
+
if (ruby_render_keywords_node->template_path != NULL) { token_free(ruby_render_keywords_node->template_path, allocator); }
|
|
1357
|
+
if (ruby_render_keywords_node->layout != NULL) { token_free(ruby_render_keywords_node->layout, allocator); }
|
|
1358
|
+
if (ruby_render_keywords_node->file != NULL) { token_free(ruby_render_keywords_node->file, allocator); }
|
|
1359
|
+
if (ruby_render_keywords_node->inline_template != NULL) { token_free(ruby_render_keywords_node->inline_template, allocator); }
|
|
1360
|
+
if (ruby_render_keywords_node->body != NULL) { token_free(ruby_render_keywords_node->body, allocator); }
|
|
1361
|
+
if (ruby_render_keywords_node->plain != NULL) { token_free(ruby_render_keywords_node->plain, allocator); }
|
|
1362
|
+
if (ruby_render_keywords_node->html != NULL) { token_free(ruby_render_keywords_node->html, allocator); }
|
|
1363
|
+
if (ruby_render_keywords_node->renderable != NULL) { token_free(ruby_render_keywords_node->renderable, allocator); }
|
|
1364
|
+
if (ruby_render_keywords_node->collection != NULL) { token_free(ruby_render_keywords_node->collection, allocator); }
|
|
1365
|
+
if (ruby_render_keywords_node->object != NULL) { token_free(ruby_render_keywords_node->object, allocator); }
|
|
1366
|
+
if (ruby_render_keywords_node->as_name != NULL) { token_free(ruby_render_keywords_node->as_name, allocator); }
|
|
1367
|
+
if (ruby_render_keywords_node->spacer_template != NULL) { token_free(ruby_render_keywords_node->spacer_template, allocator); }
|
|
1368
|
+
if (ruby_render_keywords_node->formats != NULL) { token_free(ruby_render_keywords_node->formats, allocator); }
|
|
1369
|
+
if (ruby_render_keywords_node->variants != NULL) { token_free(ruby_render_keywords_node->variants, allocator); }
|
|
1370
|
+
if (ruby_render_keywords_node->handlers != NULL) { token_free(ruby_render_keywords_node->handlers, allocator); }
|
|
1371
|
+
if (ruby_render_keywords_node->content_type != NULL) { token_free(ruby_render_keywords_node->content_type, allocator); }
|
|
1372
|
+
if (ruby_render_keywords_node->locals != NULL) {
|
|
1373
|
+
for (size_t i = 0; i < hb_array_size(ruby_render_keywords_node->locals); i++) {
|
|
1374
|
+
AST_NODE_T* child = hb_array_get(ruby_render_keywords_node->locals, i);
|
|
1375
|
+
if (child) { ast_node_free(child, allocator); }
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
hb_array_free(&ruby_render_keywords_node->locals);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
ast_free_base_node(&ruby_render_keywords_node->base, allocator);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1325
1384
|
static void ast_free_erb_render_node(AST_ERB_RENDER_NODE_T* erb_render_node, hb_allocator_T* allocator) {
|
|
1326
1385
|
if (erb_render_node->tag_opening != NULL) { token_free(erb_render_node->tag_opening, allocator); }
|
|
1327
1386
|
if (erb_render_node->content != NULL) { token_free(erb_render_node->content, allocator); }
|
|
@@ -1330,40 +1389,37 @@ static void ast_free_erb_render_node(AST_ERB_RENDER_NODE_T* erb_render_node, hb_
|
|
|
1330
1389
|
free_analyzed_ruby(erb_render_node->analyzed_ruby);
|
|
1331
1390
|
}
|
|
1332
1391
|
/* prism_node is a borrowed reference into the prism context, not freed here */
|
|
1333
|
-
|
|
1334
|
-
if (erb_render_node->
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
if (erb_render_node->
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
if (erb_render_node->spacer_template != NULL) { token_free(erb_render_node->spacer_template, allocator); }
|
|
1346
|
-
if (erb_render_node->formats != NULL) { token_free(erb_render_node->formats, allocator); }
|
|
1347
|
-
if (erb_render_node->variants != NULL) { token_free(erb_render_node->variants, allocator); }
|
|
1348
|
-
if (erb_render_node->handlers != NULL) { token_free(erb_render_node->handlers, allocator); }
|
|
1349
|
-
if (erb_render_node->content_type != NULL) { token_free(erb_render_node->content_type, allocator); }
|
|
1350
|
-
if (erb_render_node->locals != NULL) {
|
|
1351
|
-
for (size_t i = 0; i < hb_array_size(erb_render_node->locals); i++) {
|
|
1352
|
-
AST_NODE_T* child = hb_array_get(erb_render_node->locals, i);
|
|
1392
|
+
ast_node_free((AST_NODE_T*) erb_render_node->keywords, allocator);
|
|
1393
|
+
if (erb_render_node->body != NULL) {
|
|
1394
|
+
for (size_t i = 0; i < hb_array_size(erb_render_node->body); i++) {
|
|
1395
|
+
AST_NODE_T* child = hb_array_get(erb_render_node->body, i);
|
|
1396
|
+
if (child) { ast_node_free(child, allocator); }
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
hb_array_free(&erb_render_node->body);
|
|
1400
|
+
}
|
|
1401
|
+
if (erb_render_node->block_arguments != NULL) {
|
|
1402
|
+
for (size_t i = 0; i < hb_array_size(erb_render_node->block_arguments); i++) {
|
|
1403
|
+
AST_NODE_T* child = hb_array_get(erb_render_node->block_arguments, i);
|
|
1353
1404
|
if (child) { ast_node_free(child, allocator); }
|
|
1354
1405
|
}
|
|
1355
1406
|
|
|
1356
|
-
hb_array_free(&erb_render_node->
|
|
1407
|
+
hb_array_free(&erb_render_node->block_arguments);
|
|
1357
1408
|
}
|
|
1409
|
+
ast_node_free((AST_NODE_T*) erb_render_node->rescue_clause, allocator);
|
|
1410
|
+
ast_node_free((AST_NODE_T*) erb_render_node->else_clause, allocator);
|
|
1411
|
+
ast_node_free((AST_NODE_T*) erb_render_node->ensure_clause, allocator);
|
|
1412
|
+
ast_node_free((AST_NODE_T*) erb_render_node->end_node, allocator);
|
|
1358
1413
|
|
|
1359
1414
|
ast_free_base_node(&erb_render_node->base, allocator);
|
|
1360
1415
|
}
|
|
1361
1416
|
|
|
1362
|
-
static void
|
|
1363
|
-
if (
|
|
1364
|
-
ast_node_free((AST_NODE_T*)
|
|
1417
|
+
static void ast_free_ruby_parameter_node(AST_RUBY_PARAMETER_NODE_T* ruby_parameter_node, hb_allocator_T* allocator) {
|
|
1418
|
+
if (ruby_parameter_node->name != NULL) { token_free(ruby_parameter_node->name, allocator); }
|
|
1419
|
+
ast_node_free((AST_NODE_T*) ruby_parameter_node->default_value, allocator);
|
|
1420
|
+
if (ruby_parameter_node->kind.data != NULL) { hb_allocator_dealloc(allocator, ruby_parameter_node->kind.data); }
|
|
1365
1421
|
|
|
1366
|
-
ast_free_base_node(&
|
|
1422
|
+
ast_free_base_node(&ruby_parameter_node->base, allocator);
|
|
1367
1423
|
}
|
|
1368
1424
|
|
|
1369
1425
|
static void ast_free_erb_strict_locals_node(AST_ERB_STRICT_LOCALS_NODE_T* erb_strict_locals_node, hb_allocator_T* allocator) {
|
|
@@ -1452,8 +1508,9 @@ void ast_node_free(AST_NODE_T* node, hb_allocator_T* allocator) {
|
|
|
1452
1508
|
case AST_ERB_BEGIN_NODE: ast_free_erb_begin_node((AST_ERB_BEGIN_NODE_T*) node, allocator); break;
|
|
1453
1509
|
case AST_ERB_UNLESS_NODE: ast_free_erb_unless_node((AST_ERB_UNLESS_NODE_T*) node, allocator); break;
|
|
1454
1510
|
case AST_RUBY_RENDER_LOCAL_NODE: ast_free_ruby_render_local_node((AST_RUBY_RENDER_LOCAL_NODE_T*) node, allocator); break;
|
|
1511
|
+
case AST_RUBY_RENDER_KEYWORDS_NODE: ast_free_ruby_render_keywords_node((AST_RUBY_RENDER_KEYWORDS_NODE_T*) node, allocator); break;
|
|
1455
1512
|
case AST_ERB_RENDER_NODE: ast_free_erb_render_node((AST_ERB_RENDER_NODE_T*) node, allocator); break;
|
|
1456
|
-
case
|
|
1513
|
+
case AST_RUBY_PARAMETER_NODE: ast_free_ruby_parameter_node((AST_RUBY_PARAMETER_NODE_T*) node, allocator); break;
|
|
1457
1514
|
case AST_ERB_STRICT_LOCALS_NODE: ast_free_erb_strict_locals_node((AST_ERB_STRICT_LOCALS_NODE_T*) node, allocator); break;
|
|
1458
1515
|
case AST_ERB_YIELD_NODE: ast_free_erb_yield_node((AST_ERB_YIELD_NODE_T*) node, allocator); break;
|
|
1459
1516
|
case AST_ERB_IN_NODE: ast_free_erb_in_node((AST_ERB_IN_NODE_T*) node, allocator); break;
|
data/src/ast/ast_pretty_print.c
CHANGED
|
@@ -473,6 +473,7 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
473
473
|
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
474
474
|
}
|
|
475
475
|
pretty_print_array(hb_string("body"), erb_block_node->body, indent, relative_indent, false, buffer);
|
|
476
|
+
pretty_print_array(hb_string("block_arguments"), erb_block_node->block_arguments, indent, relative_indent, false, buffer);
|
|
476
477
|
|
|
477
478
|
pretty_print_label(hb_string("rescue_clause"), indent, relative_indent, false, buffer);
|
|
478
479
|
|
|
@@ -923,6 +924,30 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
923
924
|
|
|
924
925
|
} break;
|
|
925
926
|
|
|
927
|
+
case AST_RUBY_RENDER_KEYWORDS_NODE: {
|
|
928
|
+
const AST_RUBY_RENDER_KEYWORDS_NODE_T* ruby_render_keywords_node = (AST_RUBY_RENDER_KEYWORDS_NODE_T*) node;
|
|
929
|
+
|
|
930
|
+
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
931
|
+
pretty_print_token_property(ruby_render_keywords_node->partial, hb_string("partial"), indent, relative_indent, false, buffer);
|
|
932
|
+
pretty_print_token_property(ruby_render_keywords_node->template_path, hb_string("template_path"), indent, relative_indent, false, buffer);
|
|
933
|
+
pretty_print_token_property(ruby_render_keywords_node->layout, hb_string("layout"), indent, relative_indent, false, buffer);
|
|
934
|
+
pretty_print_token_property(ruby_render_keywords_node->file, hb_string("file"), indent, relative_indent, false, buffer);
|
|
935
|
+
pretty_print_token_property(ruby_render_keywords_node->inline_template, hb_string("inline_template"), indent, relative_indent, false, buffer);
|
|
936
|
+
pretty_print_token_property(ruby_render_keywords_node->body, hb_string("body"), indent, relative_indent, false, buffer);
|
|
937
|
+
pretty_print_token_property(ruby_render_keywords_node->plain, hb_string("plain"), indent, relative_indent, false, buffer);
|
|
938
|
+
pretty_print_token_property(ruby_render_keywords_node->html, hb_string("html"), indent, relative_indent, false, buffer);
|
|
939
|
+
pretty_print_token_property(ruby_render_keywords_node->renderable, hb_string("renderable"), indent, relative_indent, false, buffer);
|
|
940
|
+
pretty_print_token_property(ruby_render_keywords_node->collection, hb_string("collection"), indent, relative_indent, false, buffer);
|
|
941
|
+
pretty_print_token_property(ruby_render_keywords_node->object, hb_string("object"), indent, relative_indent, false, buffer);
|
|
942
|
+
pretty_print_token_property(ruby_render_keywords_node->as_name, hb_string("as_name"), indent, relative_indent, false, buffer);
|
|
943
|
+
pretty_print_token_property(ruby_render_keywords_node->spacer_template, hb_string("spacer_template"), indent, relative_indent, false, buffer);
|
|
944
|
+
pretty_print_token_property(ruby_render_keywords_node->formats, hb_string("formats"), indent, relative_indent, false, buffer);
|
|
945
|
+
pretty_print_token_property(ruby_render_keywords_node->variants, hb_string("variants"), indent, relative_indent, false, buffer);
|
|
946
|
+
pretty_print_token_property(ruby_render_keywords_node->handlers, hb_string("handlers"), indent, relative_indent, false, buffer);
|
|
947
|
+
pretty_print_token_property(ruby_render_keywords_node->content_type, hb_string("content_type"), indent, relative_indent, false, buffer);
|
|
948
|
+
pretty_print_array(hb_string("locals"), ruby_render_keywords_node->locals, indent, relative_indent, true, buffer);
|
|
949
|
+
} break;
|
|
950
|
+
|
|
926
951
|
case AST_ERB_RENDER_NODE: {
|
|
927
952
|
const AST_ERB_RENDER_NODE_T* erb_render_node = (AST_ERB_RENDER_NODE_T*) node;
|
|
928
953
|
|
|
@@ -955,48 +980,107 @@ void ast_pretty_print_node(AST_NODE_T* node, const size_t indent, const size_t r
|
|
|
955
980
|
pretty_print_label(hb_string("prism_node"), indent, relative_indent, false, buffer);
|
|
956
981
|
hb_buffer_append(buffer, " (pm_node_t*)\n");
|
|
957
982
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
983
|
+
|
|
984
|
+
pretty_print_label(hb_string("keywords"), indent, relative_indent, false, buffer);
|
|
985
|
+
|
|
986
|
+
if (erb_render_node->keywords) {
|
|
987
|
+
hb_buffer_append(buffer, "\n");
|
|
988
|
+
pretty_print_indent(buffer, indent);
|
|
989
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
990
|
+
|
|
991
|
+
hb_buffer_append(buffer, "└── ");
|
|
992
|
+
ast_pretty_print_node((AST_NODE_T*) erb_render_node->keywords, indent, relative_indent + 2, buffer);
|
|
993
|
+
} else {
|
|
994
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
995
|
+
}
|
|
996
|
+
hb_buffer_append(buffer, "\n");
|
|
997
|
+
|
|
998
|
+
pretty_print_array(hb_string("body"), erb_render_node->body, indent, relative_indent, false, buffer);
|
|
999
|
+
pretty_print_array(hb_string("block_arguments"), erb_render_node->block_arguments, indent, relative_indent, false, buffer);
|
|
1000
|
+
|
|
1001
|
+
pretty_print_label(hb_string("rescue_clause"), indent, relative_indent, false, buffer);
|
|
1002
|
+
|
|
1003
|
+
if (erb_render_node->rescue_clause) {
|
|
1004
|
+
hb_buffer_append(buffer, "\n");
|
|
1005
|
+
pretty_print_indent(buffer, indent);
|
|
1006
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
1007
|
+
|
|
1008
|
+
hb_buffer_append(buffer, "└── ");
|
|
1009
|
+
ast_pretty_print_node((AST_NODE_T*) erb_render_node->rescue_clause, indent, relative_indent + 2, buffer);
|
|
1010
|
+
} else {
|
|
1011
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
1012
|
+
}
|
|
1013
|
+
hb_buffer_append(buffer, "\n");
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
pretty_print_label(hb_string("else_clause"), indent, relative_indent, false, buffer);
|
|
1017
|
+
|
|
1018
|
+
if (erb_render_node->else_clause) {
|
|
1019
|
+
hb_buffer_append(buffer, "\n");
|
|
1020
|
+
pretty_print_indent(buffer, indent);
|
|
1021
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
1022
|
+
|
|
1023
|
+
hb_buffer_append(buffer, "└── ");
|
|
1024
|
+
ast_pretty_print_node((AST_NODE_T*) erb_render_node->else_clause, indent, relative_indent + 2, buffer);
|
|
1025
|
+
} else {
|
|
1026
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
1027
|
+
}
|
|
1028
|
+
hb_buffer_append(buffer, "\n");
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
pretty_print_label(hb_string("ensure_clause"), indent, relative_indent, false, buffer);
|
|
1032
|
+
|
|
1033
|
+
if (erb_render_node->ensure_clause) {
|
|
1034
|
+
hb_buffer_append(buffer, "\n");
|
|
1035
|
+
pretty_print_indent(buffer, indent);
|
|
1036
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
1037
|
+
|
|
1038
|
+
hb_buffer_append(buffer, "└── ");
|
|
1039
|
+
ast_pretty_print_node((AST_NODE_T*) erb_render_node->ensure_clause, indent, relative_indent + 2, buffer);
|
|
1040
|
+
} else {
|
|
1041
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
1042
|
+
}
|
|
1043
|
+
hb_buffer_append(buffer, "\n");
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
pretty_print_label(hb_string("end_node"), indent, relative_indent, true, buffer);
|
|
1047
|
+
|
|
1048
|
+
if (erb_render_node->end_node) {
|
|
1049
|
+
hb_buffer_append(buffer, "\n");
|
|
1050
|
+
pretty_print_indent(buffer, indent);
|
|
1051
|
+
pretty_print_indent(buffer, relative_indent + 1);
|
|
1052
|
+
|
|
1053
|
+
hb_buffer_append(buffer, "└── ");
|
|
1054
|
+
ast_pretty_print_node((AST_NODE_T*) erb_render_node->end_node, indent, relative_indent + 2, buffer);
|
|
1055
|
+
} else {
|
|
1056
|
+
hb_buffer_append(buffer, " ∅\n");
|
|
1057
|
+
}
|
|
1058
|
+
hb_buffer_append(buffer, "\n");
|
|
1059
|
+
|
|
976
1060
|
} break;
|
|
977
1061
|
|
|
978
|
-
case
|
|
979
|
-
const
|
|
1062
|
+
case AST_RUBY_PARAMETER_NODE: {
|
|
1063
|
+
const AST_RUBY_PARAMETER_NODE_T* ruby_parameter_node = (AST_RUBY_PARAMETER_NODE_T*) node;
|
|
980
1064
|
|
|
981
1065
|
pretty_print_errors(node, indent, relative_indent, false, buffer);
|
|
982
|
-
pretty_print_token_property(
|
|
1066
|
+
pretty_print_token_property(ruby_parameter_node->name, hb_string("name"), indent, relative_indent, false, buffer);
|
|
983
1067
|
|
|
984
1068
|
pretty_print_label(hb_string("default_value"), indent, relative_indent, false, buffer);
|
|
985
1069
|
|
|
986
|
-
if (
|
|
1070
|
+
if (ruby_parameter_node->default_value) {
|
|
987
1071
|
hb_buffer_append(buffer, "\n");
|
|
988
1072
|
pretty_print_indent(buffer, indent);
|
|
989
1073
|
pretty_print_indent(buffer, relative_indent + 1);
|
|
990
1074
|
|
|
991
1075
|
hb_buffer_append(buffer, "└── ");
|
|
992
|
-
ast_pretty_print_node((AST_NODE_T*)
|
|
1076
|
+
ast_pretty_print_node((AST_NODE_T*) ruby_parameter_node->default_value, indent, relative_indent + 2, buffer);
|
|
993
1077
|
} else {
|
|
994
1078
|
hb_buffer_append(buffer, " ∅\n");
|
|
995
1079
|
}
|
|
996
1080
|
hb_buffer_append(buffer, "\n");
|
|
997
1081
|
|
|
998
|
-
|
|
999
|
-
pretty_print_boolean_property(hb_string("
|
|
1082
|
+
pretty_print_string_property(ruby_parameter_node->kind, hb_string("kind"), indent, relative_indent, false, buffer);
|
|
1083
|
+
pretty_print_boolean_property(hb_string("required"), ruby_parameter_node->required, indent, relative_indent, true, buffer);
|
|
1000
1084
|
} break;
|
|
1001
1085
|
|
|
1002
1086
|
case AST_ERB_STRICT_LOCALS_NODE: {
|
|
@@ -40,4 +40,7 @@ size_t get_tag_helper_handlers_count(void);
|
|
|
40
40
|
|
|
41
41
|
char* extract_inline_block_content(pm_call_node_t* call_node, hb_allocator_T* allocator);
|
|
42
42
|
|
|
43
|
+
struct AST_NODE_STRUCT;
|
|
44
|
+
bool wrap_javascript_tag_body_visitor(const struct AST_NODE_STRUCT* node, void* data);
|
|
45
|
+
|
|
43
46
|
#endif
|
|
@@ -87,6 +87,13 @@ AST_HTML_ATTRIBUTE_NODE_T* create_href_attribute(
|
|
|
87
87
|
hb_allocator_T* allocator
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
+
AST_CDATA_NODE_T* create_javascript_cdata_node(
|
|
91
|
+
hb_array_T* children,
|
|
92
|
+
position_T start,
|
|
93
|
+
position_T end,
|
|
94
|
+
hb_allocator_T* allocator
|
|
95
|
+
);
|
|
96
|
+
|
|
90
97
|
void append_body_content_node(
|
|
91
98
|
hb_array_T* body,
|
|
92
99
|
const char* content,
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
#include <stdbool.h>
|
|
6
6
|
|
|
7
7
|
#include "../ast/ast_node.h"
|
|
8
|
+
#include "../ast/ast_nodes.h"
|
|
8
9
|
#include "../lib/hb_allocator.h"
|
|
10
|
+
#include "../lib/hb_array.h"
|
|
9
11
|
#include "analyzed_ruby.h"
|
|
10
12
|
|
|
11
13
|
bool has_if_node(analyzed_ruby_T* analyzed);
|
|
@@ -62,4 +64,20 @@ bool search_unexpected_when_nodes(analyzed_ruby_T* analyzed);
|
|
|
62
64
|
|
|
63
65
|
void check_erb_node_for_missing_end(const AST_NODE_T* node, hb_allocator_T* allocator);
|
|
64
66
|
|
|
67
|
+
hb_array_T* extract_parameters_from_prism(
|
|
68
|
+
pm_parameters_node_t* parameters,
|
|
69
|
+
pm_parser_t* parser,
|
|
70
|
+
const char* source,
|
|
71
|
+
size_t source_base_offset,
|
|
72
|
+
const uint8_t* prism_source_start,
|
|
73
|
+
hb_allocator_T* allocator
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
hb_array_T* extract_block_arguments_from_erb_node(
|
|
77
|
+
const AST_ERB_CONTENT_NODE_T* erb_node,
|
|
78
|
+
const char* source,
|
|
79
|
+
hb_array_T* errors,
|
|
80
|
+
hb_allocator_T* allocator
|
|
81
|
+
);
|
|
82
|
+
|
|
65
83
|
#endif
|
data/src/include/ast/ast_nodes.h
CHANGED
|
@@ -57,8 +57,9 @@ typedef enum {
|
|
|
57
57
|
AST_ERB_BEGIN_NODE,
|
|
58
58
|
AST_ERB_UNLESS_NODE,
|
|
59
59
|
AST_RUBY_RENDER_LOCAL_NODE,
|
|
60
|
+
AST_RUBY_RENDER_KEYWORDS_NODE,
|
|
60
61
|
AST_ERB_RENDER_NODE,
|
|
61
|
-
|
|
62
|
+
AST_RUBY_PARAMETER_NODE,
|
|
62
63
|
AST_ERB_STRICT_LOCALS_NODE,
|
|
63
64
|
AST_ERB_YIELD_NODE,
|
|
64
65
|
AST_ERB_IN_NODE,
|
|
@@ -263,6 +264,7 @@ typedef struct AST_ERB_BLOCK_NODE_STRUCT {
|
|
|
263
264
|
token_T* tag_closing;
|
|
264
265
|
herb_prism_node_T prism_node;
|
|
265
266
|
hb_array_T* body;
|
|
267
|
+
hb_array_T* block_arguments;
|
|
266
268
|
struct AST_ERB_RESCUE_NODE_STRUCT* rescue_clause;
|
|
267
269
|
struct AST_ERB_ELSE_NODE_STRUCT* else_clause;
|
|
268
270
|
struct AST_ERB_ENSURE_NODE_STRUCT* ensure_clause;
|
|
@@ -380,13 +382,8 @@ typedef struct AST_RUBY_RENDER_LOCAL_NODE_STRUCT {
|
|
|
380
382
|
struct AST_RUBY_LITERAL_NODE_STRUCT* value;
|
|
381
383
|
} AST_RUBY_RENDER_LOCAL_NODE_T;
|
|
382
384
|
|
|
383
|
-
typedef struct
|
|
385
|
+
typedef struct AST_RUBY_RENDER_KEYWORDS_NODE_STRUCT {
|
|
384
386
|
AST_NODE_T base;
|
|
385
|
-
token_T* tag_opening;
|
|
386
|
-
token_T* content;
|
|
387
|
-
token_T* tag_closing;
|
|
388
|
-
analyzed_ruby_T* analyzed_ruby;
|
|
389
|
-
herb_prism_node_T prism_node;
|
|
390
387
|
token_T* partial;
|
|
391
388
|
token_T* template_path;
|
|
392
389
|
token_T* layout;
|
|
@@ -405,15 +402,31 @@ typedef struct AST_ERB_RENDER_NODE_STRUCT {
|
|
|
405
402
|
token_T* handlers;
|
|
406
403
|
token_T* content_type;
|
|
407
404
|
hb_array_T* locals;
|
|
405
|
+
} AST_RUBY_RENDER_KEYWORDS_NODE_T;
|
|
406
|
+
|
|
407
|
+
typedef struct AST_ERB_RENDER_NODE_STRUCT {
|
|
408
|
+
AST_NODE_T base;
|
|
409
|
+
token_T* tag_opening;
|
|
410
|
+
token_T* content;
|
|
411
|
+
token_T* tag_closing;
|
|
412
|
+
analyzed_ruby_T* analyzed_ruby;
|
|
413
|
+
herb_prism_node_T prism_node;
|
|
414
|
+
struct AST_RUBY_RENDER_KEYWORDS_NODE_STRUCT* keywords;
|
|
415
|
+
hb_array_T* body;
|
|
416
|
+
hb_array_T* block_arguments;
|
|
417
|
+
struct AST_ERB_RESCUE_NODE_STRUCT* rescue_clause;
|
|
418
|
+
struct AST_ERB_ELSE_NODE_STRUCT* else_clause;
|
|
419
|
+
struct AST_ERB_ENSURE_NODE_STRUCT* ensure_clause;
|
|
420
|
+
struct AST_ERB_END_NODE_STRUCT* end_node;
|
|
408
421
|
} AST_ERB_RENDER_NODE_T;
|
|
409
422
|
|
|
410
|
-
typedef struct
|
|
423
|
+
typedef struct AST_RUBY_PARAMETER_NODE_STRUCT {
|
|
411
424
|
AST_NODE_T base;
|
|
412
425
|
token_T* name;
|
|
413
426
|
struct AST_RUBY_LITERAL_NODE_STRUCT* default_value;
|
|
427
|
+
hb_string_T kind;
|
|
414
428
|
bool required;
|
|
415
|
-
|
|
416
|
-
} AST_RUBY_STRICT_LOCAL_NODE_T;
|
|
429
|
+
} AST_RUBY_PARAMETER_NODE_T;
|
|
417
430
|
|
|
418
431
|
typedef struct AST_ERB_STRICT_LOCALS_NODE_STRUCT {
|
|
419
432
|
AST_NODE_T base;
|
|
@@ -466,7 +479,7 @@ AST_ERB_CONTENT_NODE_T* ast_erb_content_node_init(token_T* tag_opening, token_T*
|
|
|
466
479
|
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);
|
|
467
480
|
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);
|
|
468
481
|
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);
|
|
469
|
-
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_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);
|
|
482
|
+
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, hb_array_T* block_arguments, 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);
|
|
470
483
|
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);
|
|
471
484
|
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);
|
|
472
485
|
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);
|
|
@@ -478,8 +491,9 @@ AST_ERB_ENSURE_NODE_T* ast_erb_ensure_node_init(token_T* tag_opening, token_T* c
|
|
|
478
491
|
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);
|
|
479
492
|
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);
|
|
480
493
|
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);
|
|
481
|
-
|
|
482
|
-
|
|
494
|
+
AST_RUBY_RENDER_KEYWORDS_NODE_T* ast_ruby_render_keywords_node_init(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);
|
|
495
|
+
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, struct AST_RUBY_RENDER_KEYWORDS_NODE_STRUCT* keywords, hb_array_T* body, hb_array_T* block_arguments, 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);
|
|
496
|
+
AST_RUBY_PARAMETER_NODE_T* ast_ruby_parameter_node_init(token_T* name, struct AST_RUBY_LITERAL_NODE_STRUCT* default_value, hb_string_T kind, bool required, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
|
|
483
497
|
AST_ERB_STRICT_LOCALS_NODE_T* ast_erb_strict_locals_node_init(token_T* tag_opening, token_T* content, token_T* tag_closing, analyzed_ruby_T* analyzed_ruby, herb_prism_node_T prism_node, hb_array_T* locals, position_T start_position, position_T end_position, hb_array_T* errors, hb_allocator_T* allocator);
|
|
484
498
|
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);
|
|
485
499
|
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);
|