MCPcopy Index your code
hub / github.com/reactjs/react-rails / parseSwitchCase

Function parseSwitchCase

lib/assets/javascripts/JSXTransformer.js:7750–7777  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7748 // 12.10 The swith statement
7749
7750 function parseSwitchCase() {
7751 var test,
7752 consequent = [],
7753 sourceElement,
7754 marker = markerCreate();
7755
7756 if (matchKeyword('default')) {
7757 lex();
7758 test = null;
7759 } else {
7760 expectKeyword('case');
7761 test = parseExpression();
7762 }
7763 expect(':');
7764
7765 while (index < length) {
7766 if (match('}') || matchKeyword('default') || matchKeyword('case')) {
7767 break;
7768 }
7769 sourceElement = parseSourceElement();
7770 if (typeof sourceElement === 'undefined') {
7771 break;
7772 }
7773 consequent.push(sourceElement);
7774 }
7775
7776 return markerApply(marker, delegate.createSwitchCase(test, consequent));
7777 }
7778
7779 function parseSwitchStatement() {
7780 var discriminant, cases, clause, oldInSwitch, defaultFound, marker = markerCreate();

Callers 1

parseSwitchStatementFunction · 0.85

Calls 9

markerCreateFunction · 0.85
matchKeywordFunction · 0.85
lexFunction · 0.85
expectKeywordFunction · 0.85
parseExpressionFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85
parseSourceElementFunction · 0.85
markerApplyFunction · 0.85

Tested by

no test coverage detected