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

Side by Side Diff: pkg/kernel/lib/text/ast_to_text.dart

Issue 2778223002: Add primitive to create closures and use it for closure conversion (Closed)
Patch Set: Follow common pattern for AST nodes with References in ClosureCreation 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 | « pkg/kernel/lib/binary/tag.dart ('k') | pkg/kernel/lib/transformations/closure/converter.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 library kernel.ast_to_text; 4 library kernel.ast_to_text;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../import_table.dart'; 7 import '../import_table.dart';
8 8
9 class Namer<T> { 9 class Namer<T> {
10 int index = 0; 10 int index = 0;
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 writeExpression(node.value); 1014 writeExpression(node.value);
1015 } 1015 }
1016 1016
1017 visitVectorCopy(VectorCopy node) { 1017 visitVectorCopy(VectorCopy node) {
1018 writeWord('CopyVector'); 1018 writeWord('CopyVector');
1019 writeSymbol('('); 1019 writeSymbol('(');
1020 writeExpression(node.vectorExpression); 1020 writeExpression(node.vectorExpression);
1021 writeSymbol(')'); 1021 writeSymbol(')');
1022 } 1022 }
1023 1023
1024 visitClosureCreation(ClosureCreation node) {
1025 writeWord('MakeClosure');
1026 writeSymbol('<');
1027 writeNode(node.functionType);
1028 writeSymbol('>');
1029 writeSymbol('(');
1030 writeMemberReference(node.topLevelFunction);
1031 writeComma();
1032 writeExpression(node.contextVector);
1033 writeSymbol(')');
1034 }
1035
1024 visitDeferredImport(DeferredImport node) { 1036 visitDeferredImport(DeferredImport node) {
1025 write('import "'); 1037 write('import "');
1026 write('${node.importedLibrary.importUri}'); 1038 write('${node.importedLibrary.importUri}');
1027 write('" deferred as '); 1039 write('" deferred as ');
1028 write(node.name); 1040 write(node.name);
1029 endLine(';'); 1041 endLine(';');
1030 } 1042 }
1031 1043
1032 defaultExpression(Expression node) { 1044 defaultExpression(Expression node) {
1033 writeWord('${node.runtimeType}'); 1045 writeWord('${node.runtimeType}');
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
1600 } 1612 }
1601 throw 'illegal ProcedureKind: $kind'; 1613 throw 'illegal ProcedureKind: $kind';
1602 } 1614 }
1603 1615
1604 class ExpressionPrinter { 1616 class ExpressionPrinter {
1605 final Printer writeer; 1617 final Printer writeer;
1606 final int minimumPrecedence; 1618 final int minimumPrecedence;
1607 1619
1608 ExpressionPrinter(this.writeer, this.minimumPrecedence); 1620 ExpressionPrinter(this.writeer, this.minimumPrecedence);
1609 } 1621 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/tag.dart ('k') | pkg/kernel/lib/transformations/closure/converter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698