Chromium Code Reviews| Index: lib/compiler/implementation/dart_backend/placeholder.dart |
| diff --git a/lib/compiler/implementation/dart_backend/placeholder.dart b/lib/compiler/implementation/dart_backend/placeholder.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..79ecef56700a539ee1c2c1d1db872f3f3143e1a7 |
| --- /dev/null |
| +++ b/lib/compiler/implementation/dart_backend/placeholder.dart |
| @@ -0,0 +1,28 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +class Placeholder { |
| + abstract String rename(ConflictingRenamer renamer); |
| +} |
| + |
| +class NullPlaceholder extends Placeholder { |
| + String rename(ConflictingRenamer renamer) => ''; |
| + String toString() => 'null[]'; |
| +} |
| + |
| +class PrivatePlaceholder extends Placeholder { |
| + final LibraryElement library; |
| + final Identifier node; |
| + PrivatePlaceholder(this.library, this.node); |
| + String rename(ConflictingRenamer renamer) => |
| + renamer.renamePrivateIdentifier(library, node.source.slowToString()); |
| + String toString() => 'private[node($node), library($library)]'; |
|
Anton Muhin
2012/08/09 06:34:52
nit: not sure if you really need this node/library
Roman
2012/08/09 07:34:03
This is just for debugging when I want to print ou
|
| +} |
| + |
| +class ElementPlaceholder extends Placeholder { |
| + final Element element; |
| + ElementPlaceholder(this.element); |
| + String rename(ConflictingRenamer renamer) => renamer.renameElement(element); |
| + String toString() => 'element[element($element)]'; |
|
Anton Muhin
2012/08/09 06:34:52
ditto.
|
| +} |