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

Unified Diff: lib/compiler/implementation/tree/unparser.dart

Issue 10826186: First take on support of library private names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/dart_backend/renamer.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/tree/unparser.dart
diff --git a/lib/compiler/implementation/tree/unparser.dart b/lib/compiler/implementation/tree/unparser.dart
index 2140a2a2d807e859d6e0e3d87c710534e1402fe2..4ee97deecbefa7c7c5edf90dc3e134bfa1d83870 100644
--- a/lib/compiler/implementation/tree/unparser.dart
+++ b/lib/compiler/implementation/tree/unparser.dart
@@ -106,20 +106,12 @@ class Unparser implements Visitor {
// names are modelled with Send and it emits operator[] as only
// operator, without [] which are expected to be emitted with
// arguments.
- emitName(Identifier name) {
- final newName = renamer.renameIdentifier(name);
- if (newName === null) {
- visit(name);
- } else {
- sb.add(newName);
- }
- }
if (node.name is Send) {
Send send = node.name;
assert(send is !SendSet);
if (!send.isOperator) {
// Looks like a factory method.
- emitName(send.receiver);
+ visit(send.receiver);
sb.add('.');
} else {
visit(send.receiver);
@@ -127,7 +119,7 @@ class Unparser implements Visitor {
}
visit(send.selector);
} else {
- if (node.name !== null) emitName(node.name);
+ visit(node.name);
}
visit(node.parameters);
visit(node.initializers);
@@ -135,7 +127,12 @@ class Unparser implements Visitor {
}
visitIdentifier(Identifier node) {
- add(node.token.value);
+ String newName = renamer.renameIdentifier(node);
+ if (newName === null) {
+ add(node.token.value);
+ } else {
+ sb.add(newName);
+ }
}
visitIf(If node) {
« no previous file with comments | « lib/compiler/implementation/dart_backend/renamer.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698