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

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

Issue 2802753002: Include ':' before constructor separators into AST with Fasta. (Closed)
Patch Set: Created 3 years, 8 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 c4831bb1c3a15ddd302232a3ef83c43ec9709def..bf5eda73f50a9e0baf74d06d456a6887e1341eaa 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -406,6 +406,7 @@ class AstBuilder extends ScopeListener {
void handleNoInitializers() {
debugEvent("NoInitializers");
+ push(NullValue.ConstructorInitializerSeparator);
push(NullValue.ConstructorInitializers);
}
@@ -413,6 +414,8 @@ class AstBuilder extends ScopeListener {
debugEvent("Initializers");
List<Object> initializerObjects = popList(count) ?? const [];
+ push(beginToken);
+
var initializers = <ConstructorInitializer>[];
for (Object initializerObject in initializerObjects) {
if (initializerObject is FunctionExpressionInvocation) {
@@ -1567,6 +1570,7 @@ class AstBuilder extends ScopeListener {
debugEvent("Function");
FunctionBody body = pop();
pop(); // constructor initializers
+ pop(); // ":" before constructor initializers
FormalParameterList parameters = pop();
TypeParameterList typeParameters = pop();
// TODO(scheglov) It is an error if "getOrSet" is not null.
@@ -1632,11 +1636,11 @@ class AstBuilder extends ScopeListener {
FunctionBody body = pop();
ConstructorName redirectedConstructor = null; // TODO(paulberry)
List<ConstructorInitializer> initializers = pop() ?? const [];
- Token separator = null; // TODO(paulberry)
+ Token separator = pop();
FormalParameterList parameters = pop();
- TypeParameterList typeParameters = pop(); // TODO(paulberry)
+ TypeParameterList typeParameters = pop();
var name = pop();
- TypeAnnotation returnType = pop(); // TODO(paulberry)
+ TypeAnnotation returnType = pop();
_Modifiers modifiers = pop();
List<Annotation> metadata = pop();
Comment comment = pop();
« 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