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

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

Issue 2993883002: Implement type inference for named function expressions. (Closed)
Patch Set: Created 3 years, 4 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/kernel_shadow_ast.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.body_builder; 5 library fasta.body_builder;
6 6
7 import 'package:kernel/ast.dart' 7 import 'package:kernel/ast.dart'
8 hide InvalidExpression, InvalidInitializer, InvalidStatement; 8 hide InvalidExpression, InvalidInitializer, InvalidStatement;
9 9
10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
(...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 pop(); // Modifiers. 2473 pop(); // Modifiers.
2474 exitFunction(); 2474 exitFunction();
2475 2475
2476 variable.initializer = new KernelFunctionExpression(formals.addToFunction( 2476 variable.initializer = new KernelFunctionExpression(formals.addToFunction(
2477 new FunctionNode(body, 2477 new FunctionNode(body,
2478 typeParameters: typeParameters, asyncMarker: asyncModifier) 2478 typeParameters: typeParameters, asyncMarker: asyncModifier)
2479 ..fileOffset = formals.charOffset 2479 ..fileOffset = formals.charOffset
2480 ..fileEndOffset = endToken.charOffset)) 2480 ..fileEndOffset = endToken.charOffset))
2481 ..parent = variable 2481 ..parent = variable
2482 ..fileOffset = formals.charOffset; 2482 ..fileOffset = formals.charOffset;
2483 push(new Let(variable, new VariableGet(variable))); 2483 push(
2484 new KernelNamedFunctionExpression(variable, new VariableGet(variable)));
2484 } 2485 }
2485 2486
2486 @override 2487 @override
2487 void endLocalFunctionDeclaration(Token token) { 2488 void endLocalFunctionDeclaration(Token token) {
2488 debugEvent("LocalFunctionDeclaration"); 2489 debugEvent("LocalFunctionDeclaration");
2489 Statement body = popStatement(); 2490 Statement body = popStatement();
2490 AsyncMarker asyncModifier = pop(); 2491 AsyncMarker asyncModifier = pop();
2491 if (functionNestingLevel != 0) { 2492 if (functionNestingLevel != 0) {
2492 exitLocalScope(); 2493 exitLocalScope();
2493 } 2494 }
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
3801 return AsyncMarker.Async; 3802 return AsyncMarker.Async;
3802 } else { 3803 } else {
3803 assert(identical(starToken.stringValue, "*")); 3804 assert(identical(starToken.stringValue, "*"));
3804 return AsyncMarker.AsyncStar; 3805 return AsyncMarker.AsyncStar;
3805 } 3806 }
3806 } else { 3807 } else {
3807 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", 3808 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens",
3808 asyncToken.charOffset, null); 3809 asyncToken.charOffset, null);
3809 } 3810 }
3810 } 3811 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698