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

Unified Diff: dart_style/lib/src/whitespace.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « dart_style/lib/src/source_visitor.dart ('k') | dart_style/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart_style/lib/src/whitespace.dart
diff --git a/dart_style/lib/src/whitespace.dart b/dart_style/lib/src/whitespace.dart
deleted file mode 100644
index 481f498d4db311ff80f8a99d4582d9552e5ac75d..0000000000000000000000000000000000000000
--- a/dart_style/lib/src/whitespace.dart
+++ /dev/null
@@ -1,105 +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.
-
-library dart_style.src.whitespace;
-
-/// Constants for the number of spaces for various kinds of indentation.
-class Indent {
- /// The number of spaces in a block or collection body.
- static const block = 2;
-
- /// How much wrapped cascade sections indent.
- static const cascade = 2;
-
- /// The number of spaces in a single level of expression nesting.
- static const expression = 4;
-
- /// The ":" on a wrapped constructor initialization list.
- static const constructorInitializer = 4;
-
- /// The indentation for subsequent variables when a for loop defines multiple
- /// variables that wrap, like:
- ///
- /// for (var a = initializer,
- /// b = another,
- /// c = third;
- /// a + b + c < 100;
- /// a++) {
- /// ...
- /// }
- static const loopVariable = 8;
-}
-
-/// The kind of pending whitespace that has been "written", but not actually
-/// physically output yet.
-///
-/// We defer actually writing whitespace until a non-whitespace token is
-/// encountered to avoid trailing whitespace.
-class Whitespace {
- /// No whitespace.
- static const none = const Whitespace._("none");
-
- /// A single non-breaking space.
- static const space = const Whitespace._("space");
-
- /// A single newline.
- static const newline = const Whitespace._("newline");
-
- /// A single newline that takes into account the current expression nesting
- /// for the next line.
- static const nestedNewline = const Whitespace._("nestedNewline");
-
- /// A single newline with all indentation eliminated at the beginning of the
- /// next line.
- ///
- /// Used for subsequent lines in a multiline string.
- static const newlineFlushLeft = const Whitespace._("newlineFlushLeft");
-
- /// Two newlines, a single blank line of separation.
- static const twoNewlines = const Whitespace._("twoNewlines");
-
- /// A space or newline should be output based on whether the current token is
- /// on the same line as the previous one or not.
- ///
- /// In general, we like to avoid using this because it makes the formatter
- /// less prescriptive over the user's whitespace.
- static const spaceOrNewline = const Whitespace._("spaceOrNewline");
-
- /// A split or newline should be output based on whether the current token is
- /// on the same line as the previous one or not.
- ///
- /// In general, we like to avoid using this because it makes the formatter
- /// less prescriptive over the user's whitespace.
- static const splitOrNewline = const Whitespace._("splitOrNewline");
-
- /// One or two newlines should be output based on how many newlines are
- /// present between the next token and the previous one.
- ///
- /// In general, we like to avoid using this because it makes the formatter
- /// less prescriptive over the user's whitespace.
- static const oneOrTwoNewlines = const Whitespace._("oneOrTwoNewlines");
-
- final String name;
-
- /// Gets the minimum number of newlines contained in this whitespace.
- int get minimumLines {
- switch (this) {
- case Whitespace.newline:
- case Whitespace.nestedNewline:
- case Whitespace.newlineFlushLeft:
- case Whitespace.oneOrTwoNewlines:
- return 1;
-
- case Whitespace.twoNewlines:
- return 2;
-
- default:
- return 0;
- }
- }
-
- const Whitespace._(this.name);
-
- String toString() => name;
-}
« no previous file with comments | « dart_style/lib/src/source_visitor.dart ('k') | dart_style/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698