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

Unified Diff: sdk/lib/_internal/compiler/implementation/util/indentation.dart

Issue 694353007: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/util/indentation.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/indentation.dart b/sdk/lib/_internal/compiler/implementation/util/indentation.dart
deleted file mode 100644
index 6206bd6793926b5d07f71b7973ec6d0fe4f056dc..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/compiler/implementation/util/indentation.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2014, 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.
-
-part of dart2js.util;
-
-/// Indentation utility class. Should be used as a mixin in most cases.
-class Indentation {
- /// The current indentation string.
- String get indentation {
- // Lazily add new indentation strings as required.
- for (int i = _indentList.length; i <= _indentLevel; i++) {
- _indentList.add(_indentList[i - 1] + indentationUnit);
- }
- return _indentList[_indentLevel];
- }
-
- /// The current indentation level.
- int _indentLevel = 0;
-
- /// A cache of all indentation strings used so far.
- /// Always at least of length 1.
- List<String> _indentList = <String>[""];
-
- /// The indentation unit, defaulting to two spaces. May be overwritten.
- String _indentationUnit = " ";
- String get indentationUnit => _indentationUnit;
- set indentationUnit(String value) {
- if (value != _indentationUnit) {
- _indentationUnit = value;
- _indentList = <String>[""];
- }
- }
-
- /// Increases the current level of indentation.
- void indentMore() {
- _indentLevel++;
- }
-
- /// Decreases the current level of indentation.
- void indentLess() {
- _indentLevel--;
- }
-
- /// Calls [f] with one more indentation level, restoring indentation context
- /// upon return of [f] and returning its result.
- indentBlock(Function f) {
- indentMore();
- var result = f();
- indentLess();
- return result;
- }
-}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/util/emptyset.dart ('k') | sdk/lib/_internal/compiler/implementation/util/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698