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

Unified Diff: lib/src/chunk.dart

Issue 987223002: Discard unused nesting levels. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: 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 | « benchmark/before.dart.txt ('k') | lib/src/line_splitter.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 f4e46da347b9bc2f5b3f46af1ef97b92d544620a..58f88af10aba468cbfbca8da3d72f4ea4ad8a83f 100644
--- a/lib/src/chunk.dart
+++ b/lib/src/chunk.dart
@@ -87,8 +87,7 @@ class Chunk extends Selection {
/// someFunctionName(argument, argument,
/// argument, anotherFunction(argument,
/// argument));
- int get nesting => _nesting;
- int _nesting = -1;
+ int nesting = -1;
/// Whether or not the chunk occurs inside an expression.
///
@@ -96,7 +95,7 @@ class Chunk extends Selection {
/// are to determine the indentation of subsequent lines. "Statement level"
/// splits that occur between statements or in the top-level of a unit only
/// take the main indent level into account.
- bool get isInExpression => _nesting != -1;
+ bool get isInExpression => nesting != -1;
/// Whether it's valid to add more text to this chunk or not.
///
@@ -181,7 +180,7 @@ class Chunk extends Selection {
// Last newline settings win.
_indent = indent;
- _nesting = nesting;
+ this.nesting = nesting;
_spaceWhenUnsplit = spaceWhenUnsplit;
// Preserve a blank line.
@@ -194,7 +193,7 @@ class Chunk extends Selection {
if (text.isNotEmpty) parts.add("${Color.bold}$text${Color.none}");
if (_indent != 0 && _indent != null) parts.add("indent:$_indent");
- if (_nesting != -1) parts.add("nest:$_nesting");
+ if (nesting != -1) parts.add("nest:$nesting");
if (spaceWhenUnsplit) parts.add("space");
if (_isDouble) parts.add("double");
« no previous file with comments | « benchmark/before.dart.txt ('k') | lib/src/line_splitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698