(input, options)
| 137 | }; |
| 138 | |
| 139 | function 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) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…