MCPcopy Create free account
hub / github.com/aradzie/keybr.com / peg$parseSingleLineComment

Function peg$parseSingleLineComment

packages/keybr-code/lib/parser.js:1277–1373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1275 }
1276
1277 function peg$parseSingleLineComment() {
1278 let s0, s1, s2, s3, s4, s5;
1279
1280 s0 = peg$currPos;
1281 if (input.substr(peg$currPos, 2) === peg$c21) {
1282 s1 = peg$c21;
1283 peg$currPos += 2;
1284 } else {
1285 s1 = peg$FAILED;
1286 if (peg$silentFails === 0) { peg$fail(peg$e30); }
1287 }
1288 if (s1 !== peg$FAILED) {
1289 s2 = [];
1290 s3 = peg$currPos;
1291 s4 = peg$currPos;
1292 peg$silentFails++;
1293 if (input.charCodeAt(peg$currPos) === 10) {
1294 s5 = peg$c22;
1295 peg$currPos++;
1296 } else {
1297 s5 = peg$FAILED;
1298 if (peg$silentFails === 0) { peg$fail(peg$e31); }
1299 }
1300 peg$silentFails--;
1301 if (s5 === peg$FAILED) {
1302 s4 = undefined;
1303 } else {
1304 peg$currPos = s4;
1305 s4 = peg$FAILED;
1306 }
1307 if (s4 !== peg$FAILED) {
1308 if (input.length > peg$currPos) {
1309 s5 = input.charAt(peg$currPos);
1310 peg$currPos++;
1311 } else {
1312 s5 = peg$FAILED;
1313 if (peg$silentFails === 0) { peg$fail(peg$e32); }
1314 }
1315 if (s5 !== peg$FAILED) {
1316 s4 = [s4, s5];
1317 s3 = s4;
1318 } else {
1319 peg$currPos = s3;
1320 s3 = peg$FAILED;
1321 }
1322 } else {
1323 peg$currPos = s3;
1324 s3 = peg$FAILED;
1325 }
1326 while (s3 !== peg$FAILED) {
1327 s2.push(s3);
1328 s3 = peg$currPos;
1329 s4 = peg$currPos;
1330 peg$silentFails++;
1331 if (input.charCodeAt(peg$currPos) === 10) {
1332 s5 = peg$c22;
1333 peg$currPos++;
1334 } else {

Callers 1

peg$parseCommentFunction · 0.85

Calls 1

peg$failFunction · 0.85

Tested by

no test coverage detected