MCPcopy Create free account
hub / github.com/estools/esquery / peg$computeLocation

Function peg$computeLocation

parser.js:382–398  ·  view source on GitHub ↗
(startPos, endPos)

Source from the content-addressed store, hash-verified

380 }
381
382 function peg$computeLocation(startPos, endPos) {
383 var startPosDetails = peg$computePosDetails(startPos),
384 endPosDetails = peg$computePosDetails(endPos);
385
386 return {
387 start: {
388 offset: startPos,
389 line: startPosDetails.line,
390 column: startPosDetails.column
391 },
392 end: {
393 offset: endPos,
394 line: endPosDetails.line,
395 column: endPosDetails.column
396 }
397 };
398 }
399
400 function peg$fail(expected) {
401 if (peg$currPos < peg$maxFailPos) { return; }

Callers 4

locationFunction · 0.85
expectedFunction · 0.85
errorFunction · 0.85
peg$parseFunction · 0.85

Calls 1

peg$computePosDetailsFunction · 0.85

Tested by

no test coverage detected