| 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.chunk; | 5 library dart_style.src.chunk; |
| 6 | 6 |
| 7 import 'fast_hash.dart'; | 7 import 'fast_hash.dart'; |
| 8 import 'nesting_level.dart'; | 8 import 'nesting_level.dart'; |
| 9 import 'rule/rule.dart'; | 9 import 'rule/rule.dart'; |
| 10 | 10 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 /// Splitting the internals of collection literal arguments. | 323 /// Splitting the internals of collection literal arguments. |
| 324 /// | 324 /// |
| 325 /// Used to prefer splitting at the argument boundary over splitting the | 325 /// Used to prefer splitting at the argument boundary over splitting the |
| 326 /// collection contents. | 326 /// collection contents. |
| 327 static const splitCollections = 2; | 327 static const splitCollections = 2; |
| 328 | 328 |
| 329 /// Splitting on the "." in a named constructor. | 329 /// Splitting on the "." in a named constructor. |
| 330 static const constructorName = 3; | 330 static const constructorName = 3; |
| 331 | 331 |
| 332 /// Splitting a `[...]` index operator. |
| 333 static const index = 3; |
| 334 |
| 332 /// Splitting before a type argument or type parameter. | 335 /// Splitting before a type argument or type parameter. |
| 333 static const typeArgument = 4; | 336 static const typeArgument = 4; |
| 334 } | 337 } |
| 335 | 338 |
| 336 /// The in-progress state for a [Span] that has been started but has not yet | 339 /// The in-progress state for a [Span] that has been started but has not yet |
| 337 /// been completed. | 340 /// been completed. |
| 338 class OpenSpan { | 341 class OpenSpan { |
| 339 /// Index of the first chunk contained in this span. | 342 /// Index of the first chunk contained in this span. |
| 340 int get start => _start; | 343 int get start => _start; |
| 341 int _start; | 344 int _start; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 /// output. This way, commented out chunks of code do not get erroneously | 392 /// output. This way, commented out chunks of code do not get erroneously |
| 390 /// re-indented. | 393 /// re-indented. |
| 391 final bool flushLeft; | 394 final bool flushLeft; |
| 392 | 395 |
| 393 /// Whether this comment is an inline block comment. | 396 /// Whether this comment is an inline block comment. |
| 394 bool get isInline => linesBefore == 0 && !isLineComment; | 397 bool get isInline => linesBefore == 0 && !isLineComment; |
| 395 | 398 |
| 396 SourceComment(this.text, this.linesBefore, | 399 SourceComment(this.text, this.linesBefore, |
| 397 {this.isLineComment, this.flushLeft}); | 400 {this.isLineComment, this.flushLeft}); |
| 398 } | 401 } |
| OLD | NEW |