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.
@@ -205,6 +205,9 @@ bool match_tags_visitor(const AST_NODE_T* node, void* data) {
205
205
  if (erb_block_node->body != NULL) {
206
206
  match_tags_in_node_array(erb_block_node->body, context->errors, context->options, context->allocator);
207
207
  }
208
+ if (erb_block_node->block_arguments != NULL) {
209
+ match_tags_in_node_array(erb_block_node->block_arguments, context->errors, context->options, context->allocator);
210
+ }
208
211
  if (erb_block_node->rescue_clause != NULL) {
209
212
  herb_visit_node((AST_NODE_T*) erb_block_node->rescue_clause, match_tags_visitor, context);
210
213
  }
@@ -379,21 +382,49 @@ bool match_tags_visitor(const AST_NODE_T* node, void* data) {
379
382
 
380
383
 
381
384
 
385
+ case AST_RUBY_RENDER_KEYWORDS_NODE: {
386
+ const AST_RUBY_RENDER_KEYWORDS_NODE_T* ruby_render_keywords_node = (const AST_RUBY_RENDER_KEYWORDS_NODE_T*) node;
387
+
388
+ if (ruby_render_keywords_node->locals != NULL) {
389
+ match_tags_in_node_array(ruby_render_keywords_node->locals, context->errors, context->options, context->allocator);
390
+ }
391
+ } break;
392
+
393
+
394
+
382
395
  case AST_ERB_RENDER_NODE: {
383
396
  const AST_ERB_RENDER_NODE_T* erb_render_node = (const AST_ERB_RENDER_NODE_T*) node;
384
397
 
385
- if (erb_render_node->locals != NULL) {
386
- match_tags_in_node_array(erb_render_node->locals, context->errors, context->options, context->allocator);
398
+ if (erb_render_node->body != NULL) {
399
+ match_tags_in_node_array(erb_render_node->body, context->errors, context->options, context->allocator);
400
+ }
401
+ if (erb_render_node->block_arguments != NULL) {
402
+ match_tags_in_node_array(erb_render_node->block_arguments, context->errors, context->options, context->allocator);
403
+ }
404
+ if (erb_render_node->keywords != NULL) {
405
+ herb_visit_node((AST_NODE_T*) erb_render_node->keywords, match_tags_visitor, context);
406
+ }
407
+ if (erb_render_node->rescue_clause != NULL) {
408
+ herb_visit_node((AST_NODE_T*) erb_render_node->rescue_clause, match_tags_visitor, context);
409
+ }
410
+ if (erb_render_node->else_clause != NULL) {
411
+ herb_visit_node((AST_NODE_T*) erb_render_node->else_clause, match_tags_visitor, context);
412
+ }
413
+ if (erb_render_node->ensure_clause != NULL) {
414
+ herb_visit_node((AST_NODE_T*) erb_render_node->ensure_clause, match_tags_visitor, context);
415
+ }
416
+ if (erb_render_node->end_node != NULL) {
417
+ herb_visit_node((AST_NODE_T*) erb_render_node->end_node, match_tags_visitor, context);
387
418
  }
388
419
  } break;
389
420
 
390
421
 
391
422
 
392
- case AST_RUBY_STRICT_LOCAL_NODE: {
393
- const AST_RUBY_STRICT_LOCAL_NODE_T* ruby_strict_local_node = (const AST_RUBY_STRICT_LOCAL_NODE_T*) node;
423
+ case AST_RUBY_PARAMETER_NODE: {
424
+ const AST_RUBY_PARAMETER_NODE_T* ruby_parameter_node = (const AST_RUBY_PARAMETER_NODE_T*) node;
394
425
 
395
- if (ruby_strict_local_node->default_value != NULL) {
396
- herb_visit_node((AST_NODE_T*) ruby_strict_local_node->default_value, match_tags_visitor, context);
426
+ if (ruby_parameter_node->default_value != NULL) {
427
+ herb_visit_node((AST_NODE_T*) ruby_parameter_node->default_value, match_tags_visitor, context);
397
428
  }
398
429
  } break;
399
430
 
data/src/parser.c CHANGED
@@ -1,4 +1,5 @@
1
1
  #include "include/parser/parser.h"
2
+ #include "include/analyze/action_view/tag_helper_handler.h"
2
3
  #include "include/ast/ast_node.h"
3
4
  #include "include/ast/ast_nodes.h"
4
5
  #include "include/errors.h"
@@ -1897,4 +1898,11 @@ void herb_parser_match_html_tags_post_analyze(
1897
1898
  if (document == NULL) { return; }
1898
1899
 
1899
1900
  match_tags_in_node_array(document->children, document->base.errors, options, allocator);
1901
+
1902
+ if (options && options->action_view_helpers) {
1903
+ for (size_t i = 0; i < hb_array_size(document->children); i++) {
1904
+ AST_NODE_T* node = (AST_NODE_T*) hb_array_get(document->children, i);
1905
+ herb_visit_node(node, wrap_javascript_tag_body_visitor, allocator);
1906
+ }
1907
+ }
1900
1908
  }
data/src/visitor.c CHANGED
@@ -237,6 +237,12 @@ void herb_visit_child_nodes(const AST_NODE_T *node, bool (*visitor)(const AST_NO
237
237
  }
238
238
  }
239
239
 
240
+ if (erb_block_node->block_arguments != NULL) {
241
+ for (size_t index = 0; index < hb_array_size(erb_block_node->block_arguments); index++) {
242
+ herb_visit_node(hb_array_get(erb_block_node->block_arguments, index), visitor, data);
243
+ }
244
+ }
245
+
240
246
  if (erb_block_node->rescue_clause != NULL) {
241
247
  herb_visit_node((AST_NODE_T *) erb_block_node->rescue_clause, visitor, data);
242
248
  }
@@ -442,22 +448,59 @@ void herb_visit_child_nodes(const AST_NODE_T *node, bool (*visitor)(const AST_NO
442
448
 
443
449
  } break;
444
450
 
451
+ case AST_RUBY_RENDER_KEYWORDS_NODE: {
452
+ const AST_RUBY_RENDER_KEYWORDS_NODE_T* ruby_render_keywords_node = ((const AST_RUBY_RENDER_KEYWORDS_NODE_T *) node);
453
+
454
+ if (ruby_render_keywords_node->locals != NULL) {
455
+ for (size_t index = 0; index < hb_array_size(ruby_render_keywords_node->locals); index++) {
456
+ herb_visit_node(hb_array_get(ruby_render_keywords_node->locals, index), visitor, data);
457
+ }
458
+ }
459
+
460
+ } break;
461
+
445
462
  case AST_ERB_RENDER_NODE: {
446
463
  const AST_ERB_RENDER_NODE_T* erb_render_node = ((const AST_ERB_RENDER_NODE_T *) node);
447
464
 
448
- if (erb_render_node->locals != NULL) {
449
- for (size_t index = 0; index < hb_array_size(erb_render_node->locals); index++) {
450
- herb_visit_node(hb_array_get(erb_render_node->locals, index), visitor, data);
465
+ if (erb_render_node->keywords != NULL) {
466
+ herb_visit_node((AST_NODE_T *) erb_render_node->keywords, visitor, data);
467
+ }
468
+
469
+ if (erb_render_node->body != NULL) {
470
+ for (size_t index = 0; index < hb_array_size(erb_render_node->body); index++) {
471
+ herb_visit_node(hb_array_get(erb_render_node->body, index), visitor, data);
451
472
  }
452
473
  }
453
474
 
475
+ if (erb_render_node->block_arguments != NULL) {
476
+ for (size_t index = 0; index < hb_array_size(erb_render_node->block_arguments); index++) {
477
+ herb_visit_node(hb_array_get(erb_render_node->block_arguments, index), visitor, data);
478
+ }
479
+ }
480
+
481
+ if (erb_render_node->rescue_clause != NULL) {
482
+ herb_visit_node((AST_NODE_T *) erb_render_node->rescue_clause, visitor, data);
483
+ }
484
+
485
+ if (erb_render_node->else_clause != NULL) {
486
+ herb_visit_node((AST_NODE_T *) erb_render_node->else_clause, visitor, data);
487
+ }
488
+
489
+ if (erb_render_node->ensure_clause != NULL) {
490
+ herb_visit_node((AST_NODE_T *) erb_render_node->ensure_clause, visitor, data);
491
+ }
492
+
493
+ if (erb_render_node->end_node != NULL) {
494
+ herb_visit_node((AST_NODE_T *) erb_render_node->end_node, visitor, data);
495
+ }
496
+
454
497
  } break;
455
498
 
456
- case AST_RUBY_STRICT_LOCAL_NODE: {
457
- const AST_RUBY_STRICT_LOCAL_NODE_T* ruby_strict_local_node = ((const AST_RUBY_STRICT_LOCAL_NODE_T *) node);
499
+ case AST_RUBY_PARAMETER_NODE: {
500
+ const AST_RUBY_PARAMETER_NODE_T* ruby_parameter_node = ((const AST_RUBY_PARAMETER_NODE_T *) node);
458
501
 
459
- if (ruby_strict_local_node->default_value != NULL) {
460
- herb_visit_node((AST_NODE_T *) ruby_strict_local_node->default_value, visitor, data);
502
+ if (ruby_parameter_node->default_value != NULL) {
503
+ herb_visit_node((AST_NODE_T *) ruby_parameter_node->default_value, visitor, data);
461
504
  }
462
505
 
463
506
  } break;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - Marco Roth