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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2801283002: Wrap VariableDeclarations in Blocks as specified by Kernel. (Closed)
Patch Set: Update strong.status. 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/compile.status » ('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.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody;
9 9
10 import '../parser/parser.dart' show FormalParameterType, optional; 10 import '../parser/parser.dart' show FormalParameterType, optional;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 Statement popStatementIfNotNull(Object value) { 229 Statement popStatementIfNotNull(Object value) {
230 return value == null ? null : popStatement(); 230 return value == null ? null : popStatement();
231 } 231 }
232 232
233 Statement popStatement() { 233 Statement popStatement() {
234 var statement = pop(); 234 var statement = pop();
235 if (statement is List) { 235 if (statement is List) {
236 return new Block(new List<Statement>.from(statement)); 236 return new Block(new List<Statement>.from(statement));
237 } else if (statement is VariableDeclaration) {
238 return new Block(<Statement>[statement]);
237 } else { 239 } else {
238 return statement; 240 return statement;
239 } 241 }
240 } 242 }
241 243
242 void ignore(Unhandled value) { 244 void ignore(Unhandled value) {
243 pop(); 245 pop();
244 } 246 }
245 247
246 void enterSwitchScope() { 248 void enterSwitchScope() {
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2970 } else if (node is PrefixBuilder) { 2972 } else if (node is PrefixBuilder) {
2971 return node.name; 2973 return node.name;
2972 } else if (node is ThisAccessor) { 2974 } else if (node is ThisAccessor) {
2973 return node.isSuper ? "super" : "this"; 2975 return node.isSuper ? "super" : "this";
2974 } else if (node is FastaAccessor) { 2976 } else if (node is FastaAccessor) {
2975 return node.plainNameForRead; 2977 return node.plainNameForRead;
2976 } else { 2978 } else {
2977 return internalError("Unhandled: ${node.runtimeType}"); 2979 return internalError("Unhandled: ${node.runtimeType}");
2978 } 2980 }
2979 } 2981 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698