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

Function skipSingleLineComment

jsonpath.js:375–415  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

373 }
374
375 function skipSingleLineComment(offset) {
376 var start, loc, ch, comment;
377
378 start = index - offset;
379 loc = {
380 start: {
381 line: lineNumber,
382 column: index - lineStart - offset
383 }
384 };
385
386 while (index < length) {
387 ch = source.charCodeAt(index);
388 ++index;
389 if (isLineTerminator(ch)) {
390 if (extra.comments) {
391 comment = source.slice(start + offset, index - 1);
392 loc.end = {
393 line: lineNumber,
394 column: index - lineStart - 1
395 };
396 addComment('Line', comment, start, index - 1, loc);
397 }
398 if (ch === 13 && source.charCodeAt(index) === 10) {
399 ++index;
400 }
401 ++lineNumber;
402 lineStart = index;
403 return;
404 }
405 }
406
407 if (extra.comments) {
408 comment = source.slice(start + offset, index);
409 loc.end = {
410 line: lineNumber,
411 column: index - lineStart
412 };
413 addComment('Line', comment, start, index, loc);
414 }
415 }
416
417 function skipMultiLineComment() {
418 var start, loc, ch, comment;

Callers 1

skipCommentFunction · 0.85

Calls 2

isLineTerminatorFunction · 0.85
addCommentFunction · 0.85

Tested by

no test coverage detected