Count control-flow statement kinds (if/for/while/switch/try/return). */
| 143 | |
| 144 | /* Count control-flow statement kinds (if/for/while/switch/try/return). */ |
| 145 | static void accumulate_control_flow(const char *kind, cbm_ast_profile_t *out, bool *in_return) { |
| 146 | if (is_control_if(kind)) { |
| 147 | out->if_count++; |
| 148 | } |
| 149 | if (is_control_for(kind)) { |
| 150 | out->for_count++; |
| 151 | } |
| 152 | if (is_control_while(kind)) { |
| 153 | out->while_count++; |
| 154 | } |
| 155 | if (is_control_switch(kind)) { |
| 156 | out->switch_count++; |
| 157 | } |
| 158 | if (is_control_try(kind)) { |
| 159 | out->try_count++; |
| 160 | } |
| 161 | if (is_return(kind)) { |
| 162 | out->return_count++; |
| 163 | *in_return = true; |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | /* Count expression- and literal-class counters for one node. */ |
| 168 | static void accumulate_expressions(const char *kind, cbm_ast_profile_t *out) { |
no test coverage detected