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

Unified Diff: pkg/analyzer/lib/src/fasta/ast_builder.dart

Issue 2778213002: Use message.yaml in parser. (Closed)
Patch Set: Update subpackage relationships. 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/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/fasta/ast_builder.dart
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 82acfca7cfb32394398ea67f48b7639bbf7a46f0..72411017fdae047d7dbc880329133ae83326a742 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -15,6 +15,8 @@ import 'package:front_end/src/fasta/scanner/token.dart'
show BeginGroupToken, Token;
import 'package:front_end/src/fasta/errors.dart' show internalError;
+import 'package:front_end/src/fasta/fasta_codes.dart'
+ show FastaMessage, codeExpectedExpression;
import 'package:front_end/src/fasta/kernel/kernel_builder.dart'
show Builder, KernelLibraryBuilder, ProcedureBuilder;
import 'package:front_end/src/fasta/parser/identifier_context.dart'
@@ -30,7 +32,6 @@ import 'element_store.dart'
ElementStore,
KernelClassElement;
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
-import 'package:front_end/src/fasta/parser/error_kind.dart';
import 'token_utils.dart' show toAnalyzerToken, toAnalyzerCommentToken;
class AstBuilder extends ScopeListener {
@@ -1046,8 +1047,8 @@ class AstBuilder extends ScopeListener {
}
@override
- Token handleUnrecoverableError(Token token, ErrorKind kind, Map arguments) {
- if (kind == ErrorKind.ExpectedExpression) {
+ Token handleUnrecoverableError(Token token, FastaMessage message) {
+ if (message.code == codeExpectedExpression) {
String lexeme = token.lexeme;
if (identical('async', lexeme) || identical('yield', lexeme)) {
errorReporter?.reportErrorForOffset(
@@ -1058,7 +1059,7 @@ class AstBuilder extends ScopeListener {
return token;
}
}
- return super.handleUnrecoverableError(token, kind, arguments);
+ return super.handleUnrecoverableError(token, message);
}
void handleUnaryPrefixExpression(Token token) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698