Chromium Code Reviews| Index: lib/compiler/implementation/tree/renamer.dart |
| diff --git a/lib/compiler/implementation/tree/renamer.dart b/lib/compiler/implementation/tree/renamer.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d085508e82a837cfc85567c8982e7edf1a323b89 |
| --- /dev/null |
| +++ b/lib/compiler/implementation/tree/renamer.dart |
| @@ -0,0 +1,34 @@ |
| +// 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. |
| + |
| +/** |
| + * Renames types, identifiers before printing them out. |
| + */ |
| +interface Renamer { |
| + /** |
| + * Renames type name for given type annotation. Should not touch type |
| + * arguments. Returns [null] if no rename is needed. |
| + */ |
| + String renameTypeName(TypeAnnotation type); |
| + |
| + /** |
| + * Renames method name. Returns [null] if no rename is needed. |
| + */ |
| + String renameSendMethod(Send send); |
| + |
| + /** |
| + * Renames identifier. Returns [null] if no rename is needed. |
| + */ |
| + String renameIdentifier(Identifier node); |
| +} |
| + |
| +/** |
| + * Renamer that does nothing. |
| + */ |
| +class NoRenamer implements Renamer { |
|
Anton Muhin
2012/07/23 17:01:27
instead of additional class, null might be default
Roman
2012/07/23 17:38:33
Done.
|
| + const NoRenamer(); |
| + String renameTypeName(TypeAnnotation type) => null; |
| + String renameSendMethod(Send send) => null; |
| + String renameIdentifier(Identifier node) => null; |
| +} |