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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_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
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.body_builder; 5 library fasta.body_builder;
6 6
7 import 'package:front_end/src/fasta/parser/parser.dart' show 7 import 'package:front_end/src/fasta/parser/parser.dart' show
8 FormalParameterType, 8 FormalParameterType,
9 optional; 9 optional;
10 10
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 @override 872 @override
873 void endVariableInitializer(Token assignmentOperator) { 873 void endVariableInitializer(Token assignmentOperator) {
874 debugEvent("VariableInitializer"); 874 debugEvent("VariableInitializer");
875 assert(assignmentOperator.stringValue == "="); 875 assert(assignmentOperator.stringValue == "=");
876 Expression initializer = popForValue(); 876 Expression initializer = popForValue();
877 Identifier identifier = pop(); 877 Identifier identifier = pop();
878 push(new VariableDeclaration(identifier.name, initializer: initializer)); 878 push(new VariableDeclaration(identifier.name, initializer: initializer));
879 } 879 }
880 880
881 @override 881 @override
882 void handleNoVariableInitializer(Token token) {
883 debugEvent("NoVariableInitializer");
884 }
885
886 @override
882 void endFieldInitializer(Token assignmentOperator) { 887 void endFieldInitializer(Token assignmentOperator) {
883 debugEvent("FieldInitializer"); 888 debugEvent("FieldInitializer");
884 assert(assignmentOperator.stringValue == "="); 889 assert(assignmentOperator.stringValue == "=");
885 push(popForValue()); 890 push(popForValue());
886 } 891 }
887 892
888 @override 893 @override
889 void handleNoFieldInitializer(Token token) { 894 void handleNoFieldInitializer(Token token) {
890 debugEvent("NoFieldInitializer"); 895 debugEvent("NoFieldInitializer");
891 push(NullValue.FieldInitializer); 896 push(NullValue.FieldInitializer);
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 } else if (node is TypeDeclarationBuilder) { 2679 } else if (node is TypeDeclarationBuilder) {
2675 return node.name; 2680 return node.name;
2676 } else if (node is PrefixBuilder) { 2681 } else if (node is PrefixBuilder) {
2677 return node.name; 2682 return node.name;
2678 } else if (node is ThisPropertyAccessor) { 2683 } else if (node is ThisPropertyAccessor) {
2679 return node.name.name; 2684 return node.name.name;
2680 } else { 2685 } else {
2681 return internalError("Unhandled: ${node.runtimeType}"); 2686 return internalError("Unhandled: ${node.runtimeType}");
2682 } 2687 }
2683 } 2688 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698