MCPcopy Index your code
hub / github.com/pegjs/pegjs / peg$parseRule

Function peg$parseRule

lib/parser.js:740–814  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

738 }
739
740 function peg$parseRule() {
741 var s0, s1, s2, s3, s4, s5, s6, s7;
742
743 s0 = peg$currPos;
744 s1 = peg$parseIdentifierName();
745 if (s1 !== peg$FAILED) {
746 s2 = peg$parse__();
747 if (s2 !== peg$FAILED) {
748 s3 = peg$currPos;
749 s4 = peg$parseStringLiteral();
750 if (s4 !== peg$FAILED) {
751 s5 = peg$parse__();
752 if (s5 !== peg$FAILED) {
753 s4 = [s4, s5];
754 s3 = s4;
755 } else {
756 peg$currPos = s3;
757 s3 = peg$FAILED;
758 }
759 } else {
760 peg$currPos = s3;
761 s3 = peg$FAILED;
762 }
763 if (s3 === peg$FAILED) {
764 s3 = null;
765 }
766 if (s3 !== peg$FAILED) {
767 if (input.charCodeAt(peg$currPos) === 61) {
768 s4 = peg$c2;
769 peg$currPos++;
770 } else {
771 s4 = peg$FAILED;
772 if (peg$silentFails === 0) { peg$fail(peg$c3); }
773 }
774 if (s4 !== peg$FAILED) {
775 s5 = peg$parse__();
776 if (s5 !== peg$FAILED) {
777 s6 = peg$parseChoiceExpression();
778 if (s6 !== peg$FAILED) {
779 s7 = peg$parseEOS();
780 if (s7 !== peg$FAILED) {
781 peg$savedPos = s0;
782 s1 = peg$c4(s1, s3, s6);
783 s0 = s1;
784 } else {
785 peg$currPos = s0;
786 s0 = peg$FAILED;
787 }
788 } else {
789 peg$currPos = s0;
790 s0 = peg$FAILED;
791 }
792 } else {
793 peg$currPos = s0;
794 s0 = peg$FAILED;
795 }
796 } else {
797 peg$currPos = s0;

Callers 1

peg$parseGrammarFunction · 0.85

Calls 7

peg$parseIdentifierNameFunction · 0.85
peg$parse__Function · 0.85
peg$parseStringLiteralFunction · 0.85
peg$failFunction · 0.85
peg$parseEOSFunction · 0.85
peg$c4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…