| 751 | #define CBM_PERL_MAX_PARSE_NESTING 128 |
| 752 | |
| 753 | static bool cbm_source_nesting_exceeds(const char *source, int source_len, int cap) { |
| 754 | int depth = 0; |
| 755 | for (int i = 0; i < source_len; i++) { |
| 756 | char c = source[i]; |
| 757 | if (c == '(' || c == '[' || c == '{') { |
| 758 | if (++depth > cap) { |
| 759 | return true; |
| 760 | } |
| 761 | } else if ((c == ')' || c == ']' || c == '}') && depth > 0) { |
| 762 | depth--; |
| 763 | } |
| 764 | } |
| 765 | return false; |
| 766 | } |
| 767 | |
| 768 | /* Best-effort parse-coverage collection (#963). Walks only the has_error paths |
| 769 | * of the tree and records the 1-based line ranges of the TOP-MOST ERROR/MISSING |
no outgoing calls
no test coverage detected