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

Unified Diff: pkg/compiler/lib/src/parser/element_listener.dart

Issue 2738903002: Change the calling conventions for handleUnrecoverableError. (Closed)
Patch Set: Fix a code path I missed in element_listener.dart 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/element_listener.dart
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index f7d9b410ed9e2ab0a178c441dfc95228a88807c2..b418615d5dc4f91888eadbaa51171db0ffdd89ea 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -535,7 +535,7 @@ class ElementListener extends Listener {
reportErrorFromToken(preceding,
MessageKind.MISSING_TOKEN_AFTER_THIS, {'token': expected});
}
- return token;
+ return preceding;
} else {
reportFatalError(
reporter.spanFromToken(token),
@@ -553,12 +553,12 @@ class ElementListener extends Listener {
{'keyword': token.value});
} else if (token is ErrorToken) {
// TODO(ahe): This is dead code.
- return synthesizeIdentifier(token);
+ return newSyntheticToken(synthesizeIdentifier(token));
} else {
reportFatalError(reporter.spanFromToken(token),
"Expected identifier, but got '${token.value}'.");
}
- return token;
+ return newSyntheticToken(token);
case ErrorKind.ExpectedType:
reportFatalError(reporter.spanFromToken(token),
@@ -580,7 +580,7 @@ class ElementListener extends Listener {
case ErrorKind.ExpectedBlockToSkip:
if (optional("native", token)) {
- return native.handleNativeBlockToSkip(this, token);
+ return newSyntheticToken(native.handleNativeBlockToSkip(this, token));
} else {
errorCode = MessageKind.BODY_EXPECTED;
}
@@ -589,7 +589,8 @@ class ElementListener extends Listener {
case ErrorKind.ExpectedFunctionBody:
if (optional("native", token)) {
lastErrorWasNativeFunctionBody = true;
- return native.handleNativeFunctionBody(this, token);
+ return newSyntheticToken(
+ native.handleNativeFunctionBody(this, token));
} else {
reportFatalError(reporter.spanFromToken(token),
"Expected a function body, but got '${token.value}'.");
@@ -609,8 +610,8 @@ class ElementListener extends Listener {
case ErrorKind.UnmatchedToken:
reportErrorFromToken(token, MessageKind.UNMATCHED_TOKEN, arguments);
- Token next = token.next;
- while (next is ErrorToken) {
+ Token next = token;
+ while (next.next is ErrorToken) {
next = next.next;
}
return next;
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698