MCPcopy Index your code
hub / github.com/RubyLouvre/anu / parseTerm

Function parseTerm

test/babel.js:58177–58206  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58175 }
58176
58177 function parseTerm() {
58178 // Term ::
58179 // Anchor
58180 // Atom
58181 // Atom Quantifier
58182
58183 if (pos >= str.length || current('|') || current(')')) {
58184 return null; /* Means: The term is empty */
58185 }
58186
58187 var anchor = parseAnchor();
58188
58189 if (anchor) {
58190 return anchor;
58191 }
58192
58193 var atom = parseAtom();
58194 if (!atom) {
58195 bail('Expected atom');
58196 }
58197 var quantifier = parseQuantifier() || false;
58198 if (quantifier) {
58199 quantifier.body = flattenBody(atom);
58200 // The quantifier contains the atom. Therefore, the beginning of the
58201 // quantifier range is given by the beginning of the atom.
58202 updateRawStart(quantifier, atom.range[0]);
58203 return quantifier;
58204 }
58205 return atom;
58206 }
58207
58208 function parseGroup(matchA, typeA, matchB, typeB) {
58209 var type = null,

Callers 1

parseAlternativeFunction · 0.85

Calls 7

currentFunction · 0.85
parseAnchorFunction · 0.85
parseAtomFunction · 0.85
bailFunction · 0.85
parseQuantifierFunction · 0.85
flattenBodyFunction · 0.85
updateRawStartFunction · 0.85

Tested by

no test coverage detected