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

Unified Diff: lib/src/line_prefix.dart

Issue 1182953003: Eat some dogfood! (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years, 6 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
Index: lib/src/line_prefix.dart
diff --git a/lib/src/line_prefix.dart b/lib/src/line_prefix.dart
index 3ad4960daa8ee09c9070685797c08c862b69f721..51aa5417f63cf6da82d2a08d5e2dc2110889a265 100644
--- a/lib/src/line_prefix.dart
+++ b/lib/src/line_prefix.dart
@@ -55,7 +55,7 @@ class LinePrefix {
: this._(0, {}, indent, new NestingSplitter(), flushLeft: false);
LinePrefix._(this.length, this.ruleValues, this._indent, this._nesting,
- {bool flushLeft : false})
+ {bool flushLeft: false})
: _flushLeft = flushLeft;
bool operator ==(other) {
@@ -80,9 +80,9 @@ class LinePrefix {
/// Create a new LinePrefix one chunk longer than this one using [ruleValues],
/// and assuming that we do not split before that chunk.
- LinePrefix extend(Map<Rule, int> ruleValues) =>
- new LinePrefix._(length + 1, ruleValues, _indent, _nesting,
- flushLeft: _flushLeft);
+ LinePrefix extend(Map<Rule, int> ruleValues) => new LinePrefix._(
+ length + 1, ruleValues, _indent, _nesting,
+ flushLeft: _flushLeft);
/// Create a series of new LinePrefixes one chunk longer than this one using
/// [ruleValues], and assuming that the new [chunk] splits at an expression
@@ -90,11 +90,12 @@ class LinePrefix {
///
/// If this prefix is for a nested block, [blockIndentation] may be nonzero
/// to push the output to the right.
- Iterable<LinePrefix> split(Chunk chunk, int blockIndentation,
- Map<Rule, int> ruleValues) {
+ Iterable<LinePrefix> split(
+ Chunk chunk, int blockIndentation, Map<Rule, int> ruleValues) {
var indent = chunk.indent + blockIndentation;
return _nesting.update(chunk.nesting).map((nesting) => new LinePrefix._(
- length + 1, ruleValues, indent, nesting, flushLeft: chunk.flushLeft));
+ length + 1, ruleValues, indent, nesting,
+ flushLeft: chunk.flushLeft));
}
String toString() {
@@ -102,9 +103,8 @@ class LinePrefix {
if (_indent != 0) result += " indent ${_indent}";
if (_nesting.indent != 0) result += " nesting ${_nesting.indent}";
if (ruleValues.isNotEmpty) {
- var rules = ruleValues.keys
- .map((key) => "$key:${ruleValues[key]}")
- .join(" ");
+ var rules =
+ ruleValues.keys.map((key) => "$key:${ruleValues[key]}").join(" ");
result += " rules $rules";
}
« no previous file with comments | « lib/src/debug.dart ('k') | lib/src/line_splitter.dart » ('j') | lib/src/source_visitor.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698