@@ -287,7 +287,7 @@ static AST_NODE_T* create_control_node(
287287
288288 if (end_node ) {
289289 end_position = end_node -> base .location .end ;
290- } else if (children && hb_array_size ( children ) > 0 ) {
290+ } else if (children && children -> size > 0 ) {
291291 AST_NODE_T * last_child = hb_array_last (children );
292292 end_position = last_child -> location .end ;
293293 } else if (subsequent ) {
@@ -329,7 +329,7 @@ static AST_NODE_T* create_control_node(
329329 hb_array_T * in_conditions = hb_array_init (8 );
330330 hb_array_T * non_when_non_in_children = hb_array_init (8 );
331331
332- for (size_t i = 0 ; i < hb_array_size ( children ) ; i ++ ) {
332+ for (size_t i = 0 ; i < children -> size ; i ++ ) {
333333 AST_NODE_T * child = hb_array_get (children , i );
334334
335335 if (child && child -> type == AST_ERB_WHEN_NODE ) {
@@ -343,7 +343,7 @@ static AST_NODE_T* create_control_node(
343343
344344 hb_array_free (& children );
345345
346- if (hb_array_size ( in_conditions ) > 0 ) {
346+ if (in_conditions -> size > 0 ) {
347347 hb_array_free (& when_conditions );
348348
349349 return (AST_NODE_T * ) ast_erb_case_match_node_init (
@@ -539,7 +539,7 @@ static size_t process_control_structure(
539539 hb_array_T * in_conditions = hb_array_init (8 );
540540 hb_array_T * non_when_non_in_children = hb_array_init (8 );
541541
542- while (index < hb_array_size ( array ) ) {
542+ while (index < array -> size ) {
543543 AST_NODE_T * next_node = hb_array_get (array , index );
544544
545545 if (!next_node ) { break ; }
@@ -555,7 +555,7 @@ static size_t process_control_structure(
555555 index ++ ;
556556 }
557557
558- while (index < hb_array_size ( array ) ) {
558+ while (index < array -> size ) {
559559 AST_NODE_T * next_node = hb_array_get (array , index );
560560
561561 if (!next_node ) { break ; }
@@ -627,7 +627,7 @@ static size_t process_control_structure(
627627
628628 AST_ERB_ELSE_NODE_T * else_clause = NULL ;
629629
630- if (index < hb_array_size ( array ) ) {
630+ if (index < array -> size ) {
631631 AST_NODE_T * next_node = hb_array_get (array , index );
632632
633633 if (next_node && next_node -> type == AST_ERB_CONTENT_NODE ) {
@@ -661,7 +661,7 @@ static size_t process_control_structure(
661661
662662 AST_ERB_END_NODE_T * end_node = NULL ;
663663
664- if (index < hb_array_size ( array ) ) {
664+ if (index < array -> size ) {
665665 AST_NODE_T * potential_end = hb_array_get (array , index );
666666
667667 if (potential_end && potential_end -> type == AST_ERB_CONTENT_NODE ) {
@@ -694,15 +694,15 @@ static size_t process_control_structure(
694694 end_position = end_node -> base .location .end ;
695695 } else if (else_clause ) {
696696 end_position = else_clause -> base .location .end ;
697- } else if (hb_array_size ( when_conditions ) > 0 ) {
697+ } else if (when_conditions -> size > 0 ) {
698698 AST_NODE_T * last_when = hb_array_last (when_conditions );
699699 end_position = last_when -> location .end ;
700- } else if (hb_array_size ( in_conditions ) > 0 ) {
700+ } else if (in_conditions -> size > 0 ) {
701701 AST_NODE_T * last_in = hb_array_last (in_conditions );
702702 end_position = last_in -> location .end ;
703703 }
704704
705- if (hb_array_size ( in_conditions ) > 0 ) {
705+ if (in_conditions -> size > 0 ) {
706706 hb_array_T * case_match_errors = erb_node -> base .errors ;
707707 erb_node -> base .errors = NULL ;
708708
@@ -760,7 +760,7 @@ static size_t process_control_structure(
760760 AST_ERB_ELSE_NODE_T * else_clause = NULL ;
761761 AST_ERB_ENSURE_NODE_T * ensure_clause = NULL ;
762762
763- if (index < hb_array_size ( array ) ) {
763+ if (index < array -> size ) {
764764 AST_NODE_T * next_node = hb_array_get (array , index );
765765
766766 if (next_node && next_node -> type == AST_ERB_CONTENT_NODE ) {
@@ -775,7 +775,7 @@ static size_t process_control_structure(
775775 }
776776 }
777777
778- if (index < hb_array_size ( array ) ) {
778+ if (index < array -> size ) {
779779 AST_NODE_T * next_node = hb_array_get (array , index );
780780
781781 if (next_node && next_node -> type == AST_ERB_CONTENT_NODE ) {
@@ -807,7 +807,7 @@ static size_t process_control_structure(
807807 }
808808 }
809809
810- if (index < hb_array_size ( array ) ) {
810+ if (index < array -> size ) {
811811 AST_NODE_T * next_node = hb_array_get (array , index );
812812
813813 if (next_node && next_node -> type == AST_ERB_CONTENT_NODE ) {
@@ -819,7 +819,7 @@ static size_t process_control_structure(
819819
820820 index ++ ;
821821
822- while (index < hb_array_size ( array ) ) {
822+ while (index < array -> size ) {
823823 AST_NODE_T * child = hb_array_get (array , index );
824824
825825 if (!child ) { break ; }
@@ -855,7 +855,7 @@ static size_t process_control_structure(
855855
856856 AST_ERB_END_NODE_T * end_node = NULL ;
857857
858- if (index < hb_array_size ( array ) ) {
858+ if (index < array -> size ) {
859859 AST_NODE_T * potential_end = hb_array_get (array , index );
860860
861861 if (potential_end && potential_end -> type == AST_ERB_CONTENT_NODE ) {
@@ -922,7 +922,7 @@ static size_t process_control_structure(
922922
923923 AST_ERB_END_NODE_T * end_node = NULL ;
924924
925- if (index < hb_array_size ( array ) ) {
925+ if (index < array -> size ) {
926926 AST_NODE_T * potential_close = hb_array_get (array , index );
927927
928928 if (potential_close && potential_close -> type == AST_ERB_CONTENT_NODE ) {
@@ -954,7 +954,7 @@ static size_t process_control_structure(
954954
955955 if (end_node ) {
956956 end_position = end_node -> base .location .end ;
957- } else if (children && hb_array_size ( children ) > 0 ) {
957+ } else if (children && children -> size > 0 ) {
958958 AST_NODE_T * last_child = hb_array_last (children );
959959 end_position = last_child -> location .end ;
960960 }
@@ -984,7 +984,7 @@ static size_t process_control_structure(
984984 AST_NODE_T * subsequent = NULL ;
985985 AST_ERB_END_NODE_T * end_node = NULL ;
986986
987- if (index < hb_array_size ( array ) ) {
987+ if (index < array -> size ) {
988988 AST_NODE_T * next_node = hb_array_get (array , index );
989989
990990 if (next_node && next_node -> type == AST_ERB_CONTENT_NODE ) {
@@ -997,7 +997,7 @@ static size_t process_control_structure(
997997 }
998998 }
999999
1000- if (index < hb_array_size ( array ) ) {
1000+ if (index < array -> size ) {
10011001 AST_NODE_T * potential_end = hb_array_get (array , index );
10021002
10031003 if (potential_end && potential_end -> type == AST_ERB_CONTENT_NODE ) {
@@ -1059,7 +1059,7 @@ static size_t process_subsequent_block(
10591059 hb_array_free (& children );
10601060 }
10611061
1062- if (index < hb_array_size ( array ) ) {
1062+ if (index < array -> size ) {
10631063 AST_NODE_T * next_node = hb_array_get (array , index );
10641064
10651065 if (next_node && next_node -> type == AST_ERB_CONTENT_NODE ) {
@@ -1117,7 +1117,7 @@ static size_t process_block_children(
11171117 analyze_ruby_context_T * context ,
11181118 control_type_t parent_type
11191119) {
1120- while (index < hb_array_size ( array ) ) {
1120+ while (index < array -> size ) {
11211121 AST_NODE_T * child = hb_array_get (array , index );
11221122
11231123 if (!child ) { break ; }
@@ -1139,7 +1139,7 @@ static size_t process_block_children(
11391139 hb_array_T * temp_array = hb_array_init (1 );
11401140 size_t new_index = process_control_structure (node , array , index , temp_array , context , child_type );
11411141
1142- if (hb_array_size ( temp_array ) > 0 ) { hb_array_append (children_array , hb_array_first (temp_array )); }
1142+ if (temp_array -> size > 0 ) { hb_array_append (children_array , hb_array_first (temp_array )); }
11431143
11441144 hb_array_free (& temp_array );
11451145
@@ -1155,10 +1155,10 @@ static size_t process_block_children(
11551155}
11561156
11571157hb_array_T * rewrite_node_array (AST_NODE_T * node , hb_array_T * array , analyze_ruby_context_T * context ) {
1158- hb_array_T * new_array = hb_array_init (hb_array_size ( array ) );
1158+ hb_array_T * new_array = hb_array_init (array -> size );
11591159 size_t index = 0 ;
11601160
1161- while (index < hb_array_size ( array ) ) {
1161+ while (index < array -> size ) {
11621162 AST_NODE_T * item = hb_array_get (array , index );
11631163
11641164 if (!item ) { break ; }
@@ -1293,7 +1293,7 @@ static bool detect_invalid_erb_structures(const AST_NODE_T* node, void* data) {
12931293 if (if_node -> end_node == NULL ) { check_erb_node_for_missing_end (node ); }
12941294
12951295 if (if_node -> statements != NULL ) {
1296- for (size_t i = 0 ; i < hb_array_size ( if_node -> statements ) ; i ++ ) {
1296+ for (size_t i = 0 ; i < if_node -> statements -> size ; i ++ ) {
12971297 AST_NODE_T * statement = (AST_NODE_T * ) hb_array_get (if_node -> statements , i );
12981298
12991299 if (statement != NULL ) { herb_visit_node (statement , detect_invalid_erb_structures , context ); }
@@ -1325,7 +1325,7 @@ static bool detect_invalid_erb_structures(const AST_NODE_T* node, void* data) {
13251325 const AST_ERB_IF_NODE_T * elsif_node = (const AST_ERB_IF_NODE_T * ) subsequent ;
13261326
13271327 if (elsif_node -> statements != NULL ) {
1328- for (size_t i = 0 ; i < hb_array_size ( elsif_node -> statements ) ; i ++ ) {
1328+ for (size_t i = 0 ; i < elsif_node -> statements -> size ; i ++ ) {
13291329 AST_NODE_T * statement = (AST_NODE_T * ) hb_array_get (elsif_node -> statements , i );
13301330
13311331 if (statement != NULL ) { herb_visit_node (statement , detect_invalid_erb_structures , context ); }
@@ -1337,7 +1337,7 @@ static bool detect_invalid_erb_structures(const AST_NODE_T* node, void* data) {
13371337 const AST_ERB_ELSE_NODE_T * else_node = (const AST_ERB_ELSE_NODE_T * ) subsequent ;
13381338
13391339 if (else_node -> statements != NULL ) {
1340- for (size_t i = 0 ; i < hb_array_size ( else_node -> statements ) ; i ++ ) {
1340+ for (size_t i = 0 ; i < else_node -> statements -> size ; i ++ ) {
13411341 AST_NODE_T * statement = (AST_NODE_T * ) hb_array_get (else_node -> statements , i );
13421342
13431343 if (statement != NULL ) { herb_visit_node (statement , detect_invalid_erb_structures , context ); }
0 commit comments