Branch Coverage

lib/Print/Format.xs
Criterion Covered Total %
branch 572 1136 50.3


line true false branch
15 0 0 return (codepoint >= 0x1100 && codepoint <= 0x115F) ||
0 0 return (codepoint >= 0x1100 && codepoint <= 0x115F) ||
16 0 0 (codepoint >= 0x2E80 && codepoint <= 0x2EFF) ||
0 0 (codepoint >= 0x2E80 && codepoint <= 0x2EFF) ||
17 0 0 (codepoint >= 0x2F00 && codepoint <= 0x2FDF) ||
0 0 (codepoint >= 0x2F00 && codepoint <= 0x2FDF) ||
18 0 0 (codepoint >= 0x3000 && codepoint <= 0x303F) ||
0 0 (codepoint >= 0x3000 && codepoint <= 0x303F) ||
19 0 0 (codepoint >= 0x3040 && codepoint <= 0x309F) ||
0 0 (codepoint >= 0x3040 && codepoint <= 0x309F) ||
20 0 0 (codepoint >= 0x30A0 && codepoint <= 0x30FF) ||
0 0 (codepoint >= 0x30A0 && codepoint <= 0x30FF) ||
21 0 0 (codepoint >= 0x3100 && codepoint <= 0x312F) ||
0 0 (codepoint >= 0x3100 && codepoint <= 0x312F) ||
22 0 0 (codepoint >= 0x3130 && codepoint <= 0x318F) ||
0 0 (codepoint >= 0x3130 && codepoint <= 0x318F) ||
23 0 0 (codepoint >= 0x3200 && codepoint <= 0x32FF) ||
0 0 (codepoint >= 0x3200 && codepoint <= 0x32FF) ||
24 0 0 (codepoint >= 0x3400 && codepoint <= 0x4DBF) ||
0 0 (codepoint >= 0x3400 && codepoint <= 0x4DBF) ||
25 0 0 (codepoint >= 0x4E00 && codepoint <= 0x9FFF) ||
0 0 (codepoint >= 0x4E00 && codepoint <= 0x9FFF) ||
0 0 (codepoint >= 0x4E00 && codepoint <= 0x9FFF) ||
26 0 0 (codepoint >= 0xF900 && codepoint <= 0xFAFF);
31 0 12 if (len == 0) return false;
33 8 4 if (first != '*' && first != '|' && first != '-') return false;
7 1 if (first != '*' && first != '|' && first != '-') return false;
7 0 if (first != '*' && first != '|' && first != '-') return false;
39 21 4 while (end > line && (*end == ' ' || *end == '\t' || *end == '\r')) {
1 20 while (end > line && (*end == ' ' || *end == '\t' || *end == '\r')) {
0 20 while (end > line && (*end == ' ' || *end == '\t' || *end == '\r')) {
0 20 while (end > line && (*end == ' ' || *end == '\t' || *end == '\r')) {
54 663 1 while (current <= format_str + len) {
55 638 25 if (*current == '\n' || current == format_str + len) {
1 637 if (*current == '\n' || current == format_str + len) {
57 24 2 if (line_len > 0) {
63 24 0 if (strlen(line_copy) > 0) {
64 2 22 if (*line_count >= capacity) {
93 12 1 while (i < line_count) {
94 0 12 if (strcmp(lines[i], "=") == 0) {
99 0 12 if (is_decorative_line(lines[i])) {
104 12 0 if (i + 1 < line_count) {
117 12 0 while (line_end > spec_line && (*line_end == ' ' || *line_end == '\t')) line_end--;
0 12 while (line_end > spec_line && (*line_end == ' ' || *line_end == '\t')) line_end--;
0 12 while (line_end > spec_line && (*line_end == ' ' || *line_end == '\t')) line_end--;
118 12 0 if (line_end > spec_line && *line_end == '~' && *(line_end - 1) == '~') {
2 10 if (line_end > spec_line && *line_end == '~' && *(line_end - 1) == '~') {
2 0 if (line_end > spec_line && *line_end == '~' && *(line_end - 1) == '~') {
123 58 12 while (*pos) {
124 15 43 if (*pos == '@') {
126 8 7 if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
6 2 if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
0 6 if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
0 0 if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
0 0 if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
131 161 0 while (*pos && *pos == type) {
146 15 while (*pos && *pos == type) {
136 15 0 if (isdigit(*pos)) {
138 30 15 while (isdigit(*pos)) pos++;
142 2 13 if (*pos == ',') {
148 0 15 if (*pos == '.') {
154 4 11 if (*pos == '~' && *(pos + 1) == '~') {
4 0 if (*pos == '~' && *(pos + 1) == '~') {
156 8 0 while (*check_end && (*check_end == ' ' || *check_end == '\t')) check_end++;
4 4 while (*check_end && (*check_end == ' ' || *check_end == '\t')) check_end++;
0 4 while (*check_end && (*check_end == ' ' || *check_end == '\t')) check_end++;
157 0 4 if (*check_end == '\0') {
174 37 6 } else if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
34 3 } else if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
33 1 } else if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
30 3 } else if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
4 26 } else if (*pos == '<' || *pos == '>' || *pos == '|' || *pos == '^' || *pos == '*') {
179 3 14 if (type == '^') {
180 80 0 while (*pos && (*pos == '^' || *pos == '<')) {
0 80 while (*pos && (*pos == '^' || *pos == '<')) {
77 3 while (*pos && (*pos == '^' || *pos == '<')) {
184 60 0 while (*pos && *pos == type) {
46 14 while (*pos && *pos == type) {
190 17 0 if (isdigit(*pos)) {
192 35 17 while (isdigit(*pos)) pos++;
196 0 17 if (*pos == ',') {
202 4 13 if (*pos == '.') {
208 0 17 if (*pos == '~' && *(pos + 1) == '~') {
0 0 if (*pos == '~' && *(pos + 1) == '~') {
210 0 0 while (*check_end && (*check_end == ' ' || *check_end == '\t')) check_end++;
0 0 while (*check_end && (*check_end == ' ' || *check_end == '\t')) check_end++;
0 0 while (*check_end && (*check_end == ' ' || *check_end == '\t')) check_end++;
211 0 0 if (*check_end == '\0') {
239 54 5 while (*check_pos) {
240 49 5 if (*check_pos == '$' || *check_pos == '&' || *check_pos == '@') {
49 0 if (*check_pos == '$' || *check_pos == '&' || *check_pos == '@') {
2 47 if (*check_pos == '$' || *check_pos == '&' || *check_pos == '@') {
247 5 7 if (!has_variables) {
253 20 7 while (*pos) {
254 0 20 if (*pos == '&') {
257 0 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
0 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
0 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
258 0 0 if (pos > name_start) {
271 0 0 if (isspace(*pos)) {
272 0 0 while (*pos && isspace(*pos)) pos++;
0 0 while (*pos && isspace(*pos)) pos++;
274 10 10 } else if (*pos == '$') {
277 78 5 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
73 5 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
0 5 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
278 10 0 if (pos > key_start) {
291 5 5 if (isspace(*pos)) {
292 61 0 while (*pos && isspace(*pos)) pos++;
56 5 while (*pos && isspace(*pos)) pos++;
294 2 8 } else if (*pos == '@') {
298 0 2 if (*pos == '[') {
301 0 0 while (*pos && *pos != ']') pos++;
0 0 while (*pos && *pos != ']') pos++;
302 0 0 if (*pos == ']') {
312 13 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
11 2 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
0 2 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
314 2 0 if (pos > array_start) {
324 0 2 if (prefix) {
329 2 0 if (*pos == '[') {
332 4 0 while (*pos && *pos != ']') pos++;
2 2 while (*pos && *pos != ']') pos++;
333 2 0 if (*pos == ']') {
349 2 0 if (isspace(*pos)) {
350 4 0 while (*pos && isspace(*pos)) pos++;
2 2 while (*pos && isspace(*pos)) pos++;
353 0 8 if (*pos == '[') {
356 0 0 while (*bracket_end && *bracket_end != ']') bracket_end++;
0 0 while (*bracket_end && *bracket_end != ']') bracket_end++;
358 0 0 if (*bracket_end == ']' && *(bracket_end + 1) == '@') {
0 0 if (*bracket_end == ']' && *(bracket_end + 1) == '@') {
367 0 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
0 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
0 0 while (*pos && (isalnum(*pos) || *pos == '_')) pos++;
369 0 0 if (pos > array_start) {
380 0 0 if (*pos == '[') {
383 0 0 while (*pos && *pos != ']') pos++;
0 0 while (*pos && *pos != ']') pos++;
384 0 0 if (*pos == ']') {
401 0 0 if (isspace(*pos)) {
402 0 0 while (*pos && isspace(*pos)) pos++;
0 0 while (*pos && isspace(*pos)) pos++;
409 46 2 while (*pos && *pos != '&' && *pos != '$' && *pos != '@' &&
46 0 while (*pos && *pos != '&' && *pos != '$' && *pos != '@' &&
42 4 while (*pos && *pos != '&' && *pos != '$' && *pos != '@' &&
40 2 while (*pos && *pos != '&' && *pos != '$' && *pos != '@' &&
410 40 0 !(*pos == '[' && strchr(pos, ']') && strchr(pos, '@'))) pos++;
0 0 !(*pos == '[' && strchr(pos, ']') && strchr(pos, '@'))) pos++;
0 0 !(*pos == '[' && strchr(pos, ']') && strchr(pos, '@'))) pos++;
412 8 0 if (pos > text_start) {
419 8 0 while (*trimmed && isspace(*trimmed)) trimmed++;
0 8 while (*trimmed && isspace(*trimmed)) trimmed++;
421 12 4 while (end > text && isspace(*end)) {
8 4 while (end > text && isspace(*end)) {
426 8 0 if (strlen(trimmed) > 0) {
448 24 1 for (i = 0; i < line_count; i++) {
466 16718 350 while (i < len) {
467 7 16711 if (str[i] == '\x1b' && i + 1 < len && str[i+1] == '[') {
7 0 if (str[i] == '\x1b' && i + 1 < len && str[i+1] == '[') {
7 0 if (str[i] == '\x1b' && i + 1 < len && str[i+1] == '[') {
469 23 0 while (i < len && str[i] != 'm') {
16 7 while (i < len && str[i] != 'm') {
472 7 0 if (i < len && str[i] == 'm') {
7 0 if (i < len && str[i] == 'm') {
492 5327 161 while (i < stripped_len) {
495 5327 0 if (c < 0x80) {
498 0 0 } else if (c < 0xC0) {
500 0 0 } else if (c < 0xE0) {
503 0 0 } else if (c < 0xF0) {
504 0 0 if (i + 2 < stripped_len) {
508 0 0 width += is_cjk_codepoint(codepoint) ? 2 : 1;
513 0 0 } else if (c < 0xF8) {
537 274 6 while (orig_pos < byte_len && stripped_pos < stripped_len && current_width < max_width) {
274 0 while (orig_pos < byte_len && stripped_pos < stripped_len && current_width < max_width) {
269 5 while (orig_pos < byte_len && stripped_pos < stripped_len && current_width < max_width) {
538 2 267 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
2 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
2 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
540 7 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
5 2 while (orig_pos < byte_len && text[orig_pos] != 'm') {
543 2 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
2 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
549 214 53 if (stripped[stripped_pos] == ' ' || stripped[stripped_pos] == '\t') {
0 214 if (stripped[stripped_pos] == ' ' || stripped[stripped_pos] == '\t') {
558 267 0 if (c < 0x80) {
561 0 0 } else if (c < 0xC0) {
565 0 0 } else if (c < 0xE0) {
568 0 0 } else if (c < 0xF0) {
569 0 0 if (stripped_pos + 2 < stripped_len) {
573 0 0 char_width = is_cjk_codepoint(codepoint) ? 2 : 1;
583 267 0 if (current_width + char_width <= max_width) {
592 5 6 if (last_space_orig_pos >= 0 && stripped_pos < stripped_len && current_width >= max_width) {
5 0 if (last_space_orig_pos >= 0 && stripped_pos < stripped_len && current_width >= max_width) {
5 0 if (last_space_orig_pos >= 0 && stripped_pos < stripped_len && current_width >= max_width) {
596 5 6 while (orig_pos < byte_len) {
597 0 5 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
0 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
0 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
599 0 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
0 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
602 0 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
0 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
627 1002 99 while (orig_pos < byte_len && stripped_pos < stripped_len && current_width < max_width) {
1002 0 while (orig_pos < byte_len && stripped_pos < stripped_len && current_width < max_width) {
990 12 while (orig_pos < byte_len && stripped_pos < stripped_len && current_width < max_width) {
628 0 990 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
0 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
0 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
630 0 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
0 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
633 0 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
0 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
643 990 0 if (c < 0x80) {
646 0 0 } else if (c < 0xC0) {
650 0 0 } else if (c < 0xE0) {
653 0 0 } else if (c < 0xF0) {
654 0 0 if (stripped_pos + 2 < stripped_len) {
658 0 0 char_width = is_cjk_codepoint(codepoint) ? 2 : 1;
668 990 0 if (current_width + char_width <= max_width) {
677 12 99 while (orig_pos < byte_len) {
678 0 12 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
0 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
0 0 if (text[orig_pos] == '\x1b' && orig_pos + 1 < byte_len && text[orig_pos+1] == '[') {
680 0 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
0 0 while (orig_pos < byte_len && text[orig_pos] != 'm') {
683 0 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
0 0 if (orig_pos < byte_len && text[orig_pos] == 'm') {
701 0 2 if (!SvROK(self_ref)) {
706 0 2 if (SvTYPE(self) != SVt_PVHV) {
711 2 0 int max_width = width_sv && *width_sv ? SvIV(*width_sv) : 80;
2 0 int max_width = width_sv && *width_sv ? SvIV(*width_sv) : 80;
714 2 0 if (!format_sv || !*format_sv || !SvROK(*format_sv)) {
2 0 if (!format_sv || !*format_sv || !SvROK(*format_sv)) {
0 2 if (!format_sv || !*format_sv || !SvROK(*format_sv)) {
720 2 0 if (!line_pairs_sv || !*line_pairs_sv || !SvROK(*line_pairs_sv)) {
2 0 if (!line_pairs_sv || !*line_pairs_sv || !SvROK(*line_pairs_sv)) {
0 2 if (!line_pairs_sv || !*line_pairs_sv || !SvROK(*line_pairs_sv)) {
733 2 0 char *caller_pkg = HvNAME(caller_stash);
2 0 char *caller_pkg = HvNAME(caller_stash);
0 2 char *caller_pkg = HvNAME(caller_stash);
0 0 char *caller_pkg = HvNAME(caller_stash);
2 0 char *caller_pkg = HvNAME(caller_stash);
0 2 char *caller_pkg = HvNAME(caller_stash);
738 18 2 while ((entry = hv_iternext(params))) {
748 24 2 for (int pair_idx = 0; pair_idx < num_pairs; pair_idx++) {
750 24 0 if (!pair_sv || !*pair_sv || !SvROK(*pair_sv)) continue;
24 0 if (!pair_sv || !*pair_sv || !SvROK(*pair_sv)) continue;
0 24 if (!pair_sv || !*pair_sv || !SvROK(*pair_sv)) continue;
755 24 0 bool repeat_line = repeat_line_sv && *repeat_line_sv && SvIV(*repeat_line_sv);
24 0 bool repeat_line = repeat_line_sv && *repeat_line_sv && SvIV(*repeat_line_sv);
4 20 bool repeat_line = repeat_line_sv && *repeat_line_sv && SvIV(*repeat_line_sv);
760 24 0 if (!spec_fields_sv || !*spec_fields_sv || !SvROK(*spec_fields_sv) ||
24 0 if (!spec_fields_sv || !*spec_fields_sv || !SvROK(*spec_fields_sv) ||
24 0 if (!spec_fields_sv || !*spec_fields_sv || !SvROK(*spec_fields_sv) ||
24 0 if (!spec_fields_sv || !*spec_fields_sv || !SvROK(*spec_fields_sv) ||
761 24 0 !content_elements_sv || !*content_elements_sv || !SvROK(*content_elements_sv)) {
0 24 !content_elements_sv || !*content_elements_sv || !SvROK(*content_elements_sv)) {
762 0 0 if (mutable_params) SvREFCNT_dec((SV*)mutable_params);
784 64 24 for (int i = 0; i < num_fields; i++) {
791 39 0 while (has_content || !repeat_line) {
0 0 while (has_content || !repeat_line) {
796 110 36 for (int i = 0; i < num_fields; i++) {
797 3 107 if (field_repeat_states[i].has_remaining) {
806 79 39 for (int i = 0; i < num_elements; i++) {
809 79 0 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
79 0 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
0 79 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
813 79 0 if (!type_sv || !*type_sv) continue;
0 79 if (!type_sv || !*type_sv) continue;
817 40 39 if (strcmp(type, "text") == 0) {
819 40 0 if (content_sv && *content_sv) {
40 0 if (content_sv && *content_sv) {
822 28 11 } else if (strcmp(type, "param") == 0) {
824 28 0 if (key_sv && *key_sv) {
28 0 if (key_sv && *key_sv) {
827 28 0 if (param_sv && *param_sv) {
28 0 if (param_sv && *param_sv) {
833 0 11 } else if (strcmp(type, "callback") == 0) {
835 0 0 if (name_sv && *name_sv && caller_pkg) {
0 0 if (name_sv && *name_sv && caller_pkg) {
0 0 if (name_sv && *name_sv && caller_pkg) {
841 0 0 PUSHMARK(SP);
843 0 0 XPUSHs(sv_2mortal(newRV_inc((SV*)params)));
853 0 0 if (count > 0) {
855 0 0 if (SvOK(result_sv)) {
865 0 0 FREETMPS;
869 11 0 } else if (strcmp(type, "array") == 0) {
870 3 8 if (has_field_repeat_content) {
877 0 79 if (!element_values[i]) {
893 68 28 for (int i = 0; i < num_elements; i++) {
895 68 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
68 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
68 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
898 68 0 if (elem_type_sv && *elem_type_sv && strcmp(SvPV_nolen(*elem_type_sv), "array") == 0) {
68 0 if (elem_type_sv && *elem_type_sv && strcmp(SvPV_nolen(*elem_type_sv), "array") == 0) {
11 57 if (elem_type_sv && *elem_type_sv && strcmp(SvPV_nolen(*elem_type_sv), "array") == 0) {
900 11 0 if (join_sv && *join_sv) {
11 0 if (join_sv && *join_sv) {
909 122 39 for (int field_idx = 0; field_idx < num_fields; field_idx++) {
911 122 0 if (!field_sv || !*field_sv || !SvROK(*field_sv)) continue;
122 0 if (!field_sv || !*field_sv || !SvROK(*field_sv)) continue;
0 122 if (!field_sv || !*field_sv || !SvROK(*field_sv)) continue;
920 122 0 if (!type_sv || !*type_sv || !percentage_sv || !*percentage_sv) continue;
122 0 if (!type_sv || !*type_sv || !percentage_sv || !*percentage_sv) continue;
122 0 if (!type_sv || !*type_sv || !percentage_sv || !*percentage_sv) continue;
0 122 if (!type_sv || !*type_sv || !percentage_sv || !*percentage_sv) continue;
924 122 0 bool connect_next = connect_next_sv && *connect_next_sv && SvIV(*connect_next_sv);
122 0 bool connect_next = connect_next_sv && *connect_next_sv && SvIV(*connect_next_sv);
8 114 bool connect_next = connect_next_sv && *connect_next_sv && SvIV(*connect_next_sv);
925 122 0 bool repeat_field = repeat_field_sv && *repeat_field_sv && SvIV(*repeat_field_sv);
122 0 bool repeat_field = repeat_field_sv && *repeat_field_sv && SvIV(*repeat_field_sv);
36 86 bool repeat_field = repeat_field_sv && *repeat_field_sv && SvIV(*repeat_field_sv);
926 122 0 bool word_break = word_break_sv && *word_break_sv && SvIV(*word_break_sv);
122 0 bool word_break = word_break_sv && *word_break_sv && SvIV(*word_break_sv);
11 111 bool word_break = word_break_sv && *word_break_sv && SvIV(*word_break_sv);
927 122 0 int field_width = percentage > 0 ? (max_width * percentage / 100) : max_width;
930 0 122 if (visual_pos + field_width > max_width) {
934 0 122 if (field_width <= 0) continue;
939 122 0 bool has_at_prefix = (has_at_sv && *has_at_sv && SvIV(*has_at_sv));
122 0 bool has_at_prefix = (has_at_sv && *has_at_sv && SvIV(*has_at_sv));
58 64 bool has_at_prefix = (has_at_sv && *has_at_sv && SvIV(*has_at_sv));
945 3 119 if (field_repeat_states[field_idx].has_remaining) {
950 8 111 } else if (*field_type == '*') {
951 8 0 if (element_idx < num_elements && element_values[element_idx]) {
8 0 if (element_idx < num_elements && element_values[element_idx]) {
955 97 14 } else if (*field_type == '^' || has_at_prefix) {
55 42 } else if (*field_type == '^' || has_at_prefix) {
956 69 0 for (int i = element_idx; i < num_elements; i++) {
958 69 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
69 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
69 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
961 69 0 if (elem_type_sv && *elem_type_sv) {
69 0 if (elem_type_sv && *elem_type_sv) {
963 41 28 if (strcmp(elem_type, "param") == 0 ||
964 0 41 strcmp(elem_type, "callback") == 0) {
968 41 0 } else if (strcmp(elem_type, "array") == 0) {
969 9 32 if (has_field_repeat_content && !field_repeat_states[field_idx].has_remaining && array_join_char && field_idx > 0) {
9 0 if (has_field_repeat_content && !field_repeat_states[field_idx].has_remaining && array_join_char && field_idx > 0) {
9 0 if (has_field_repeat_content && !field_repeat_states[field_idx].has_remaining && array_join_char && field_idx > 0) {
9 0 if (has_field_repeat_content && !field_repeat_states[field_idx].has_remaining && array_join_char && field_idx > 0) {
974 32 0 if (name_sv && *name_sv) {
32 0 if (name_sv && *name_sv) {
978 32 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
32 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
32 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
32 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
982 24 8 int use_row_idx = repeat_line ? row_idx : 0;
984 32 0 if (use_row_idx < outer_len) {
990 32 0 if (row_sv && *row_sv && SvROK(*row_sv) && SvTYPE(SvRV(*row_sv)) == SVt_PVAV) {
32 0 if (row_sv && *row_sv && SvROK(*row_sv) && SvTYPE(SvRV(*row_sv)) == SVt_PVAV) {
24 8 if (row_sv && *row_sv && SvROK(*row_sv) && SvTYPE(SvRV(*row_sv)) == SVt_PVAV) {
24 0 if (row_sv && *row_sv && SvROK(*row_sv) && SvTYPE(SvRV(*row_sv)) == SVt_PVAV) {
999 32 0 if (array_item_idx < row_len) {
1001 32 0 if (item_sv && *item_sv) {
32 0 if (item_sv && *item_sv) {
1004 0 32 char *prefix = (prefix_sv && *prefix_sv) ? SvPV_nolen(*prefix_sv) : "";
0 0 char *prefix = (prefix_sv && *prefix_sv) ? SvPV_nolen(*prefix_sv) : "";
1005 32 0 char *join_char = (join_sv && *join_sv) ? SvPV_nolen(*join_sv) : "";
32 0 char *join_char = (join_sv && *join_sv) ? SvPV_nolen(*join_sv) : "";
1015 24 8 current_join_char = (array_item_idx > 0 && strlen(join_char) > 0) ? join_char : NULL;
24 0 current_join_char = (array_item_idx > 0 && strlen(join_char) > 0) ? join_char : NULL;
1028 53 10 for (int i = element_idx; i < num_elements; i++) {
1030 53 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
53 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
53 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
1033 53 0 if (elem_type_sv && *elem_type_sv) {
53 0 if (elem_type_sv && *elem_type_sv) {
1035 32 21 if (strcmp(elem_type, "text") == 0) {
1047 11 111 char *truncated = word_break ? truncate_to_width_word_aware(content, field_width) : truncate_to_width(content, field_width);
1052 36 86 if (repeat_field) {
1056 9 27 if (word_break && skip_bytes < content_len) {
3 6 if (word_break && skip_bytes < content_len) {
1057 6 0 while (skip_bytes < content_len && (content[skip_bytes] == ' ' || content[skip_bytes] == '\t')) {
3 3 while (skip_bytes < content_len && (content[skip_bytes] == ' ' || content[skip_bytes] == '\t')) {
0 3 while (skip_bytes < content_len && (content[skip_bytes] == ' ' || content[skip_bytes] == '\t')) {
1062 3 33 if (skip_bytes < content_len && strlen(content + skip_bytes) > 0) {
3 0 if (skip_bytes < content_len && strlen(content + skip_bytes) > 0) {
1067 3 119 if (using_repeat_content) {
1068 3 0 if (field_repeat_states[field_idx].remaining_content) {
1073 2 1 field_repeat_states[field_idx].has_remaining = (remaining_after_truncate != NULL && strlen(remaining_after_truncate) > 0);
2 0 field_repeat_states[field_idx].has_remaining = (remaining_after_truncate != NULL && strlen(remaining_after_truncate) > 0);
1074 1 118 } else if (remaining_after_truncate && strlen(remaining_after_truncate) > 0) {
1 0 } else if (remaining_after_truncate && strlen(remaining_after_truncate) > 0) {
1078 0 118 } else if (remaining_after_truncate) {
1083 14 108 if (is_mutable_field && mutable_params && matched_element_idx >= 0 && matched_element_idx < num_elements) {
14 0 if (is_mutable_field && mutable_params && matched_element_idx >= 0 && matched_element_idx < num_elements) {
14 0 if (is_mutable_field && mutable_params && matched_element_idx >= 0 && matched_element_idx < num_elements) {
14 0 if (is_mutable_field && mutable_params && matched_element_idx >= 0 && matched_element_idx < num_elements) {
1085 14 0 if (element_sv && *element_sv && SvROK(*element_sv)) {
14 0 if (element_sv && *element_sv && SvROK(*element_sv)) {
14 0 if (element_sv && *element_sv && SvROK(*element_sv)) {
1088 14 0 if (type_sv && *type_sv && strcmp(SvPV_nolen(*type_sv), "param") == 0) {
14 0 if (type_sv && *type_sv && strcmp(SvPV_nolen(*type_sv), "param") == 0) {
14 0 if (type_sv && *type_sv && strcmp(SvPV_nolen(*type_sv), "param") == 0) {
1090 14 0 if (key_sv && *key_sv) {
14 0 if (key_sv && *key_sv) {
1101 760 2 while (skip_bytes < content_len && chars_counted < stripped_truncated_len) {
748 12 while (skip_bytes < content_len && chars_counted < stripped_truncated_len) {
1102 0 748 if (content[skip_bytes] == '\x1b' && skip_bytes + 1 < content_len && content[skip_bytes+1] == '[') {
0 0 if (content[skip_bytes] == '\x1b' && skip_bytes + 1 < content_len && content[skip_bytes+1] == '[') {
0 0 if (content[skip_bytes] == '\x1b' && skip_bytes + 1 < content_len && content[skip_bytes+1] == '[') {
1104 0 0 while (skip_bytes < content_len && content[skip_bytes] != 'm') {
0 0 while (skip_bytes < content_len && content[skip_bytes] != 'm') {
1107 0 0 if (skip_bytes < content_len && content[skip_bytes] == 'm') {
0 0 if (skip_bytes < content_len && content[skip_bytes] == 'm') {
1114 748 0 if (c < 0x80) {
1116 0 0 } else if (c < 0xC0) {
1118 0 0 } else if (c < 0xE0) {
1120 0 0 } else if (c < 0xF0) {
1132 14 0 if (skip_bytes > 0) {
1141 33 89 if (current_join_char && strlen(current_join_char) > 0) {
33 0 if (current_join_char && strlen(current_join_char) > 0) {
1143 33 0 if (current_pos + join_len < max_width) {
1146 33 0 if (current_pos + join_len < max_width) {
1153 55 67 if (*field_type == '<') {
1155 6 49 if (connect_next) {
1165 14 53 } else if (*field_type == '^') {
1167 0 14 if (connect_next) {
1177 24 29 } else if (*field_type == '>') {
1178 2 22 if (connect_next) {
1180 0 2 if (start_pos < current_pos + join_offset) start_pos = current_pos + join_offset;
1186 0 22 if (start_pos < current_pos + join_offset) start_pos = current_pos + join_offset;
1191 21 8 } else if (*field_type == '|') {
1196 0 21 if (start_pos < current_pos + join_offset) start_pos = current_pos + join_offset;
1197 0 21 if (start_pos + truncated_len > current_pos + field_width) {
1199 0 0 if (start_pos < current_pos + join_offset) start_pos = current_pos + join_offset;
1202 21 0 if (join_offset < field_width) {
1205 18 3 if (truncated_len > 0 && start_pos + truncated_len <= current_pos + buffer_size) {
18 0 if (truncated_len > 0 && start_pos + truncated_len <= current_pos + buffer_size) {
1210 8 0 } else if (*field_type == '*') {
1211 8 0 if (strlen(content) > 0) {
1215 800 8 while (pos_in_field < field_width) {
1232 108 14 if (*field_type != '^' && matched_element_idx >= 0 && !has_field_repeat_content) {
89 19 if (*field_type != '^' && matched_element_idx >= 0 && !has_field_repeat_content) {
80 9 if (*field_type != '^' && matched_element_idx >= 0 && !has_field_repeat_content) {
1234 80 0 if (matched_element_idx < num_elements) {
1236 80 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
80 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
80 0 if (elem_sv && *elem_sv && SvROK(*elem_sv)) {
1239 80 0 if (elem_type_sv && *elem_type_sv && strcmp(SvPV_nolen(*elem_type_sv), "array") == 0) {
80 0 if (elem_type_sv && *elem_type_sv && strcmp(SvPV_nolen(*elem_type_sv), "array") == 0) {
32 48 if (elem_type_sv && *elem_type_sv && strcmp(SvPV_nolen(*elem_type_sv), "array") == 0) {
1245 48 32 if (!is_array_element) {
1260 3903 38 while (output_bytes < buf_len && visible_count < max_width) {
3902 1 while (output_bytes < buf_len && visible_count < max_width) {
1261 2 3900 if (line_buffer[output_bytes] == '\x1b' && output_bytes + 1 < buf_len && line_buffer[output_bytes+1] == '[') {
2 0 if (line_buffer[output_bytes] == '\x1b' && output_bytes + 1 < buf_len && line_buffer[output_bytes+1] == '[') {
2 0 if (line_buffer[output_bytes] == '\x1b' && output_bytes + 1 < buf_len && line_buffer[output_bytes+1] == '[') {
1263 7 0 while (output_bytes < buf_len && line_buffer[output_bytes] != 'm') {
5 2 while (output_bytes < buf_len && line_buffer[output_bytes] != 'm') {
1266 2 0 if (output_bytes < buf_len && line_buffer[output_bytes] == 'm') {
2 0 if (output_bytes < buf_len && line_buffer[output_bytes] == 'm') {
1273 3900 0 if (c < 0x80) {
1275 0 0 } else if (c < 0xC0) {
1277 0 0 } else if (c < 0xE0) {
1279 0 0 } else if (c < 0xF0) {
1287 0 39 if (result_len + output_bytes + 2 >= result_capacity) {
1298 79 39 for (int i = 0; i < num_elements; i++) {
1299 79 0 if (element_values[i]) free(element_values[i]);
1304 110 36 for (int i = 0; i < num_fields; i++) {
1305 3 107 if (field_repeat_states[i].has_remaining) {
1311 3 36 if (has_field_repeat) {
1317 16 20 if (repeat_line) {
1318 24 12 for (int i = 0; i < num_elements; i++) {
1320 24 0 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
24 0 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
0 24 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
1324 24 0 if (!type_sv || !*type_sv) continue;
0 24 if (!type_sv || !*type_sv) continue;
1327 6 18 if (strcmp(type, "array") == 0) {
1329 6 0 if (name_sv && *name_sv) {
6 0 if (name_sv && *name_sv) {
1332 6 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
6 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
6 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
6 0 if (array_sv && *array_sv && SvROK(*array_sv) && SvTYPE(SvRV(*array_sv)) == SVt_PVAV) {
1336 4 2 if (row_idx + 1 < outer_len) {
1340 24 4 for (int j = 0; j < num_fields; j++) {
1341 0 24 if (field_repeat_states[j].remaining_content) {
1354 12 4 if (!has_content && mutable_params && any_content_consumed) {
12 0 if (!has_content && mutable_params && any_content_consumed) {
10 2 if (!has_content && mutable_params && any_content_consumed) {
1355 10 2 for (int i = 0; i < num_elements; i++) {
1357 10 0 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
10 0 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
0 10 if (!element_sv || !*element_sv || !SvROK(*element_sv)) continue;
1361 10 0 if (!type_sv || !*type_sv) continue;
0 10 if (!type_sv || !*type_sv) continue;
1364 10 0 if (strcmp(type, "param") == 0) {
1366 10 0 if (key_sv && *key_sv) {
10 0 if (key_sv && *key_sv) {
1369 10 0 if (param_sv && *param_sv && SvOK(*param_sv)) {
10 0 if (param_sv && *param_sv && SvOK(*param_sv)) {
10 0 if (param_sv && *param_sv && SvOK(*param_sv)) {
1371 10 0 if (remaining && strlen(remaining) > 0) {
8 2 if (remaining && strlen(remaining) > 0) {
1382 16 20 if (repeat_line && !has_content) break;
4 12 if (repeat_line && !has_content) break;
1383 20 12 if (!repeat_line && !has_field_repeat) break;
20 0 if (!repeat_line && !has_field_repeat) break;
1387 64 24 for (int i = 0; i < num_fields; i++) {
1388 0 64 if (field_repeat_states[i].remaining_content) {
1396 2 0 if (mutable_params) {
1419 1 0 if (!GvIOp(gv)) {
1436 1 0 if (SvROK(self_ref)) {
1445 0 1 if (!SvROK(self_ref)) {
1449 0 1 if (SvTYPE(self) != SVt_PVHV) {
1458 1 0 if (fh_sv && *fh_sv && SvOK(*fh_sv)) {
1 0 if (fh_sv && *fh_sv && SvOK(*fh_sv)) {
1 0 if (fh_sv && *fh_sv && SvOK(*fh_sv)) {
1459 1 0 if (SvPOK(*fh_sv)) {
1461 1 0 if (strcmp(fh_name, "STDOUT") == 0 && handle_sv && *handle_sv) {
1 0 if (strcmp(fh_name, "STDOUT") == 0 && handle_sv && *handle_sv) {
1 0 if (strcmp(fh_name, "STDOUT") == 0 && handle_sv && *handle_sv) {
1463 1 0 if (GvIOp(out)) {
1468 0 0 } else if (strcmp(fh_name, "STDERR") == 0 && handle_sv && *handle_sv) {
0 0 } else if (strcmp(fh_name, "STDERR") == 0 && handle_sv && *handle_sv) {
0 0 } else if (strcmp(fh_name, "STDERR") == 0 && handle_sv && *handle_sv) {
1470 0 0 if (GvIOp(err)) {
1477 0 0 if (!fh) {
1480 0 0 if (handle_sv && *handle_sv) {
0 0 if (handle_sv && *handle_sv) {
1485 0 0 SV *fh_sv_new = newRV_noinc((SV*)handle_sv && *handle_sv ? (SV*)*handle_sv : newSV(0));
0 0 SV *fh_sv_new = newRV_noinc((SV*)handle_sv && *handle_sv ? (SV*)*handle_sv : newSV(0));
1490 0 1 RETVAL = 1;
1497 0 2 if (!SvROK(self_ref)) {
1501 0 2 if (SvTYPE(self) != SVt_PVHV) {
1505 2 0 if (!fh_sv || !*fh_sv) {
0 2 if (!fh_sv || !*fh_sv) {
1510 18 2 for (i = 1; i < items; i += 2) {
1511 0 18 if (i + 1 >= items) {
1520 2 0 if (to_print) {
1521 2 0 if (SvPOK(*fh_sv)) {
1522 2 0 if (strcmp(SvPV_nolen(*fh_sv), "STDOUT") == 0) {
1525 0 0 } else if (strcmp(SvPV_nolen(*fh_sv), "STDERR") == 0) {
1533 0 0 if (handle_sv && *handle_sv) {
0 0 if (handle_sv && *handle_sv) {
1536 0 0 if (fh) {
1554 0 1 PUSHMARK(SP);
1555 0 1 XPUSHs(self_ref);
1558 1 0 FREETMPS;
1564 0 2 if (!SvROK(self_ref)) {
1568 0 2 if (SvTYPE(self) != SVt_PVHV) {
1572 2 0 if (fh_sv && *fh_sv && SvOK(*fh_sv)) {
2 0 if (fh_sv && *fh_sv && SvOK(*fh_sv)) {
2 0 if (fh_sv && *fh_sv && SvOK(*fh_sv)) {
1573 2 0 if (SvPOK(*fh_sv)) {
1575 2 0 if (strcmp(fh_name, "STDOUT") == 0) {
1577 2 0 if (orig_handle_sv && *orig_handle_sv && SvROK(*orig_handle_sv)) {
2 0 if (orig_handle_sv && *orig_handle_sv && SvROK(*orig_handle_sv)) {
1 1 if (orig_handle_sv && *orig_handle_sv && SvROK(*orig_handle_sv)) {
1582 0 0 } else if (strcmp(fh_name, "STDERR") == 0) {
1584 0 0 if (orig_handle_sv && *orig_handle_sv && SvROK(*orig_handle_sv)) {
0 0 if (orig_handle_sv && *orig_handle_sv && SvROK(*orig_handle_sv)) {
0 0 if (orig_handle_sv && *orig_handle_sv && SvROK(*orig_handle_sv)) {
1592 0 0 if (handle_sv && *handle_sv) {
0 0 if (handle_sv && *handle_sv) {
1595 0 0 if (fh) {
1605 2 0 char *pkg = HvNAME((HV*)CopSTASH(PL_curcop));
2 0 char *pkg = HvNAME((HV*)CopSTASH(PL_curcop));
0 2 char *pkg = HvNAME((HV*)CopSTASH(PL_curcop));
0 0 char *pkg = HvNAME((HV*)CopSTASH(PL_curcop));
2 0 char *pkg = HvNAME((HV*)CopSTASH(PL_curcop));
0 2 char *pkg = HvNAME((HV*)CopSTASH(PL_curcop));
1609 1 2 for (i = 1; i < items; i++) {
1611 0 1 if (strcmp(ex, "all") == 0) {
1613 1 0 } else if (strcmp(ex, "form") == 0) {