MCPcopy Index your code
hub / github.com/dchester/jsonpath / skipComment

Function skipComment

jsonpath.js:466–520  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

464 }
465
466 function skipComment() {
467 var ch, start;
468
469 start = (index === 0);
470 while (index < length) {
471 ch = source.charCodeAt(index);
472
473 if (isWhiteSpace(ch)) {
474 ++index;
475 } else if (isLineTerminator(ch)) {
476 ++index;
477 if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
478 ++index;
479 }
480 ++lineNumber;
481 lineStart = index;
482 start = true;
483 } else if (ch === 0x2F) { // U+002F is '/'
484 ch = source.charCodeAt(index + 1);
485 if (ch === 0x2F) {
486 ++index;
487 ++index;
488 skipSingleLineComment(2);
489 start = true;
490 } else if (ch === 0x2A) { // U+002A is '*'
491 ++index;
492 ++index;
493 skipMultiLineComment();
494 } else {
495 break;
496 }
497 } else if (start && ch === 0x2D) { // U+002D is '-'
498 // U+003E is '>'
499 if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
500 // '-->' is a single-line comment
501 index += 3;
502 skipSingleLineComment(3);
503 } else {
504 break;
505 }
506 } else if (ch === 0x3C) { // U+003C is '<'
507 if (source.slice(index + 1, index + 4) === '!--') {
508 ++index; // `<`
509 ++index; // `!`
510 ++index; // `-`
511 ++index; // `-`
512 skipSingleLineComment(4);
513 } else {
514 break;
515 }
516 } else {
517 break;
518 }
519 }
520 }
521
522 function scanHexEscape(prefix) {
523 var i, len, ch, code = 0;

Callers 8

scanRegExpFunction · 0.85
collectRegexFunction · 0.85
advanceFunction · 0.85
collectTokenFunction · 0.85
peekLineTerminatorFunction · 0.85
consumeSemicolonFunction · 0.85
parseWithStatementFunction · 0.85
parseProgramFunction · 0.85

Calls 4

isWhiteSpaceFunction · 0.85
isLineTerminatorFunction · 0.85
skipSingleLineCommentFunction · 0.85
skipMultiLineCommentFunction · 0.85

Tested by

no test coverage detected