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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2738903002: Change the calling conventions for handleUnrecoverableError. (Closed)
Patch Set: Created 3 years, 9 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: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index afcabb0fc779ff76d2fb69b8955a7aab78951566..8fd4ef7f892cf4a5a473e0c83c5db56f13e5b104 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -2191,7 +2191,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Token handleUnrecoverableError(Token token, ErrorKind kind, Map arguments) {
if (isDartLibrary && kind == ErrorKind.ExpectedFunctionBody) {
Token recover = skipNativeClause(token);
- if (recover != null) return recover;
+ if (recover != null) return newSyntheticToken(recover);
ahe 2017/03/09 12:08:39 I think we should modify skipNativeClause instead.
Paul Berry 2017/03/09 21:51:21 Done.
} else if (kind == ErrorKind.UnexpectedToken) {
String expected = arguments["expected"];
const List<String> trailing = const <String>[")", "}", ";", ","];
@@ -2199,7 +2199,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
arguments.putIfAbsent("actual", () => token.value);
handleRecoverableError(token, ErrorKind.ExpectedButGot, arguments);
}
- return token;
+ return newSyntheticToken(token);
ahe 2017/03/09 12:08:39 FYI: Expect an easy conflict here. The return stat
Paul Berry 2017/03/09 21:51:21 Thanks for the heads up.
}
return super.handleUnrecoverableError(token, kind, arguments);
}

Powered by Google App Engine
This is Rietveld 408576698