Branch Coverage

hparser.c
Criterion Covered Total %
branch 853 1092 78.1


line true false branch
140 4 41733 if (p_state->eof)
184 0 41733 if (p_state->pending_end_tag && event != E_TEXT && event != E_COMMENT) {
0 0 if (p_state->pending_end_tag && event != E_TEXT && event != E_COMMENT) {
0 0 if (p_state->pending_end_tag && event != E_TEXT && event != E_COMMENT) {
195 154 41579 p_state->offset += CHR_DIST(end, beg);
196 122 41611 if (line) {
199 718 122 while (s < end) {
200 31 687 if (*s == '\n') {
206 27 95 if (nl)
207 10 17 p_state->column = CHR_DIST(end, nl) - 1;
209 22 73 p_state->column += CHR_DIST(end, beg);
212 32 41701 if (event == E_NONE)
216 4 41697 if (p_state->ms == MS_IGNORE)
221 41567 130 if (p_state->ignore_tags || p_state->report_tags || p_state->ignore_elements) {
41481 86 if (p_state->ignore_tags || p_state->report_tags || p_state->ignore_elements) {
197 41284 if (p_state->ignore_tags || p_state->report_tags || p_state->ignore_elements) {
223 308 105 if (event == E_START || event == E_END) {
62 246 if (event == E_START || event == E_END) {
228 38 129 if (utf8)
232 159 8 if (!CASE_SENSITIVE(p_state))
155 4 if (!CASE_SENSITIVE(p_state))
235 7 160 if (p_state->ignoring_element) {
236 7 0 if (sv_eq(p_state->ignoring_element, tagname)) {
237 0 7 if (event == E_START)
239 7 0 else if (--p_state->ignore_depth == 0) {
250 7 1 if (event == E_START) {
268 7 239 else if (p_state->ignoring_element) {
274 3286 38357 if (!h->cb) {
277 2178 1108 if (!h->cb)
281 26022 13443 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
26022 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 26022 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 26022 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
25515 507 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
25515 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
5 25510 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 5 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
5 25510 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
2 505 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
2 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
2 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 2 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
2 0 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
0 505 if (SvTYPE(h->cb) != SVt_PVAV && !SvTRUE(h->cb)) {
286 8981 30477 if (p_state->unbroken_text && event == E_TEXT) {
4510 4471 if (p_state->unbroken_text && event == E_TEXT) {
288 16 4494 if (!p_state->pend_text)
290 4356 154 if (SvOK(p_state->pend_text)) {
4356 0 if (SvOK(p_state->pend_text)) {
0 4356 if (SvOK(p_state->pend_text)) {
291 2 152 if (p_state->is_cdata != p_state->pend_text_is_cdata) {
304 4358 0 if (!utf8)
307 0 4510 if (utf8 && !SvUTF8(p_state->pend_text))
0 0 if (utf8 && !SvUTF8(p_state->pend_text))
309 4510 0 if (utf8 || !SvUTF8(p_state->pend_text)) {
4510 0 if (utf8 || !SvUTF8(p_state->pend_text)) {
320 4458 30490 else if (p_state->pend_text && SvOK(p_state->pend_text)) {
164 4294 else if (p_state->pend_text && SvOK(p_state->pend_text)) {
164 0 else if (p_state->pend_text && SvOK(p_state->pend_text)) {
0 164 else if (p_state->pend_text && SvOK(p_state->pend_text)) {
327 34947 1 argspec = h->argspec ? SvPV(h->argspec, my_na) : "";
34947 0 argspec = h->argspec ? SvPV(h->argspec, my_na) : "";
329 8945 26003 if (SvTYPE(h->cb) == SVt_PVAV) {
331 502 8443 if (*argspec == ARG_FLAG_FLAT_ARRAY) {
342 0 26003 if (*argspec == ARG_FLAG_FLAT_ARRAY)
348 0 26003 PUSHMARK(SP);
351 115611 34948 for (s = argspec; *s; s++) {
363 94 17 if (num_tokens >= 1) {
368 431 94 for (i = 0; i < num_tokens; i++) {
369 431 0 if (tokens[i].beg) {
371 0 431 if (utf8)
376 0 0 av_push(av, p_state->bool_attr_val
386 33 51 if (num_tokens >= 1 && tokens[0].beg >= beg) {
32 1 if (num_tokens >= 1 && tokens[0].beg >= beg) {
390 369 32 for (i = 0; i < num_tokens; i++) {
391 367 2 if (tokens[i].beg) {
392 13 354 av_push(av, newSViv(CHR_DIST(tokens[i].beg, beg)));
393 13 354 av_push(av, newSViv(CHR_DIST(tokens[i].end, tokens[i].beg)));
409 8099 68 if (num_tokens >= 1) {
412 29 8070 if (utf8)
414 8038 61 if (!CASE_SENSITIVE(p_state) && argcode != ARG_TOKEN0)
8033 5 if (!CASE_SENSITIVE(p_state) && argcode != ARG_TOKEN0)
7951 82 if (!CASE_SENSITIVE(p_state) && argcode != ARG_TOKEN0)
416 21 8078 if (argcode == ARG_TAG && event != E_START) {
10 11 if (argcode == ARG_TAG && event != E_START) {
425 5728 92 if (event == E_START) {
428 5719 9 if (argcode == ARG_ATTR) {
440 18525 5728 for (i = 1; i < num_tokens; i += 2) {
445 37 18488 if (utf8)
447 4269 14256 if (tokens[i+1].beg) {
450 4107 162 if (*beg == '"' || *beg == '\'' || (*beg == '`' && p_state->backquote)) {
2060 2047 if (*beg == '"' || *beg == '\'' || (*beg == '`' && p_state->backquote)) {
14 2046 if (*beg == '"' || *beg == '\'' || (*beg == '`' && p_state->backquote)) {
1 13 if (*beg == '"' || *beg == '\'' || (*beg == '`' && p_state->backquote)) {
455 34 4235 if (utf8)
457 4267 2 if (!p_state->attr_encoded) {
458 20 4247 if (p_state->utf8_mode) {
463 20 4247 if (p_state->utf8_mode)
468 0 14256 if (p_state->bool_attr_val)
474 18512 13 if (!CASE_SENSITIVE(p_state))
18508 4 if (!CASE_SENSITIVE(p_state))
477 18517 8 if (argcode == ARG_ATTR) {
485 4 4 if (array) {
490 0 4 mXPUSHs(attrname);
491 0 4 mXPUSHs(attrval);
496 18 74 else if (argcode == ARG_ATTRARR) {
502 5618 25 if (event == E_START) {
505 18409 5618 for (i = 1; i < num_tokens; i += 2) {
508 0 18409 if (utf8)
510 18399 10 if (!CASE_SENSITIVE(p_state))
18395 4 if (!CASE_SENSITIVE(p_state))
520 115 34514 if (utf8)
525 79 77 if (event == E_TEXT) {
527 23 56 if (utf8)
529 71 8 if (!p_state->is_cdata) {
530 8 63 if (p_state->utf8_mode) {
535 8 63 if (p_state->utf8_mode)
542 25840 53 if (event == E_TEXT) {
543 7 25833 arg = boolSV(p_state->is_cdata);
557 16 58 arg = sv_2mortal(newSViv(offset + CHR_DIST(end, beg)));
561 16 85 arg = sv_2mortal(newSViv(CHR_DIST(end, beg)));
581 0 8319 if (SvUTF8(h->argspec))
596 115584 27 if (push_arg) {
597 366 115218 if (!arg)
600 31113 84471 if (array) {
607 0 84471 XPUSHs(arg);
612 8945 26003 if (array) {
613 8443 502 if (array != (AV*)h->cb)
619 25606 397 if ((enum argcode)*argspec == ARG_SELF && !SvROK(h->cb)) {
25510 96 if ((enum argcode)*argspec == ARG_SELF && !SvROK(h->cb)) {
620 25510 0 char *method = SvPV(h->cb, my_na);
627 26003 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
0 26003 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
0 26003 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
26003 0 if (SvTRUE(ERRSV)) {
26002 1 if (SvTRUE(ERRSV)) {
26002 0 if (SvTRUE(ERRSV)) {
0 26002 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
0 0 if (SvTRUE(ERRSV)) {
1 26002 if (SvTRUE(ERRSV)) {
631 25998 4 FREETMPS;
634 14 34933 if (p_state->skipped_text)
639 38 2230 if (p_state->skipped_text) {
640 20 18 if (event != E_TEXT && p_state->pend_text && SvOK(p_state->pend_text))
2 18 if (event != E_TEXT && p_state->pend_text && SvOK(p_state->pend_text))
0 2 if (event != E_TEXT && p_state->pend_text && SvOK(p_state->pend_text))
0 0 if (event != E_TEXT && p_state->pend_text && SvOK(p_state->pend_text))
0 0 if (event != E_TEXT && p_state->pend_text && SvOK(p_state->pend_text))
642 2 36 if (utf8 && !SvUTF8(p_state->skipped_text))
1 1 if (utf8 && !SvUTF8(p_state->skipped_text))
644 36 2 if (utf8 || !SvUTF8(p_state->skipped_text)) {
35 1 if (utf8 || !SvUTF8(p_state->skipped_text)) {
665 463 0 char *s = SvPV(src, len);
668 0 463 if (SvUTF8(src))
671 0 463 while (isHSPACE(*s))
674 7 456 if (*s == '@') {
677 0 7 while (isHSPACE(*tmp))
679 7 0 if (*tmp == '{') {
683 0 7 while (isHSPACE(*tmp))
688 1267 4 while (s < end) {
689 71 1196 if (isHNAME_FIRST(*s) || *s == '@') {
4 67 if (isHNAME_FIRST(*s) || *s == '@') {
695 4876 1200 while (isHNAME_CHAR(*s))
699 7620 2 for ( arg_name = argname; a < ARG_LITERAL ; ++a, ++arg_name ) {
700 1202 6418 if (strnEQ(*arg_name, name, s - name) &&
1198 4 if (strnEQ(*arg_name, name, s - name) &&
704 1198 2 if (a < ARG_LITERAL) {
708 1194 4 if (a == ARG_LINE || a == ARG_COLUMN) {
5 1189 if (a == ARG_LINE || a == ARG_COLUMN) {
709 5 4 if (!p_state->line)
712 7 1191 if (a == ARG_SKIPPED_TEXT) {
713 5 2 if (!p_state->skipped_text) {
717 1120 78 if (a == ARG_ATTR || a == ARG_ATTRARR) {
4 1116 if (a == ARG_ATTR || a == ARG_ATTRARR) {
718 79 3 if (p_state->argspec_entity_decode != ARG_DTEXT)
721 10 1106 else if (a == ARG_DTEXT) {
729 61 6 else if (*s == '"' || *s == '\'') {
61 0 else if (*s == '"' || *s == '\'') {
732 655 1 while (s < end && *s != *string_beg && *s != '\\')
590 65 while (s < end && *s != *string_beg && *s != '\\')
589 1 while (s < end && *s != *string_beg && *s != '\\')
734 65 2 if (*s == *string_beg) {
738 1 64 if (len > 255)
746 1 1 else if (*s == '\\') {
757 1 1262 while (isHSPACE(*s))
760 7 1255 if (*s == '}' && SvPVX(argspec)[0] == ARG_FLAG_FLAT_ARRAY) {
7 0 if (*s == '}' && SvPVX(argspec)[0] == ARG_FLAG_FLAT_ARRAY) {
763 0 7 while (isHSPACE(*s))
765 0 7 if (s < end)
769 453 809 if (s == end)
771 1 808 if (*s != ',') {
775 32 808 while (isHSPACE(*s))
805 0 4358 SvOK_off(old_pend_text);
822 22777 77 while (s < end) {
823 22746 31 if (!quote && *s == '>')
2934 19812 if (!quote && *s == '>')
825 19757 86 if (*s == '"' || *s == '\'') {
81 19676 if (*s == '"' || *s == '\'') {
826 6 161 if (*s == quote) {
829 161 0 else if (!quote && (prev == ' ' || prev == '=')) {
155 6 else if (!quote && (prev == ' ' || prev == '=')) {
0 155 else if (!quote && (prev == ' ' || prev == '=')) {
843 6 171 if (p_state->strict_comment) {
851 125 0 while (s < end && *s != '-' && *s != '>')
112 13 while (s < end && *s != '-' && *s != '>')
104 8 while (s < end && *s != '-' && *s != '>')
854 0 21 if (s == end) {
855 0 0 FREE_TOKENS;
859 8 13 if (*s == '>') {
861 2 6 if (start_com)
869 0 6 FREE_TOKENS;
875 0 13 if (s == end) {
876 0 0 FREE_TOKENS;
880 12 1 if (*s == '-') {
884 9 3 if (start_com) {
885 0 9 PUSH_TOKEN(start_com, s-2);
894 2 169 else if (p_state->no_dash_dash_comment_end) {
898 16 0 while (s < end && *s != '>')
14 2 while (s < end && *s != '>')
901 2 0 if (s < end) {
915 2226 104 while (s < end && *s != '-')
2131 95 while (s < end && *s != '-')
918 95 104 if (s < end) {
920 78 17 if (*s == '-') {
922 15 78 while (isHSPACE(*s))
924 48 30 if (*s == '>') {
931 30 17 if (s < end) {
937 121 0 if (s == end)
955 32 0 if (ms_stack) {
958 18 32 for (stack_idx = 0; stack_idx <= stack_len; stack_idx++) {
960 18 0 if (svp) {
965 25 18 for (i = 0; i <= tokens_len; i++) {
967 25 0 if (svp) {
969 25 0 char *token_str = SvPV(*svp, len);
971 11 14 if (strEQ(token_str, "include"))
973 4 10 else if (strEQ(token_str, "rcdata"))
975 7 3 else if (strEQ(token_str, "cdata"))
977 2 1 else if (strEQ(token_str, "ignore"))
981 24 1 if (p_state->ms < token)
1001 1 16 if (!p_state->marked_sections)
1010 5 17 while (isHSPACE(*s))
1012 20 17 while (isHNAME_FIRST(*s)) {
1017 97 20 while (isHNAME_CHAR(*s))
1020 19 20 while (isHSPACE(*s))
1022 0 20 if (s == end)
1025 13 7 if (!tokens)
1028 1 19 if (utf8)
1032 1 16 if (*s == '-') {
1034 1 0 if (*s == '-') {
1038 9 0 while (s < end && *s != '-')
8 1 while (s < end && *s != '-')
1040 0 1 if (s == end)
1044 1 0 if (*s == '-') {
1055 16 0 if (*s == '[') {
1059 3 13 if (!tokens) {
1064 4 12 if (!p_state->ms_stack)
1088 185 392 if (*s == '-') {
1093 6 179 if (s == end)
1096 2 177 if (*s != '-')
1103 121 56 return (tmp == s) ? beg : tmp;
1107 17 375 if (*s == '[') {
1111 1 16 if (!tmp)
1117 1 374 if (*s == '>') {
1127 308 66 if (isALPHA(*s)) {
1134 1963 16 while (s < end && isHNAME_CHAR(*s))
1671 292 while (s < end && isHNAME_CHAR(*s))
1137 16 292 if (s == end)
1141 4 23 if (!((decl_id_len == 7 &&
1142 266 0 strnEQx(decl_id, "DOCTYPE", 7, !CASE_SENSITIVE(p_state))) ||
266 0 strnEQx(decl_id, "DOCTYPE", 7, !CASE_SENSITIVE(p_state))) ||
1143 4 0 (decl_id_len == 6 &&
1144 3 1 strnEQx(decl_id, "ENTITY", 6, !CASE_SENSITIVE(p_state)))
3 0 strnEQx(decl_id, "ENTITY", 6, !CASE_SENSITIVE(p_state)))
1152 0 269 PUSH_TOKEN(decl_id, s);
1155 50567 165 while (s < end && isHSPACE(*s))
25413 25154 while (s < end && isHSPACE(*s))
1158 165 25154 if (s == end)
1161 25025 129 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
25025 0 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
0 25025 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
0 0 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
1164 2849 65 while (s < end && *s != *str_beg)
2785 64 while (s < end && *s != *str_beg)
1166 65 64 if (s == end)
1169 0 64 PUSH_TOKEN(str_beg, s);
1171 12405 12620 else if (*s == '-') {
1175 0 12405 if (s == end)
1177 0 12405 if (*s != '-')
1182 62054 0 while (s < end && *s != '-')
49647 12407 while (s < end && *s != '-')
1184 0 12407 if (s == end)
1187 0 12407 if (s == end)
1189 12405 2 if (*s == '-') {
1191 0 12405 PUSH_TOKEN(com_beg, s);
1196 12598 22 else if (*s != '>') {
1200 25705 17 while (s < end && isHNOT_SPACE_GT(*s))
13124 12581 while (s < end && isHNOT_SPACE_GT(*s))
1202 17 12581 if (s == end)
1204 696 11885 PUSH_TOKEN(word_beg, s);
1211 0 22 if (s == end)
1213 22 0 if (*s == '>') {
1216 1 21 FREE_TOKENS;
1221 0 23 FREE_TOKENS;
1225 153 110 FREE_TOKENS;
1231 0 92 if (p_state->strict_comment)
1235 16820 28 while (s < end && *s != '>')
16756 64 while (s < end && *s != '>')
1237 64 28 if (s < end) {
1261 8727 20 if (STRICT_NAMES(p_state)) {
0 8727 if (STRICT_NAMES(p_state)) {
1273 174956 336 while (s < end && isHCTYPE(*s, tag_name_char)) {
166545 8411 while (s < end && isHCTYPE(*s, tag_name_char)) {
1274 684 165861 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
684 0 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
0 684 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
1275 0 0 if ((s + 1) == end)
1277 0 0 if (*(s + 1) == '>')
1282 0 8747 PUSH_TOKEN(beg+1, s); /* tagname */
1284 7311 8747 while (isHSPACE(*s))
1286 367 8380 if (s == end)
1289 38614 6530 while (isHCTYPE(*s, attr_name_first)) {
1293 94 38520 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
94 0 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
4 90 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
1294 0 4 if ((s + 1) == end)
1296 4 0 if (*(s + 1) == '>')
1300 749979 1145 while (s < end && isHCTYPE(*s, attr_name_char)) {
712514 37465 while (s < end && isHCTYPE(*s, attr_name_char)) {
1301 2720 709794 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
2720 0 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
0 2720 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
1302 0 0 if ((s + 1) == end)
1304 0 0 if (*(s + 1) == '>')
1309 1145 37465 if (s == end)
1313 1766 35699 PUSH_TOKEN(attr_name_beg, attr_name_end); /* attr name */
1315 17087 37465 while (isHSPACE(*s))
1317 24 37441 if (s == end)
1320 18366 19075 if (*s == '=') {
1323 97 18366 while (isHSPACE(*s))
1325 32 18334 if (s == end)
1327 7 18327 if (*s == '>') {
1329 0 7 PUSH_TOKEN(s, s);
1332 17487 840 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
15333 2154 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
16 15317 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
1 15 if (*s == '"' || *s == '\'' || (*s == '`' && p_state->backquote)) {
1335 36526 282 while (s < end && *s != *str_beg)
33813 2713 while (s < end && *s != *str_beg)
1337 282 2713 if (s == end)
1340 0 2713 PUSH_TOKEN(str_beg, s);
1344 129032 157 while (s < end && isHNOT_SPACE_GT(*s)) {
113859 15173 while (s < end && isHNOT_SPACE_GT(*s)) {
1345 442 113417 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
441 1 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
1 440 if (*s == '/' && ALLOW_EMPTY_TAG(p_state)) {
1346 0 2 if ((s + 1) == end)
1348 2 0 if (*(s + 1) == '>')
1353 157 15175 if (s == end)
1355 0 15175 PUSH_TOKEN(word_start, s);
1357 15124 17888 while (isHSPACE(*s))
1359 199 17689 if (s == end)
1363 0 19075 PUSH_TOKEN(0, 0); /* boolean attr value */
1367 6521 20 if (ALLOW_EMPTY_TAG(p_state) && *s == '/') {
605 5916 if (ALLOW_EMPTY_TAG(p_state) && *s == '/') {
7 618 if (ALLOW_EMPTY_TAG(p_state) && *s == '/') {
1369 0 7 if (s == end)
1374 6541 0 if (*s == '>') {
1378 7 6534 if (empty_tag) {
1381 6517 17 else if (!p_state->xml_mode) {
1387 45436 6412 for (i = 0; literal_mode_elem[i].len; i++) {
1388 820 44616 if (tag_len == literal_mode_elem[i].len) {
1393 1276 0 while (len) {
1394 309 967 if (toLOWER(*s) != *t)
715 561 if (toLOWER(*s) != *t)
1398 105 456 if (!--len) {
1412 741 5800 FREE_TOKENS;
1416 0 0 FREE_TOKENS;
1420 401 1805 FREE_TOKENS;
1431 2994 17 if (STRICT_NAMES(p_state)) {
0 2994 if (STRICT_NAMES(p_state)) {
1439 3007 4 if (isHCTYPE(*s, name_first)) {
1443 7497 50 while (s < end && isHCTYPE(*s, name_char))
4540 2957 while (s < end && isHCTYPE(*s, name_char))
1447 0 3007 if (p_state->strict_end) {
1448 0 0 while (isHSPACE(*s))
1454 2931 76 if (s < end) {
1455 2931 0 if (*s == '>') {
1466 4 0 else if (!p_state->strict_comment) {
1468 3 1 if (s < end) {
1492 14559 30 while (s < end) {
1493 80 14479 if (*s == '>') {
1497 74 6 if (p_state->xml_mode || p_state->xml_pic) {
2 72 if (p_state->xml_mode || p_state->xml_pic) {
1499 8 0 if (s - beg < 4 || s[-2] != '?')
2 6 if (s - beg < 4 || s[-2] != '?')
1534 33534 6 while (!p_state->eof) {
1541 287 33415 while (p_state->literal_mode) {
1545 2585 119 while (s < end && *s != '<') {
2417 168 while (s < end && *s != '<') {
1549 119 168 if (s == end) {
1558 147 21 if (*s == '/') {
1560 666 111 while (*l && toLOWER(*s) == *l) {
15 651 while (*l && toLOWER(*s) == *l) {
630 36 while (*l && toLOWER(*s) == *l) {
1565 111 36 if (!*l && (strNE(p_state->literal_mode, "plaintext") || p_state->closing_plaintext)) {
2 109 if (!*l && (strNE(p_state->literal_mode, "plaintext") || p_state->closing_plaintext)) {
1 1 if (!*l && (strNE(p_state->literal_mode, "plaintext") || p_state->closing_plaintext)) {
1571 0 110 while (isHSPACE(*s))
1573 101 9 if (*s == '>') {
1575 101 0 if (t != end_text)
1589 8 33416 while (p_state->ms == MS_CDATA || p_state->ms == MS_RCDATA) {
2 33414 while (p_state->ms == MS_CDATA || p_state->ms == MS_RCDATA) {
1590 115 1 while (s < end && *s != ']')
106 9 while (s < end && *s != ']')
1592 9 1 if (*s == ']') {
1595 9 0 if (*s == ']' && *(s + 1) == '>') {
8 1 if (*s == ']' && *(s + 1) == '>') {
1598 8 0 if (t != end_text)
1608 1 1 if (s == end) {
1616 3678119 7429 while (s < end && *s != '<') {
3652134 25985 while (s < end && *s != '<') {
1618 65 3652069 if (p_state->ms && *s == ']') {
8 57 if (p_state->ms && *s == ']') {
1621 8 0 if (*s == ']') {
1623 8 0 if (*s == '>') {
1639 28456 4958 if (s != t) {
1640 21196 7260 if (*s == '<') {
1646 423 6837 if (isHSPACE(*s)) {
1648 774 133 while (s >= t && isHSPACE(*s))
484 290 while (s >= t && isHSPACE(*s))
1653 235633 1204 while (s >= t && !isHSPACE(*s))
230000 5633 while (s >= t && !isHSPACE(*s))
1655 11170 1453 while (s >= t && isHSPACE(*s))
5786 5384 while (s >= t && isHSPACE(*s))
1659 5674 1586 if (s != t)
1665 415 25739 if (end - s < 3)
1674 8747 16992 if (isHNAME_FIRST(*s))
1676 3011 13981 else if (*s == '/')
1678 577 13404 else if (*s == '!')
1680 108 13296 else if (*s == '?')
1686 12442 13296 if (new_pos) {
1687 2731 9711 if (new_pos == t) {
1716 211 10520 if (!p_state->start_document) {
1722 197 10534 if (!chunk) {
1725 151 46 if (p_state->buf && SvOK(p_state->buf)) {
3 148 if (p_state->buf && SvOK(p_state->buf)) {
3 0 if (p_state->buf && SvOK(p_state->buf)) {
0 3 if (p_state->buf && SvOK(p_state->buf)) {
1727 148 0 s = SvPV(p_state->buf, len);
1732 151 0 while (s < end) {
1733 2 149 if (p_state->literal_mode) {
1734 0 2 if (strEQ(p_state->literal_mode, "plaintext") ||
0 0 if (strEQ(p_state->literal_mode, "plaintext") ||
1735 0 0 strEQ(p_state->literal_mode, "xmp") ||
1736 0 0 strEQ(p_state->literal_mode, "iframe") ||
1742 0 0 if (strEQ(p_state->literal_mode, "script") ||
0 0 if (strEQ(p_state->literal_mode, "script") ||
1760 134 15 if (!p_state->strict_comment && !p_state->no_dash_dash_comment_end && *s == '<') {
131 3 if (!p_state->strict_comment && !p_state->no_dash_dash_comment_end && *s == '<') {
3 128 if (!p_state->strict_comment && !p_state->no_dash_dash_comment_end && *s == '<') {
1766 131 15 if (!p_state->strict_comment && *s == '<') {
3 128 if (!p_state->strict_comment && *s == '<') {
1768 3 0 if (s1 == end || isHNAME_FIRST(*s1) || *s1 == '/' || *s1 == '!' || *s1 == '?') {
1 2 if (s1 == end || isHNAME_FIRST(*s1) || *s1 == '/' || *s1 == '!' || *s1 == '?') {
1 0 if (s1 == end || isHNAME_FIRST(*s1) || *s1 == '/' || *s1 == '!' || *s1 == '?') {
1 0 if (s1 == end || isHNAME_FIRST(*s1) || *s1 == '/' || *s1 == '!' || *s1 == '?') {
0 1 if (s1 == end || isHNAME_FIRST(*s1) || *s1 == '/' || *s1 == '!' || *s1 == '?') {
1781 146 2 if (s < end) {
1789 60 137 if (p_state->pend_text && SvOK(p_state->pend_text))
0 60 if (p_state->pend_text && SvOK(p_state->pend_text))
0 0 if (p_state->pend_text && SvOK(p_state->pend_text))
0 0 if (p_state->pend_text && SvOK(p_state->pend_text))
1792 0 197 if (p_state->ignoring_element) {
1801 10 187 if (p_state->line)
1810 5 10529 if (p_state->utf8_mode)
1813 10303 231 if (p_state->buf && SvOK(p_state->buf)) {
107 10196 if (p_state->buf && SvOK(p_state->buf)) {
107 0 if (p_state->buf && SvOK(p_state->buf)) {
0 107 if (p_state->buf && SvOK(p_state->buf)) {
1815 10196 0 beg = SvPV(p_state->buf, len);
1819 321 17 beg = SvPV(chunk, len);
1821 211 127 if (p_state->offset == 0 && DOWARN) {
15 196 if (p_state->offset == 0 && DOWARN) {
1823 14 1 if (p_state->argspec_entity_decode &&
1 13 if (p_state->argspec_entity_decode &&
1824 0 1 !(p_state->attr_encoded && p_state->argspec_entity_decode == ARG_ATTR) &&
10 3 !(p_state->attr_encoded && p_state->argspec_entity_decode == ARG_ATTR) &&
1825 7 3 !p_state->utf8_mode && (
1826 7 0 (!utf8 && len >= 3 && strnEQ(beg, "\xEF\xBB\xBF", 3)) ||
5 2 (!utf8 && len >= 3 && strnEQ(beg, "\xEF\xBB\xBF", 3)) ||
3 5 (!utf8 && len >= 3 && strnEQ(beg, "\xEF\xBB\xBF", 3)) ||
1827 3 0 (utf8 && len >= 6 && strnEQ(beg, "\xC3\xAF\xC2\xBB\xC2\xBF", 6)) ||
2 1 (utf8 && len >= 6 && strnEQ(beg, "\xC3\xAF\xC2\xBB\xC2\xBF", 6)) ||
5 2 (utf8 && len >= 6 && strnEQ(beg, "\xC3\xAF\xC2\xBB\xC2\xBF", 6)) ||
1828 1 4 (!utf8 && probably_utf8_chunk(aTHX_ beg, len))
1834 3 12 if (utf8 && len >= 2 && strnEQ(beg, "\xFF\xFE", 2)) {
3 0 if (utf8 && len >= 2 && strnEQ(beg, "\xFF\xFE", 2)) {
0 3 if (utf8 && len >= 2 && strnEQ(beg, "\xFF\xFE", 2)) {
1837 12 3 if (!utf8 && len >= 4 &&
12 0 if (!utf8 && len >= 4 &&
11 1 if (!utf8 && len >= 4 &&
1838 1 10 (strnEQ(beg, "\x00\x00\xFE\xFF", 4) ||
1844 10 3 else if (!utf8 && len >= 2 &&
10 0 else if (!utf8 && len >= 2 &&
9 1 else if (!utf8 && len >= 2 &&
1845 1 8 (strnEQ(beg, "\xFE\xFF", 2) || strnEQ(beg, "\xFF\xFE", 2))
1853 4 10530 if (!len)
1859 10354 175 if (s == end || p_state->eof) {
8 10346 if (s == end || p_state->eof) {
1860 113 70 if (p_state->buf) {
1861 46 67 SvOK_off(p_state->buf);
1866 10190 156 if (p_state->buf) {
1868 93 10097 if (SvOK(p_state->buf)) {
93 0 if (SvOK(p_state->buf)) {
0 93 if (SvOK(p_state->buf)) {
1873 16 77 if (utf8)
1881 8 148 if (utf8)