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

Unified Diff: lib/compiler/implementation/scanner/parser.dart

Issue 11071015: Fix error reporting on member declarations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename method and add test. Created 8 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/compiler/implementation/scanner/listener.dart ('k') | tests/language/illegal_declaration_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/parser.dart
diff --git a/lib/compiler/implementation/scanner/parser.dart b/lib/compiler/implementation/scanner/parser.dart
index 48fc94ddc6634a2d756a6e30be6e1c36bcc018c2..d8831568f4ff97186162762bdcac013b3007c3e1 100644
--- a/lib/compiler/implementation/scanner/parser.dart
+++ b/lib/compiler/implementation/scanner/parser.dart
@@ -644,6 +644,7 @@ class Parser {
}
Link<Token> findMemberName(Token token) {
+ Token start = token;
Link<Token> identifiers = const EmptyLink<Token>();
while (token.kind !== EOF_TOKEN) {
String value = token.stringValue;
@@ -673,7 +674,7 @@ class Parser {
}
token = token.next;
}
- return listener.unexpected(token);
+ return listener.expectedDeclaration(start);
}
Token parseVariableInitializerOpt(Token token) {
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | tests/language/illegal_declaration_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698