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

Unified Diff: lib/src/source_visitor.dart

Issue 1492683002: Change the way hard splits are handled. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years 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 | « lib/src/rule/rule.dart ('k') | test/regression/0200/0221.unit » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/source_visitor.dart
diff --git a/lib/src/source_visitor.dart b/lib/src/source_visitor.dart
index 63e6f23258c8630058d33398af02a7a8f22a2688..79d3e86e5b91f6a72177f38f11cca60ca8349c30 100644
--- a/lib/src/source_visitor.dart
+++ b/lib/src/source_visitor.dart
@@ -307,7 +307,7 @@ class SourceVisitor implements AstVisitor {
visitNodes(node.cascadeSections, between: zeroSplit);
builder.endRule();
} else {
- builder.startRule(new HardSplitRule());
+ builder.startRule(new Rule.hard());
zeroSplit();
visitNodes(node.cascadeSections, between: zeroSplit);
builder.endRule();
@@ -1727,7 +1727,7 @@ class SourceVisitor implements AstVisitor {
builder.nestExpression();
// This rule is ended by visitExpressionFunctionBody().
- builder.startLazyRule(new SimpleRule(Cost.arrow));
+ builder.startLazyRule(new Rule(Cost.arrow));
}
if (parameters != null) {
@@ -1828,7 +1828,7 @@ class SourceVisitor implements AstVisitor {
// Always use a hard rule to split the elements. The parent chunk of
// the collection will handle the unsplit case, so this only comes
// into play when the collection is split.
- var rule = new HardSplitRule();
+ var rule = new Rule.hard();
builder.startRule(rule);
// If a collection contains a line comment, we assume it's a big complex
@@ -2118,7 +2118,7 @@ class SourceVisitor implements AstVisitor {
/// Writes a single space split with its own rule.
void soloSplit([int cost]) {
- builder.startRule(new SimpleRule(cost));
+ builder.startRule(new Rule(cost));
split();
builder.endRule();
}
« no previous file with comments | « lib/src/rule/rule.dart ('k') | test/regression/0200/0221.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698