| 11 | /* ── Helper ──────────────────────────────────────────────────────── */ |
| 12 | |
| 13 | static cbm_ast_profile_t make_profile(void) { |
| 14 | cbm_ast_profile_t p; |
| 15 | memset(&p, 0, sizeof(p)); |
| 16 | p.if_count = 5; |
| 17 | p.for_count = 3; |
| 18 | p.while_count = 1; |
| 19 | p.switch_count = 2; |
| 20 | p.try_count = 0; |
| 21 | p.return_count = 4; |
| 22 | p.max_nesting_depth = 3; |
| 23 | p.avg_nesting_depth_x10 = 15; |
| 24 | p.comparison_ops = 10; |
| 25 | p.arithmetic_ops = 8; |
| 26 | p.logical_ops = 2; |
| 27 | p.assignment_count = 7; |
| 28 | p.string_literals = 3; |
| 29 | p.number_literals = 5; |
| 30 | p.bool_literals = 1; |
| 31 | p.param_count = 4; |
| 32 | p.params_in_returns = 2; |
| 33 | p.params_in_conditions = 1; |
| 34 | p.variable_reassigns = 3; |
| 35 | p.unique_operators = 12; |
| 36 | p.unique_operands = 20; |
| 37 | p.total_operators = 45; |
| 38 | p.total_operands = 60; |
| 39 | p.body_lines = 30; |
| 40 | p.body_tokens = 200; |
| 41 | return p; |
| 42 | } |
| 43 | |
| 44 | /* ── to_str + from_str round-trip ────────────────────────────────── */ |
| 45 | |