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

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

Issue 3007033002: report const class as a more specific error code (Closed)
Patch Set: Created 3 years, 3 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/test/generated/parser_fasta_test.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 183f3c19cc22e49f167f2dff0f4d54490f5b38e1..988e21579cc2a4e60603390e50ef7923d7662042 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -1934,13 +1934,9 @@ class AstBuilder extends ScopeListener {
errorReporter?.reportErrorForOffset(
ParserErrorCode.EXPECTED_TYPE_NAME, charOffset, 1);
return;
- case "NATIVE_CLAUSE_SHOULD_BE_ANNOTATION":
- if (!allowNativeClause) {
- errorReporter?.reportErrorForOffset(
- ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION,
- charOffset,
- 1);
- }
+ case "CONST_CLASS":
+ errorReporter?.reportErrorForOffset(
+ ParserErrorCode.CONST_CLASS, charOffset, 1);
return;
case "EXPECTED_STRING_LITERAL":
errorReporter?.reportErrorForOffset(
@@ -1951,6 +1947,14 @@ class AstBuilder extends ScopeListener {
errorReporter?.reportErrorForOffset(ParserErrorCode.EXTRANEOUS_MODIFIER,
charOffset, text.length, [text]);
return;
+ case "NATIVE_CLAUSE_SHOULD_BE_ANNOTATION":
+ if (!allowNativeClause) {
+ errorReporter?.reportErrorForOffset(
+ ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION,
+ charOffset,
+ 1);
+ }
+ return;
case "UNEXPECTED_TOKEN":
String text = stringOrTokenLexeme();
if (text == ';') {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698