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

Function peg$parse

lib/parser.js:139–5035  ·  view source on GitHub ↗
(input, options)

Source from the content-addressed store, hash-verified

137};
138
139function peg$parse(input, options) {
140 options = options !== void 0 ? options : {};
141
142 var peg$FAILED = {},
143
144 peg$startRuleFunctions = { Grammar: peg$parseGrammar },
145 peg$startRuleFunction = peg$parseGrammar,
146
147 peg$c0 = function(initializer, rules) {
148 return {
149 type: "grammar",
150 initializer: extractOptional(initializer, 0),
151 rules: extractList(rules, 0),
152 location: location()
153 };
154 },
155 peg$c1 = function(code) {
156 return { type: "initializer", code: code, location: location() };
157 },
158 peg$c2 = "=",
159 peg$c3 = peg$literalExpectation("=", false),
160 peg$c4 = function(name, displayName, expression) {
161 return {
162 type: "rule",
163 name: name,
164 expression: displayName !== null
165 ? {
166 type: "named",
167 name: displayName[0],
168 expression: expression,
169 location: location()
170 }
171 : expression,
172 location: location()
173 };
174 },
175 peg$c5 = "/",
176 peg$c6 = peg$literalExpectation("/", false),
177 peg$c7 = function(head, tail) {
178 return tail.length > 0
179 ? {
180 type: "choice",
181 alternatives: buildList(head, tail, 3),
182 location: location()
183 }
184 : head;
185 },
186 peg$c8 = function(expression, code) {
187 return code !== null
188 ? {
189 type: "action",
190 expression: expression,
191 code: code[1],
192 location: location()
193 }
194 : expression;
195 },
196 peg$c9 = function(head, tail) {

Callers

nothing calls this directly

Calls 8

peg$literalExpectationFunction · 0.85
peg$anyExpectationFunction · 0.85
peg$otherExpectationFunction · 0.85
peg$classExpectationFunction · 0.85
peg$failFunction · 0.85
peg$endExpectationFunction · 0.85
peg$buildStructuredErrorFunction · 0.85
peg$computeLocationFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…