MCPcopy Create free account
hub / github.com/codemix/htmling / advance

Function advance

lib/parser.js:884–902  ·  view source on GitHub ↗
(details, startPos, endPos)

Source from the content-addressed store, hash-verified

882
883 function peg$computePosDetails(pos) {
884 function advance(details, startPos, endPos) {
885 var p, ch;
886
887 for (p = startPos; p < endPos; p++) {
888 ch = input.charAt(p);
889 if (ch === "\n") {
890 if (!details.seenCR) { details.line++; }
891 details.column = 1;
892 details.seenCR = false;
893 } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
894 details.line++;
895 details.column = 1;
896 details.seenCR = true;
897 } else {
898 details.column++;
899 details.seenCR = false;
900 }
901 }
902 }
903
904 if (peg$cachedPos !== pos) {
905 if (peg$cachedPos > pos) {

Callers 1

peg$computePosDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…