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

Unified Diff: pkg/compiler/lib/src/util/indentation.dart

Issue 693183006: Revert "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
« no previous file with comments | « pkg/compiler/lib/src/util/emptyset.dart ('k') | pkg/compiler/lib/src/util/link.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/util/indentation.dart
diff --git a/pkg/compiler/lib/src/util/indentation.dart b/pkg/compiler/lib/src/util/indentation.dart
deleted file mode 100644
index 6206bd6793926b5d07f71b7973ec6d0fe4f056dc..0000000000000000000000000000000000000000
--- a/pkg/compiler/lib/src/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 | « pkg/compiler/lib/src/util/emptyset.dart ('k') | pkg/compiler/lib/src/util/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698