Branch Coverage

XS.xs
Criterion Covered Total %
branch 325 420 77.3


line true false branch
18 471 501 if (ch == ' ') return 1;
19 3 498 if (ch == '\t') return 1;
23 131 794 if (ch == '\n') return 1;
24 3 791 if (ch == '\r') return 1;
25 0 791 if (ch == '\f') return 1;
29 498 474 return charIsSpace(ch) || charIsEndspace(ch);
117 381 return charIsSpace(ch) || charIsEndspace(ch);
32 521 255 if ((ch >= 'a') && (ch <= 'z')) return 1;
507 14 if ((ch >= 'a') && (ch <= 'z')) return 1;
33 29 240 if ((ch >= 'A') && (ch <= 'Z')) return 1;
1 28 if ((ch >= 'A') && (ch <= 'Z')) return 1;
34 123 145 if ((ch >= '0') && (ch <= '9')) return 1;
16 107 if ((ch >= '0') && (ch <= '9')) return 1;
35 7 245 if (ch == '_') return 1;
36 2 243 if (ch == '$') return 1;
37 0 243 if (ch == '\\') return 1;
38 0 243 if (ch > 126) return 1;
43 12 293 if (ch == ',') return 1;
44 97 196 if (ch == ';') return 1;
45 0 196 if (ch == ':') return 1;
46 70 126 if (ch == '=') return 1;
47 0 126 if (ch == '&') return 1;
48 0 126 if (ch == '%') return 1;
49 0 126 if (ch == '*') return 1;
50 0 126 if (ch == '<') return 1;
51 0 126 if (ch == '>') return 1;
52 0 126 if (ch == '?') return 1;
53 0 126 if (ch == '|') return 1;
54 0 126 if (ch == '\n') return 1;
59 14 208 if (ch == '{') return 1;
60 23 185 if (ch == '(') return 1;
61 5 180 if (ch == '[') return 1;
62 0 180 if (ch == '!') return 1;
67 13 153 if (ch == '}') return 1;
68 25 128 if (ch == ')') return 1;
69 3 125 if (ch == ']') return 1;
153 2 20 if (len > node->length)
157 40 0 while (haystack && *haystack) {
40 0 while (haystack && *haystack) {
160 17 23 if (haystack == NULL)
163 3 20 if (strncasecmp(haystack, string, len) == 0)
177 0 35 if (len > node->length)
186 0 5 if (len > node->length)
219 0 438 if (set->next_node >= NODE_SET_SIZE) {
242 0 438 if (node->contents)
251 2 438 if (node->length >= len) {
268 122 18 if (node->prev)
270 125 15 if (node->next)
276 0 405 if (element->next)
285 157 0 if (node->contents) {
305 331 0 while (offset < doc->length) {
306 4 327 if (buf[offset] == '\\') {
312 42 285 if (delimiter == '/') {
313 2 40 if ((buf[offset] == '[') && !in_char_class) {
2 0 if ((buf[offset] == '[') && !in_char_class) {
316 2 40 if ((buf[offset] == ']') && in_char_class) {
2 0 if ((buf[offset] == ']') && in_char_class) {
321 21 306 if ((buf[offset] == delimiter) && !in_char_class) {
20 1 if ((buf[offset] == delimiter) && !in_char_class) {
345 368 0 while (offset < doc->length) {
346 15 353 if (buf[offset] == '*') {
347 15 0 if (buf[offset+1] == '/') {
372 330 2 while ((offset < doc->length) && !charIsEndspace(buf[offset]))
324 6 while ((offset < doc->length) && !charIsEndspace(buf[offset]))
388 579 12 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
434 145 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
398 531 1 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
427 104 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
413 438 34 while ((doc->offset < doc->length) && (doc->buffer[doc->offset])) {
438 0 while ((doc->offset < doc->length) && (doc->buffer[doc->offset])) {
416 33 405 if (!doc->head)
418 33 405 if (!doc->tail)
422 34 404 if (doc->buffer[doc->offset] == '/') {
423 15 19 if (doc->buffer[doc->offset+1] == '*')
425 8 11 else if (doc->buffer[doc->offset+1] == '/')
435 12 14 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
0 14 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
3 11 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
441 2 9 if (nodeIsIDENTIFIER(last) && nodeEquals(last, "return")) {
1 1 if (nodeIsIDENTIFIER(last) && nodeEquals(last, "return")) {
445 10 0 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
10 0 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
10 0 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
9 1 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
1 8 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
455 396 8 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\'') || (doc->buffer[doc->offset] == '`'))
395 1 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\'') || (doc->buffer[doc->offset] == '`'))
2 393 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\'') || (doc->buffer[doc->offset] == '`'))
457 157 236 else if (charIsWhitespace(doc->buffer[doc->offset]))
459 105 131 else if (charIsIdentifier(doc->buffer[doc->offset]))
468 405 33 if (node != doc->tail)
500 438 33 while (curr) {
509 15 0 if (nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
2 13 if (nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
1 1 if (nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
520 21 4 while (nonws_prev && nodeIsWHITESPACE(nonws_prev))
11 10 while (nonws_prev && nodeIsWHITESPACE(nonws_prev))
522 22 3 while (nonws_next && nodeIsWHITESPACE(nonws_next))
11 11 while (nonws_next && nodeIsWHITESPACE(nonws_next))
525 10 4 if (nonws_prev && nonws_next) {
9 1 if (nonws_prev && nonws_next) {
527 1 8 if (nodeIsIDENTIFIER(nonws_prev) && nodeIsIDENTIFIER(nonws_next))
0 1 if (nodeIsIDENTIFIER(nonws_prev) && nodeIsIDENTIFIER(nonws_next))
530 2 7 if (nodeIsCHAR(nonws_prev,'-') && nodeIsCHAR(nonws_next,'-'))
2 0 if (nodeIsCHAR(nonws_prev,'-') && nodeIsCHAR(nonws_next,'-'))
1 1 if (nodeIsCHAR(nonws_prev,'-') && nodeIsCHAR(nonws_next,'-'))
1 0 if (nodeIsCHAR(nonws_prev,'-') && nodeIsCHAR(nonws_next,'-'))
532 2 7 if (nodeIsCHAR(nonws_prev,'+') && nodeIsCHAR(nonws_next,'+'))
2 0 if (nodeIsCHAR(nonws_prev,'+') && nodeIsCHAR(nonws_next,'+'))
1 1 if (nodeIsCHAR(nonws_prev,'+') && nodeIsCHAR(nonws_next,'+'))
1 0 if (nodeIsCHAR(nonws_prev,'+') && nodeIsCHAR(nonws_next,'+'))
536 2 12 if (convert_to_ws) {
569 52 14 if (prev && nodeIsENDSPACE(prev))
2 50 if (prev && nodeIsENDSPACE(prev))
2 0 if (prev && nodeIsENDSPACE(prev))
571 50 14 if (prev && nodeIsWHITESPACE(prev))
0 50 if (prev && nodeIsWHITESPACE(prev))
574 14 50 if (!prev)
577 7 43 if (!next)
583 1 13 if (nodeContains(node, "copyright"))
586 13 0 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
3 10 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
2 1 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
592 2 6 if (nodeContains(node, "copyright"))
595 6 0 if (nodeIsIECONDITIONALLINECOMMENT(node))
0 6 if (nodeIsIECONDITIONALLINECOMMENT(node))
603 132 1 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
58 74 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
58 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
58 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
58 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
27 31 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
612 222 0 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
153 69 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
133 20 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
56 77 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
615 166 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
109 57 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
105 4 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
5 100 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
5 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
3 2 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
618 137 26 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
25 112 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
25 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
16 9 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
5 11 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
0 5 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
0 11 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
0 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
0 11 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
0 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
621 3 155 if (nodeIsCHAR(node,'/') && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeEndsWith(prev->prev,"/"))
3 0 if (nodeIsCHAR(node,'/') && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeEndsWith(prev->prev,"/"))
3 0 if (nodeIsCHAR(node,'/') && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeEndsWith(prev->prev,"/"))
0 3 if (nodeIsCHAR(node,'/') && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeEndsWith(prev->prev,"/"))
0 0 if (nodeIsCHAR(node,'/') && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeEndsWith(prev->prev,"/"))
0 0 if (nodeIsCHAR(node,'/') && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeEndsWith(prev->prev,"/"))
623 3 155 if (nodeIsCHAR(node,'/') && next && nodeIsWHITESPACE(next) && next->next && !nodeBeginsWith(next->next,"/"))
3 0 if (nodeIsCHAR(node,'/') && next && nodeIsWHITESPACE(next) && next->next && !nodeBeginsWith(next->next,"/"))
3 0 if (nodeIsCHAR(node,'/') && next && nodeIsWHITESPACE(next) && next->next && !nodeBeginsWith(next->next,"/"))
1 2 if (nodeIsCHAR(node,'/') && next && nodeIsWHITESPACE(next) && next->next && !nodeBeginsWith(next->next,"/"))
1 0 if (nodeIsCHAR(node,'/') && next && nodeIsWHITESPACE(next) && next->next && !nodeBeginsWith(next->next,"/"))
1 0 if (nodeIsCHAR(node,'/') && next && nodeIsWHITESPACE(next) && next->next && !nodeBeginsWith(next->next,"/"))
626 9 148 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
9 0 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
9 0 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
1 8 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
1 0 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
1 0 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
1 0 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
1 0 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
0 1 if (nodeIsCHAR(node,'-') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'-'))
628 9 148 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
9 0 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
9 0 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
5 4 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
5 0 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
5 0 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
5 0 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
1 4 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
0 1 if (nodeIsCHAR(node,'-') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'-'))
631 9 144 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
9 0 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
9 0 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
1 8 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
1 0 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
1 0 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
1 0 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
1 0 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
0 1 if (nodeIsCHAR(node,'+') && prev && nodeIsWHITESPACE(prev) && !nodeIsENDSPACE(prev) && prev->prev && !nodeIsCHAR(prev->prev,'+'))
633 9 144 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
9 0 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
9 0 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
5 4 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
5 0 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
5 0 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
5 0 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
1 4 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
0 1 if (nodeIsCHAR(node,'+') && next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsCHAR(next->next,'+'))
645 463 33 while (curr) {
656 0 3 if (prev == head)
663 18 22 if (curr == head)
664 0 18 head = prev ? prev : next;
666 22 18 curr = prev ? prev : next;
704 1 33 if (!head) return NULL;
709 3 30 if (!head) return NULL;
721 298 30 while (curr) {
731 30 30 while (curr) {
757 30 4 if (buffer != NULL) {