| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart_style.src.whitespace; | 5 library dart_style.src.whitespace; |
| 6 | 6 |
| 7 /// Constants for the number of spaces for various kinds of indentation. | 7 /// Constants for the number of spaces for various kinds of indentation. |
| 8 class Indent { | 8 class Indent { |
| 9 /// The number of spaces in a block or collection body. | 9 /// The number of spaces in a block or collection body. |
| 10 static const block = 2; | 10 static const block = 2; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 /// A single newline with all indentation eliminated at the beginning of the | 41 /// A single newline with all indentation eliminated at the beginning of the |
| 42 /// next line. | 42 /// next line. |
| 43 /// | 43 /// |
| 44 /// Used for subsequent lines in a multiline string. | 44 /// Used for subsequent lines in a multiline string. |
| 45 static const newlineFlushLeft = const Whitespace._("newlineFlushLeft"); | 45 static const newlineFlushLeft = const Whitespace._("newlineFlushLeft"); |
| 46 | 46 |
| 47 /// Two newlines, a single blank line of separation. | 47 /// Two newlines, a single blank line of separation. |
| 48 static const twoNewlines = const Whitespace._("twoNewlines"); | 48 static const twoNewlines = const Whitespace._("twoNewlines"); |
| 49 | 49 |
| 50 /// A space or newline should be output based on whether the current token is | |
| 51 /// on the same line as the previous one or not. | |
| 52 /// | |
| 53 /// In general, we like to avoid using this because it makes the formatter | |
| 54 /// less prescriptive over the user's whitespace. | |
| 55 static const spaceOrNewline = const Whitespace._("spaceOrNewline"); | |
| 56 | |
| 57 /// A split or newline should be output based on whether the current token is | 50 /// A split or newline should be output based on whether the current token is |
| 58 /// on the same line as the previous one or not. | 51 /// on the same line as the previous one or not. |
| 59 /// | 52 /// |
| 60 /// In general, we like to avoid using this because it makes the formatter | 53 /// In general, we like to avoid using this because it makes the formatter |
| 61 /// less prescriptive over the user's whitespace. | 54 /// less prescriptive over the user's whitespace. |
| 62 static const splitOrNewline = const Whitespace._("splitOrNewline"); | 55 static const splitOrNewline = const Whitespace._("splitOrNewline"); |
| 63 | 56 |
| 64 /// One or two newlines should be output based on how many newlines are | 57 /// One or two newlines should be output based on how many newlines are |
| 65 /// present between the next token and the previous one. | 58 /// present between the next token and the previous one. |
| 66 /// | 59 /// |
| (...skipping 17 matching lines...) Expand all Loading... |
| 84 | 77 |
| 85 default: | 78 default: |
| 86 return 0; | 79 return 0; |
| 87 } | 80 } |
| 88 } | 81 } |
| 89 | 82 |
| 90 const Whitespace._(this.name); | 83 const Whitespace._(this.name); |
| 91 | 84 |
| 92 String toString() => name; | 85 String toString() => name; |
| 93 } | 86 } |
| OLD | NEW |