()
| 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(); |
no test coverage detected