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

Unified Diff: lib/src/chunk.dart

Issue 1000513002: Tweak formatting rules. Fix #211. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Update changelog. Created 5 years, 9 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 | « CHANGELOG.md ('k') | lib/src/line_writer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/chunk.dart
diff --git a/lib/src/chunk.dart b/lib/src/chunk.dart
index e0604275ae4c86cbdeb5ddc628005afd4a624187..307cd95f7de3139cee8aae18b23c040dbe9d1b46 100644
--- a/lib/src/chunk.dart
+++ b/lib/src/chunk.dart
@@ -230,9 +230,19 @@ class Cost {
/// greater number of nested spans.
static const normal = 1;
- /// The cost of splitting after a "=" both for assignment and initialization.
+ /// Splitting after a "=" both for assignment and initialization.
static const assignment = 2;
+ /// Splitting before the first argument when it happens to be a function
+ /// expression with a block body.
+ static const firstBlockArgument = 2;
+
+ /// The series of positional arguments.
+ static const positionalArguments = 2;
+
+ /// Splitting inside the brackets of a list with only one element.
+ static const singleElementList = 2;
+
/// The cost of a single character that goes past the page limit.
///
/// This cost is high to ensure any solution that fits in the page is
@@ -267,7 +277,8 @@ class SplitParam {
final implies = <SplitParam>[];
/// Creates a new [SplitParam].
- SplitParam([this.cost = Cost.normal]);
+ SplitParam([int cost])
+ : cost = cost != null ? cost : Cost.normal;
String toString() => "$id";
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/line_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698