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

Side by Side Diff: pkg/compiler/lib/src/scanner/parser.dart

Issue 1067653003: Handle unexpected tokens in modifier lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/regress_23051_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of scanner; 5 part of scanner;
6 6
7 class FormalParameterType { 7 class FormalParameterType {
8 final String type; 8 final String type;
9 const FormalParameterType(this.type); 9 const FormalParameterType(this.type);
10 bool get isRequired => this == REQUIRED; 10 bool get isRequired => this == REQUIRED;
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 } 1066 }
1067 1067
1068 void parseModifierList(Link<Token> tokens) { 1068 void parseModifierList(Link<Token> tokens) {
1069 int count = 0; 1069 int count = 0;
1070 for (; !tokens.isEmpty; tokens = tokens.tail) { 1070 for (; !tokens.isEmpty; tokens = tokens.tail) {
1071 Token token = tokens.head; 1071 Token token = tokens.head;
1072 if (isModifier(token)) { 1072 if (isModifier(token)) {
1073 parseModifier(token); 1073 parseModifier(token);
1074 } else { 1074 } else {
1075 listener.unexpected(token); 1075 listener.unexpected(token);
1076 // Skip the remaining modifiers.
1077 break;
1076 } 1078 }
1077 count++; 1079 count++;
1078 } 1080 }
1079 listener.handleModifiers(count); 1081 listener.handleModifiers(count);
1080 } 1082 }
1081 1083
1082 Token parseModifiers(Token token) { 1084 Token parseModifiers(Token token) {
1083 int count = 0; 1085 int count = 0;
1084 while (identical(token.kind, KEYWORD_TOKEN)) { 1086 while (identical(token.kind, KEYWORD_TOKEN)) {
1085 if (!isModifier(token)) 1087 if (!isModifier(token))
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 } 2663 }
2662 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2664 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2663 return expectSemicolon(token); 2665 return expectSemicolon(token);
2664 } 2666 }
2665 2667
2666 Token parseEmptyStatement(Token token) { 2668 Token parseEmptyStatement(Token token) {
2667 listener.handleEmptyStatement(token); 2669 listener.handleEmptyStatement(token);
2668 return expectSemicolon(token); 2670 return expectSemicolon(token);
2669 } 2671 }
2670 } 2672 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/regress_23051_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698