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

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

Issue 2713553011: Split parser tests that exercise class members to their own class. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/analyzer/test/generated/parser_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
index e357b9cd89b35ee2837b266d4da765d16f653bb0..51e088fd184912e17b64f9fad1ed52c7fefbc1cc 100644
--- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
+++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart
@@ -49,6 +49,10 @@ class AstBuilder extends ScopeListener {
/// to the list.
var accumulateIdentifierComponents = false;
+ /// The name of the class currently being parsed, or `null` if no class is
+ /// being parsed.
+ String className;
+
AstBuilder(this.library, this.member, this.elementStore, Scope scope,
[Uri uri])
: uri = uri ?? library.fileUri,
@@ -143,6 +147,8 @@ class AstBuilder extends ScopeListener {
assert(element != null);
identifier.staticElement = element;
}
+ } else if (context == IdentifierContext.classDeclaration) {
+ className = identifier.name;
}
push(identifier);
}
@@ -851,6 +857,8 @@ class AstBuilder extends ScopeListener {
}
TypeParameterList typeParameters = pop();
SimpleIdentifier name = pop();
+ assert(className == name.name);
+ className = null;
Token abstractKeyword = _popOptionalSingleModifier();
List<Annotation> metadata = pop();
// TODO(paulberry): capture doc comments. See dartbug.com/28851.
@@ -1070,7 +1078,7 @@ class AstBuilder extends ScopeListener {
factoryKeyword = modifier;
} else {
// TODO(scheglov): Report error.
- internalError("Invalid modifier. Report an error.");
+ internalError("Invalid modifier ($value). Report an error.");
}
}
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698