MCPcopy Create free account
hub / github.com/codemix/graph / peg$throw

Function peg$throw

packages/graph/src/grammar.js:18267–18279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18265
18266 const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
18267 function peg$throw() {
18268 if (peg$result !== peg$FAILED && peg$currPos < input.length) {
18269 peg$fail(peg$endExpectation());
18270 }
18271
18272 throw peg$buildStructuredError(
18273 peg$maxFailExpected,
18274 peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
18275 peg$maxFailPos < input.length
18276 ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
18277 : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
18278 );
18279 }
18280 if (options.peg$library) {
18281 return /** @type {any} */ ({
18282 peg$result,

Callers 1

peg$parseFunction · 0.85

Calls 5

peg$failFunction · 0.85
peg$endExpectationFunction · 0.85
peg$buildStructuredErrorFunction · 0.85
peg$getUnicodeFunction · 0.85
peg$computeLocationFunction · 0.85

Tested by

no test coverage detected