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

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
Index: parser.dart
===================================================================
--- parser.dart (revision 910)
+++ 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();
jimhug 2011/10/28 20:02:44 Whoa! How was this working before?
_eat(TokenKind.COLON);
- label = identifier();
}
var cases = [];
while (true) {

Powered by Google App Engine
This is Rietveld 408576698