MCPcopy Index your code
hub / github.com/BloombergGraphics/whatiscode / parseSwitchCase

Function parseSwitchCase

scripts/libs/esprima.js:3684–3705  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3682 // 12.10 The swith statement
3683
3684 function parseSwitchCase() {
3685 var test, consequent = [], statement, node = new Node();
3686
3687 if (matchKeyword('default')) {
3688 lex();
3689 test = null;
3690 } else {
3691 expectKeyword('case');
3692 test = parseExpression();
3693 }
3694 expect(':');
3695
3696 while (startIndex < length) {
3697 if (match('}') || matchKeyword('default') || matchKeyword('case')) {
3698 break;
3699 }
3700 statement = parseStatementListItem();
3701 consequent.push(statement);
3702 }
3703
3704 return node.finishSwitchCase(test, consequent);
3705 }
3706
3707 function parseSwitchStatement(node) {
3708 var discriminant, cases, clause, oldInSwitch, defaultFound;

Callers 1

parseSwitchStatementFunction · 0.85

Calls 7

matchKeywordFunction · 0.85
lexFunction · 0.85
expectKeywordFunction · 0.85
parseExpressionFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85
parseStatementListItemFunction · 0.85

Tested by

no test coverage detected