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

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

Issue 2965393002: Use FastaMessage instead of String. Part 1. (Closed)
Patch Set: Add type variable to Code. Created 3 years, 5 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/analyzer/tool/summary/mini_ast.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 cd3e019862dc12a7023fbf22a116b4f943e0dfe1..e0b2395c15474dc14e5aa9c71e818e6fc6c0450d 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -18,12 +18,8 @@ import 'package:front_end/src/scanner/token.dart' as analyzer;
import 'package:front_end/src/fasta/deprecated_problems.dart'
show deprecated_internalProblem;
-import 'package:front_end/src/fasta/fasta_codes.dart'
- show
- FastaCode,
- FastaMessage,
- codeExpectedExpression,
- codeExpectedFunctionBody;
+import 'package:front_end/src/fasta/messages.dart'
+ show Code, Message, codeExpectedExpression, codeExpectedFunctionBody;
import 'package:front_end/src/fasta/kernel/kernel_builder.dart'
show Builder, KernelLibraryBuilder, ProcedureBuilder, Scope;
import 'package:front_end/src/fasta/parser/identifier_context.dart'
@@ -1086,7 +1082,7 @@ class AstBuilder extends ScopeListener {
}
@override
- Token handleUnrecoverableError(Token token, FastaMessage message) {
+ Token handleUnrecoverableError(Token token, Message message) {
if (message.code == codeExpectedFunctionBody) {
if (identical('native', token.stringValue) && parser != null) {
Token nativeKeyword = token;
@@ -1915,18 +1911,18 @@ class AstBuilder extends ScopeListener {
}
@override
- void addCompileTimeErrorFromMessage(FastaMessage message) {
- FastaCode code = message.code;
+ void addCompileTimeError(Message message, int charOffset) {
+ Code code = message.code;
switch (code.analyzerCode) {
case "EXPECTED_TYPE_NAME":
errorReporter?.reportErrorForOffset(
- ParserErrorCode.EXPECTED_TYPE_NAME, message.charOffset, 1);
+ ParserErrorCode.EXPECTED_TYPE_NAME, charOffset, 1);
return;
default:
// fall through
}
- library.deprecated_addCompileTimeError(message.charOffset, message.message,
- fileUri: message.uri);
+ library.deprecated_addCompileTimeError(charOffset, message.message,
+ fileUri: uri);
}
}
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/mini_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698