Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: parser.dart

Issue 8343037: Throw FallThroughError when we fall through a case in a switch statement. Fixes (Closed) Base URL: http://dart.googlecode.com/svn/experimental/frog/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/corelib.dart ('k') | tests/frog/frog.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: parser.dart
===================================================================
--- parser.dart (revision 917)
+++ parser.dart (working copy)
@@ -619,6 +619,8 @@
_peekCaseEnd() {
var kind = _peek();
+ //TODO(efortuna): also if the first is an identifier followed by a colon, we
+ //have a label for the case statement.
return kind == TokenKind.RBRACE || kind == TokenKind.CASE ||
kind == TokenKind.DEFAULT;
}
@@ -627,8 +629,8 @@
int start = _peekToken.start;
var label = null;
if (_peekIdentifier()) {
+ label = identifier();
_eat(TokenKind.COLON);
- label = identifier();
}
var cases = [];
while (true) {
« no previous file with comments | « lib/corelib.dart ('k') | tests/frog/frog.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698