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

Function parseAtom

test/babel.js:58311–58345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58309 }
58310
58311 function parseAtom() {
58312 // Atom ::
58313 // PatternCharacter
58314 // .
58315 // \ AtomEscape
58316 // CharacterClass
58317 // ( Disjunction )
58318 // ( ? : Disjunction )
58319
58320 var res;
58321
58322 // jviereck: allow ']', '}' here as well to be compatible with browser's
58323 // implementations: ']'.match(/]/);
58324 // if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) {
58325 if (res = matchReg(/^[^^$\\.*+?(){[|]/)) {
58326 // PatternCharacter
58327 return createCharacter(res);
58328 } else if (match('.')) {
58329 // .
58330 return createDot();
58331 } else if (match('\\')) {
58332 // \ AtomEscape
58333 res = parseAtomEscape();
58334 if (!res) {
58335 bail('atomEscape');
58336 }
58337 return res;
58338 } else if (res = parseCharacterClass()) {
58339 return res;
58340 } else {
58341 // ( Disjunction )
58342 // ( ? : Disjunction )
58343 return parseGroup('(?:', 'ignore', '(', 'normal');
58344 }
58345 }
58346
58347 function parseUnicodeSurrogatePairEscape(firstEscape) {
58348 if (hasUnicodeFlag) {

Callers 1

parseTermFunction · 0.85

Calls 8

matchRegFunction · 0.85
createCharacterFunction · 0.85
createDotFunction · 0.85
parseAtomEscapeFunction · 0.85
bailFunction · 0.85
parseCharacterClassFunction · 0.85
parseGroupFunction · 0.85
matchFunction · 0.70

Tested by

no test coverage detected