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

Side by Side Diff: lib/src/argument_list_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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/src/chunk.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.argument_list_visitor; 5 library dart_style.src.argument_list_visitor;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/src/generated/scanner.dart'; 8 import 'package:analyzer/src/generated/scanner.dart';
9 9
10 import 'chunk.dart'; 10 import 'chunk.dart';
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 return new ArgumentSublist._(allArguments, positional, named, collections, 284 return new ArgumentSublist._(allArguments, positional, named, collections,
285 leadingCollections, trailingCollections); 285 leadingCollections, trailingCollections);
286 } 286 }
287 287
288 ArgumentSublist._(this._allArguments, this._positional, this._named, 288 ArgumentSublist._(this._allArguments, this._positional, this._named,
289 this._collections, this._leadingCollections, this._trailingCollections); 289 this._collections, this._leadingCollections, this._trailingCollections);
290 290
291 void visit(SourceVisitor visitor) { 291 void visit(SourceVisitor visitor) {
292 if (_collections.isNotEmpty) { 292 if (_collections.isNotEmpty) {
293 _collectionRule = new SimpleRule(Cost.splitCollections); 293 _collectionRule = new Rule(Cost.splitCollections);
294 } 294 }
295 295
296 var rule = _visitPositional(visitor); 296 var rule = _visitPositional(visitor);
297 _visitNamed(visitor, rule); 297 _visitNamed(visitor, rule);
298 } 298 }
299 299
300 /// Writes the positional arguments, if any. 300 /// Writes the positional arguments, if any.
301 PositionalRule _visitPositional(SourceVisitor visitor) { 301 PositionalRule _visitPositional(SourceVisitor visitor) {
302 if (_positional.isEmpty) return null; 302 if (_positional.isEmpty) return null;
303 303
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 422
423 // TODO(rnystrom): Should we step into parenthesized expressions? 423 // TODO(rnystrom): Should we step into parenthesized expressions?
424 424
425 if (expression is ListLiteral) return expression.leftBracket; 425 if (expression is ListLiteral) return expression.leftBracket;
426 if (expression is MapLiteral) return expression.leftBracket; 426 if (expression is MapLiteral) return expression.leftBracket;
427 427
428 // Not a collection literal. 428 // Not a collection literal.
429 return null; 429 return null;
430 } 430 }
431 } 431 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/chunk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698