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

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

Issue 2665723002: Implement canonical name scheme in kernel. (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 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 import '../type_propagation/type_propagation.dart'; 8 import '../type_propagation/type_propagation.dart';
9 9
10 class Namer<T> { 10 class Namer<T> {
(...skipping 19 matching lines...) Expand all
30 ++i; 30 ++i;
31 } 31 }
32 return '$proposedName$i'; 32 return '$proposedName$i';
33 }); 33 });
34 } 34 }
35 } 35 }
36 36
37 NameSystem globalDebuggingNames = new NameSystem(); 37 NameSystem globalDebuggingNames = new NameSystem();
38 38
39 String debugLibraryName(Library node) { 39 String debugLibraryName(Library node) {
40 return node.name ?? globalDebuggingNames.nameLibrary(node); 40 return node == null
41 ? 'null'
42 : node.name ?? globalDebuggingNames.nameLibrary(node);
41 } 43 }
42 44
43 String debugClassName(Class node) { 45 String debugClassName(Class node) {
44 return node.name ?? globalDebuggingNames.nameClass(node); 46 return node == null
47 ? 'null'
48 : node.name ?? globalDebuggingNames.nameClass(node);
45 } 49 }
46 50
47 String debugQualifiedClassName(Class node) { 51 String debugQualifiedClassName(Class node) {
48 return debugLibraryName(node.enclosingLibrary) + '::' + debugClassName(node); 52 return debugLibraryName(node.enclosingLibrary) + '::' + debugClassName(node);
49 } 53 }
50 54
51 String debugMemberName(Member node) { 55 String debugMemberName(Member node) {
52 return node.name?.name ?? globalDebuggingNames.nameMember(node); 56 return node.name?.name ?? globalDebuggingNames.nameMember(node);
53 } 57 }
54 58
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 } 1557 }
1554 throw 'illegal ProcedureKind: $kind'; 1558 throw 'illegal ProcedureKind: $kind';
1555 } 1559 }
1556 1560
1557 class ExpressionPrinter { 1561 class ExpressionPrinter {
1558 final Printer writeer; 1562 final Printer writeer;
1559 final int minimumPrecedence; 1563 final int minimumPrecedence;
1560 1564
1561 ExpressionPrinter(this.writeer, this.minimumPrecedence); 1565 ExpressionPrinter(this.writeer, this.minimumPrecedence);
1562 } 1566 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698