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

Function peg$parseInteger

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

Source from the content-addressed store, hash-verified

17272 }
17273
17274 function peg$parseInteger() {
17275 let s0, s1, s2, s3;
17276
17277 s0 = peg$currPos;
17278 if (input.charCodeAt(peg$currPos) === 45) {
17279 s1 = peg$c23;
17280 peg$currPos++;
17281 } else {
17282 s1 = peg$FAILED;
17283 if (peg$silentFails === 0) { peg$fail(peg$e25); }
17284 }
17285 if (s1 === peg$FAILED) {
17286 s1 = null;
17287 }
17288 s2 = [];
17289 s3 = input.charAt(peg$currPos);
17290 if (peg$r11.test(s3)) {
17291 peg$currPos++;
17292 } else {
17293 s3 = peg$FAILED;
17294 if (peg$silentFails === 0) { peg$fail(peg$e122); }
17295 }
17296 if (s3 !== peg$FAILED) {
17297 while (s3 !== peg$FAILED) {
17298 s2.push(s3);
17299 s3 = input.charAt(peg$currPos);
17300 if (peg$r11.test(s3)) {
17301 peg$currPos++;
17302 } else {
17303 s3 = peg$FAILED;
17304 if (peg$silentFails === 0) { peg$fail(peg$e122); }
17305 }
17306 }
17307 } else {
17308 s2 = peg$FAILED;
17309 }
17310 if (s2 !== peg$FAILED) {
17311 peg$savedPos = s0;
17312 s0 = peg$f281(s1, s2);
17313 } else {
17314 peg$currPos = s0;
17315 s0 = peg$FAILED;
17316 }
17317
17318 return s0;
17319 }
17320
17321 function peg$parseBooleanLiteral() {
17322 let s0, s1, s2, s3;

Callers 4

peg$parseQuantifierFunction · 0.85
peg$parseSkipClauseFunction · 0.85
peg$parseLimitClauseFunction · 0.85
peg$parseNumberLiteralFunction · 0.85

Calls 3

peg$failFunction · 0.85
peg$f281Function · 0.85
pushMethod · 0.45

Tested by

no test coverage detected