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

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

Issue 2704163002: Add handleNoVariableInitializer event. (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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.analyzer.ast_builder; 5 library fasta.analyzer.ast_builder;
6 6
7 import 'package:front_end/src/fasta/scanner/token.dart' 7 import 'package:front_end/src/fasta/scanner/token.dart'
8 show BeginGroupToken, Token; 8 show BeginGroupToken, Token;
9 9
10 import 'package:analyzer/analyzer.dart'; 10 import 'package:analyzer/analyzer.dart';
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 void endVariableInitializer(Token assignmentOperator) { 305 void endVariableInitializer(Token assignmentOperator) {
306 debugEvent("VariableInitializer"); 306 debugEvent("VariableInitializer");
307 assert(assignmentOperator.stringValue == "="); 307 assert(assignmentOperator.stringValue == "=");
308 Expression initializer = pop(); 308 Expression initializer = pop();
309 Identifier identifier = pop(); 309 Identifier identifier = pop();
310 // TODO(ahe): Don't push initializers, instead install them. 310 // TODO(ahe): Don't push initializers, instead install them.
311 push(ast.variableDeclaration( 311 push(ast.variableDeclaration(
312 identifier, toAnalyzerToken(assignmentOperator), initializer)); 312 identifier, toAnalyzerToken(assignmentOperator), initializer));
313 } 313 }
314 314
315 @override
316 void handleNoVariableInitializer(Token token) {
317 debugEvent("NoVariableInitializer");
318 }
319
315 void endInitializedIdentifier() { 320 void endInitializedIdentifier() {
316 debugEvent("InitializedIdentifier"); 321 debugEvent("InitializedIdentifier");
317 AstNode node = pop(); 322 AstNode node = pop();
318 VariableDeclaration variable; 323 VariableDeclaration variable;
319 if (node is VariableDeclaration) { 324 if (node is VariableDeclaration) {
320 variable = node; 325 variable = node;
321 } else if (node is SimpleIdentifier) { 326 } else if (node is SimpleIdentifier) {
322 variable = ast.variableDeclaration(node, null, null); 327 variable = ast.variableDeclaration(node, null, null);
323 } else { 328 } else {
324 internalError("unhandled identifier: ${node.runtimeType}"); 329 internalError("unhandled identifier: ${node.runtimeType}");
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 /// [ClassDeclaration] or [ClassTypeAlias] object. 965 /// [ClassDeclaration] or [ClassTypeAlias] object.
961 class _MixinApplication { 966 class _MixinApplication {
962 final TypeName supertype; 967 final TypeName supertype;
963 968
964 final Token withKeyword; 969 final Token withKeyword;
965 970
966 final List<TypeName> mixinTypes; 971 final List<TypeName> mixinTypes;
967 972
968 _MixinApplication(this.supertype, this.withKeyword, this.mixinTypes); 973 _MixinApplication(this.supertype, this.withKeyword, this.mixinTypes);
969 } 974 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698