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

Unified Diff: lib/compiler/implementation/scanner/listener.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 | « no previous file | lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/scanner/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index b2514370e8904ffc6a3a2b5e5da39dfb8c156939..2017961c5a8ed5f4ebd4e522d21fd37284dceb12 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -553,6 +553,11 @@ class Listener {
return skipToEof(token);
}
+ Link<Token> expectedDeclaration(Token token) {
+ error("expected a declaration, but got '${token.slowToString()}'", token);
+ return const EmptyLink<Token>();
+ }
+
Token unmatched(Token token) {
error("unmatched '${token.slowToString()}'", token);
return skipToEof(token);
@@ -950,6 +955,12 @@ class ElementListener extends Listener {
}
}
+ Link<Token> expectedDeclaration(Token token) {
+ listener.cancel("expected a declaration, but got '${token.slowToString()}'",
+ token: token);
+ return const EmptyLink<Token>();
+ }
+
Token unmatched(Token token) {
listener.cancel("unmatched '${token.slowToString()}'", token: token);
return skipToEof(token);
« no previous file with comments | « no previous file | lib/compiler/implementation/scanner/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698