Branch Coverage

XS.xs
Criterion Covered Total %
branch 334 428 78.0


line true false branch
18 479 514 if (ch == ' ') return 1;
19 3 511 if (ch == '\t') return 1;
23 183 836 if (ch == '\n') return 1;
24 5 831 if (ch == '\r') return 1;
25 0 831 if (ch == '\f') return 1;
29 511 482 return charIsSpace(ch) || charIsEndspace(ch);
119 392 return charIsSpace(ch) || charIsEndspace(ch);
32 533 266 if ((ch >= 'a') && (ch <= 'z')) return 1;
519 14 if ((ch >= 'a') && (ch <= 'z')) return 1;
33 29 251 if ((ch >= 'A') && (ch <= 'Z')) return 1;
1 28 if ((ch >= 'A') && (ch <= 'Z')) return 1;
34 131 148 if ((ch >= '0') && (ch <= '9')) return 1;
20 111 if ((ch >= '0') && (ch <= '9')) return 1;
35 7 252 if (ch == '_') return 1;
36 2 250 if (ch == '$') return 1;
37 0 250 if (ch == '\\') return 1;
38 0 250 if (ch > 126) return 1;
43 12 297 if (ch == ',') return 1;
44 97 200 if (ch == ';') return 1;
45 0 200 if (ch == ':') return 1;
46 74 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 210 if (ch == '{') return 1;
60 23 187 if (ch == '(') return 1;
61 5 182 if (ch == '[') return 1;
62 0 182 if (ch == '!') return 1;
67 13 155 if (ch == '}') return 1;
68 25 130 if (ch == ')') return 1;
69 3 127 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 449 if (set->next_node >= NODE_SET_SIZE) {
242 0 449 if (node->contents)
251 2 449 if (node->length >= len) {
268 122 18 if (node->prev)
270 125 15 if (node->next)
276 0 415 if (element->next)
285 160 0 if (node->contents && (node->length > 1)) {
57 103 if (node->contents && (node->length > 1)) {
289 78 6 while (offset < node->length) {
290 51 27 if (charIsEndspace(node->contents[offset++])) {
298 51 6 if (hasEndspace) {
319 331 0 while (offset < doc->length) {
320 4 327 if (buf[offset] == '\\') {
326 42 285 if (delimiter == '/') {
327 2 40 if ((buf[offset] == '[') && !in_char_class) {
2 0 if ((buf[offset] == '[') && !in_char_class) {
330 2 40 if ((buf[offset] == ']') && in_char_class) {
2 0 if ((buf[offset] == ']') && in_char_class) {
335 21 306 if ((buf[offset] == delimiter) && !in_char_class) {
20 1 if ((buf[offset] == delimiter) && !in_char_class) {
359 368 0 while (offset < doc->length) {
360 15 353 if (buf[offset] == '*') {
361 15 0 if (buf[offset+1] == '/') {
386 330 2 while ((offset < doc->length) && !charIsEndspace(buf[offset]))
324 6 while ((offset < doc->length) && !charIsEndspace(buf[offset]))
402 589 12 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
441 148 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
412 546 2 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
437 109 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
427 449 35 while ((doc->offset < doc->length) && (doc->buffer[doc->offset])) {
449 0 while ((doc->offset < doc->length) && (doc->buffer[doc->offset])) {
430 34 415 if (!doc->head)
432 34 415 if (!doc->tail)
436 34 415 if (doc->buffer[doc->offset] == '/') {
437 15 19 if (doc->buffer[doc->offset+1] == '*')
439 8 11 else if (doc->buffer[doc->offset+1] == '/')
449 12 14 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
0 14 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
3 11 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
455 2 9 if (nodeIsIDENTIFIER(last) && nodeEquals(last, "return")) {
1 1 if (nodeIsIDENTIFIER(last) && nodeEquals(last, "return")) {
459 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)))) {
469 407 8 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\'') || (doc->buffer[doc->offset] == '`'))
406 1 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\'') || (doc->buffer[doc->offset] == '`'))
2 404 else if ((doc->buffer[doc->offset] == '"') || (doc->buffer[doc->offset] == '\'') || (doc->buffer[doc->offset] == '`'))
471 160 244 else if (charIsWhitespace(doc->buffer[doc->offset]))
473 111 133 else if (charIsIdentifier(doc->buffer[doc->offset]))
482 415 34 if (node != doc->tail)
514 449 34 while (curr) {
523 15 0 if (nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
2 13 if (nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
1 1 if (nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
534 21 4 while (nonws_prev && nodeIsWHITESPACE(nonws_prev))
11 10 while (nonws_prev && nodeIsWHITESPACE(nonws_prev))
536 22 3 while (nonws_next && nodeIsWHITESPACE(nonws_next))
11 11 while (nonws_next && nodeIsWHITESPACE(nonws_next))
539 10 4 if (nonws_prev && nonws_next) {
9 1 if (nonws_prev && nonws_next) {
541 1 8 if (nodeIsIDENTIFIER(nonws_prev) && nodeIsIDENTIFIER(nonws_next))
0 1 if (nodeIsIDENTIFIER(nonws_prev) && nodeIsIDENTIFIER(nonws_next))
544 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,'-'))
546 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,'+'))
550 2 12 if (convert_to_ws) {
583 55 14 if (prev && nodeIsENDSPACE(prev))
2 53 if (prev && nodeIsENDSPACE(prev))
2 0 if (prev && nodeIsENDSPACE(prev))
585 53 14 if (prev && nodeIsWHITESPACE(prev))
0 53 if (prev && nodeIsWHITESPACE(prev))
588 14 53 if (!prev)
591 7 46 if (!next)
597 1 13 if (nodeContains(node, "copyright"))
600 13 0 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
3 10 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
2 1 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
606 2 6 if (nodeContains(node, "copyright"))
609 6 0 if (nodeIsIECONDITIONALLINECOMMENT(node))
0 6 if (nodeIsIECONDITIONALLINECOMMENT(node))
617 137 2 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
61 76 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
61 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
60 1 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
60 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
27 33 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
626 224 0 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
155 69 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
135 20 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
56 79 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
629 168 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
111 57 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
107 4 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev) && prev->prev && !nodeIsLINECOMMENT(prev->prev))
5 102 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))
632 139 26 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
25 114 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,']')))
635 3 157 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,"/"))
637 3 157 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,"/"))
640 9 150 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,'-'))
642 9 150 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 9 146 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,'+'))
647 9 146 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,'+'))
659 474 34 while (curr) {
670 0 3 if (prev == head)
677 18 22 if (curr == head)
678 0 18 head = prev ? prev : next;
680 22 18 curr = prev ? prev : next;
718 1 34 if (!head) return NULL;
723 3 31 if (!head) return NULL;
735 309 31 while (curr) {
745 31 31 while (curr) {
771 31 4 if (buffer != NULL) {