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

Function peg$parseregex

parser.js:2016–2096  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2014 }
2015
2016 function peg$parseregex() {
2017 var s0, s1, s2, s3, s4;
2018
2019 var key = peg$currPos * 32 + 22,
2020 cached = peg$resultsCache[key];
2021
2022 if (cached) {
2023 peg$currPos = cached.nextPos;
2024
2025 return cached.result;
2026 }
2027
2028 s0 = peg$currPos;
2029 if (input.charCodeAt(peg$currPos) === 47) {
2030 s1 = peg$c74;
2031 peg$currPos++;
2032 } else {
2033 s1 = peg$FAILED;
2034 if (peg$silentFails === 0) { peg$fail(peg$c75); }
2035 }
2036 if (s1 !== peg$FAILED) {
2037 s2 = [];
2038 if (peg$c76.test(input.charAt(peg$currPos))) {
2039 s3 = input.charAt(peg$currPos);
2040 peg$currPos++;
2041 } else {
2042 s3 = peg$FAILED;
2043 if (peg$silentFails === 0) { peg$fail(peg$c77); }
2044 }
2045 if (s3 !== peg$FAILED) {
2046 while (s3 !== peg$FAILED) {
2047 s2.push(s3);
2048 if (peg$c76.test(input.charAt(peg$currPos))) {
2049 s3 = input.charAt(peg$currPos);
2050 peg$currPos++;
2051 } else {
2052 s3 = peg$FAILED;
2053 if (peg$silentFails === 0) { peg$fail(peg$c77); }
2054 }
2055 }
2056 } else {
2057 s2 = peg$FAILED;
2058 }
2059 if (s2 !== peg$FAILED) {
2060 if (input.charCodeAt(peg$currPos) === 47) {
2061 s3 = peg$c74;
2062 peg$currPos++;
2063 } else {
2064 s3 = peg$FAILED;
2065 if (peg$silentFails === 0) { peg$fail(peg$c75); }
2066 }
2067 if (s3 !== peg$FAILED) {
2068 s4 = peg$parseflags();
2069 if (s4 === peg$FAILED) {
2070 s4 = null;
2071 }
2072 if (s4 !== peg$FAILED) {
2073 peg$savedPos = s0;

Callers 1

peg$parseattrValueFunction · 0.85

Calls 3

peg$failFunction · 0.85
peg$parseflagsFunction · 0.85
peg$c78Function · 0.85

Tested by

no test coverage detected