Branch Coverage

XS.xs
Criterion Covered Total %
branch 313 414 75.6


line true false branch
18 233 414 if (ch == ' ') return 1;
19 4 410 if (ch == '\t') return 1;
23 184 849 if (ch == '\n') return 1;
24 0 849 if (ch == '\r') return 1;
25 0 849 if (ch == '\f') return 1;
29 410 237 return charIsSpace(ch) || charIsEndspace(ch);
118 292 return charIsSpace(ch) || charIsEndspace(ch);
32 395 181 if ((ch >= 'a') && (ch <= 'z')) return 1;
383 12 if ((ch >= 'a') && (ch <= 'z')) return 1;
33 27 166 if ((ch >= 'A') && (ch <= 'Z')) return 1;
1 26 if ((ch >= 'A') && (ch <= 'Z')) return 1;
34 96 96 if ((ch >= '0') && (ch <= '9')) return 1;
16 80 if ((ch >= '0') && (ch <= '9')) return 1;
35 7 169 if (ch == '_') return 1;
36 2 167 if (ch == '$') return 1;
37 0 167 if (ch == '\\') return 1;
38 0 167 if (ch > 126) return 1;
43 12 205 if (ch == ',') return 1;
44 62 143 if (ch == ';') return 1;
45 0 143 if (ch == ':') return 1;
46 52 91 if (ch == '=') return 1;
47 0 91 if (ch == '&') return 1;
48 0 91 if (ch == '%') return 1;
49 0 91 if (ch == '*') return 1;
50 0 91 if (ch == '<') return 1;
51 0 91 if (ch == '>') return 1;
52 0 91 if (ch == '?') return 1;
53 0 91 if (ch == '|') return 1;
54 0 91 if (ch == '\n') return 1;
59 12 148 if (ch == '{') return 1;
60 16 132 if (ch == '(') return 1;
61 5 127 if (ch == '[') return 1;
62 0 127 if (ch == '!') return 1;
67 6 110 if (ch == '}') return 1;
68 17 93 if (ch == ')') return 1;
69 3 90 if (ch == ']') return 1;
138 2 31 if (len > node->length)
142 112 0 while (haystack && *haystack) {
112 0 while (haystack && *haystack) {
145 29 83 if (haystack == NULL)
148 2 81 if (strncasecmp(haystack, string, len) == 0)
161 0 58 if (len > node->length)
170 0 4 if (len > node->length)
211 344 0 if (node->contents)
216 214 17 while (head) {
225 132 344 if (node->contents)
244 98 32 if (node->prev)
246 127 3 if (node->next)
253 0 325 if (element->next)
264 130 0 if (node->contents) {
267 144 78 for (idx=0; idxlength; idx++) {
268 52 92 if (charIsEndspace(node->contents[idx])) {
281 0 0 if (node->contents) {
284 0 0 for (idx=0; idxlength; idx++) {
285 0 0 if (charIsEndspace(node->contents[idx])) {
291 0 0 if (ws)
310 321 0 while (offset < doc->length) {
311 2 319 if (buf[offset] == '\\') {
315 14 305 else if (buf[offset] == delimiter) {
338 1430 0 while (offset < doc->length) {
339 35 1395 if (buf[offset] == '*') {
340 26 9 if (buf[offset+1] == '/') {
365 400 2 while ((offset < doc->length) && !charIsEndspace(buf[offset]))
393 7 while ((offset < doc->length) && !charIsEndspace(buf[offset]))
381 354 1 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
225 129 while ((offset < doc->length) && charIsWhitespace(buf[offset]))
391 407 1 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
335 72 while ((offset < doc->length) && charIsIdentifier(buf[offset]))
415 344 20 while ((doc.offset < doc.length) && (doc.buffer[doc.offset])) {
344 0 while ((doc.offset < doc.length) && (doc.buffer[doc.offset])) {
418 19 325 if (!doc.head)
420 19 325 if (!doc.tail)
424 43 301 if (doc.buffer[doc.offset] == '/') {
425 26 17 if (doc.buffer[doc.offset+1] == '*')
427 9 8 else if (doc.buffer[doc.offset+1] == '/')
437 9 11 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
0 11 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
3 8 while (nodeIsWHITESPACE(last) || nodeIsCOMMENT(last))
443 2 6 if (nodeIsIDENTIFIER(last) && nodeEquals(last, "return")) {
1 1 if (nodeIsIDENTIFIER(last) && nodeEquals(last, "return")) {
447 7 0 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
7 0 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
7 0 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
6 1 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
1 5 else if (ch && ((ch == ')') || (ch == '.') || (ch == ']') || (charIsIdentifier(ch)))) {
457 296 5 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\'') || (doc.buffer[doc.offset] == '`'))
295 1 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\'') || (doc.buffer[doc.offset] == '`'))
2 293 else if ((doc.buffer[doc.offset] == '"') || (doc.buffer[doc.offset] == '\'') || (doc.buffer[doc.offset] == '`'))
459 130 163 else if (charIsWhitespace(doc.buffer[doc.offset]))
461 73 90 else if (charIsIdentifier(doc.buffer[doc.offset]))
470 325 19 if (node != doc.tail)
502 344 19 while (curr) {
513 26 0 if (!nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
2 24 if (!nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
1 1 if (!nodeIsIECONDITIONALBLOCKCOMMENT(curr)) {
518 22 14 while (nonws_prev && nodeIsWHITESPACE(nonws_prev))
11 11 while (nonws_prev && nodeIsWHITESPACE(nonws_prev))
520 48 1 while (nonws_next && nodeIsWHITESPACE(nonws_next))
24 24 while (nonws_next && nodeIsWHITESPACE(nonws_next))
523 11 14 if (nonws_prev && nonws_next) {
11 0 if (nonws_prev && nonws_next) {
525 1 10 if (nodeIsIDENTIFIER(nonws_prev) && nodeIsIDENTIFIER(nonws_next))
0 1 if (nodeIsIDENTIFIER(nonws_prev) && nodeIsIDENTIFIER(nonws_next))
528 2 9 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,'-'))
530 2 9 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,'+'))
534 2 23 if (convert_to_ws) {
567 46 16 if (prev && nodeIsENDSPACE(prev))
4 42 if (prev && nodeIsENDSPACE(prev))
4 0 if (prev && nodeIsENDSPACE(prev))
569 42 16 if (prev && nodeIsWHITESPACE(prev))
0 42 if (prev && nodeIsWHITESPACE(prev))
572 16 42 if (!prev)
575 0 42 if (!next)
581 1 23 if (nodeContains(node, "copyright"))
584 23 0 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
2 21 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
1 1 if (nodeIsIECONDITIONALBLOCKCOMMENT(node))
590 1 8 if (nodeContains(node, "copyright"))
593 8 0 if (nodeIsIECONDITIONALLINECOMMENT(node))
1 7 if (nodeIsIECONDITIONALLINECOMMENT(node))
601 94 1 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
45 49 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
45 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
45 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
45 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
21 24 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && next->next && !nodeIsIDENTIFIER(next->next))
610 160 0 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
112 48 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
102 10 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
44 58 if (nodeIsPREFIXSIGIL(node) && next && nodeIsWHITESPACE(next))
613 116 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
73 43 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
73 0 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
3 70 if (nodeIsPOSTFIXSIGIL(node) && prev && nodeIsWHITESPACE(prev))
616 98 15 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
18 80 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
18 0 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
15 3 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
4 11 if (next && nodeIsWHITESPACE(next) && !nodeIsENDSPACE(next) && (nodeIsCHAR(node,')') || nodeIsCHAR(node,'}') || nodeIsCHAR(node,']')))
0 4 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,']')))
619 3 106 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,"/"))
621 3 106 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,"/"))
624 9 99 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,'-'))
626 9 99 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,'-'))
629 9 95 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,'+'))
631 9 95 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,'+'))
643 364 19 while (curr) {
654 0 3 if (prev == head)
661 32 17 if (curr == head)
662 0 32 head = prev ? prev : next;
664 17 32 curr = prev ? prev : next;
691 1 19 if (!head) return NULL;
696 2 17 if (!head) return NULL;
708 214 17 while (curr) {
737 17 3 if (buffer != NULL) {