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

Side by Side Diff: lib/src/source_visitor.dart

Issue 826393005: Try to keep constructor calls together. Fix #119. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/regression/119.stmt » ('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.source_visitor; 5 library dart_style.src.source_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 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 10
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 token(node.period); 812 token(node.period);
813 } else { 813 } else {
814 visit(node.target); 814 visit(node.target);
815 } 815 }
816 token(node.leftBracket); 816 token(node.leftBracket);
817 visit(node.index); 817 visit(node.index);
818 token(node.rightBracket); 818 token(node.rightBracket);
819 } 819 }
820 820
821 visitInstanceCreationExpression(InstanceCreationExpression node) { 821 visitInstanceCreationExpression(InstanceCreationExpression node) {
822 _writer.startSpan();
822 token(node.keyword); 823 token(node.keyword);
823 space(); 824 space();
824 visit(node.constructorName); 825 visit(node.constructorName);
825 visit(node.argumentList); 826 visit(node.argumentList);
827 _writer.endSpan();
826 } 828 }
827 829
828 visitIntegerLiteral(IntegerLiteral node) { 830 visitIntegerLiteral(IntegerLiteral node) {
829 token(node.literal); 831 token(node.literal);
830 } 832 }
831 833
832 visitInterpolationExpression(InterpolationExpression node) { 834 visitInterpolationExpression(InterpolationExpression node) {
833 token(node.leftBracket); 835 token(node.leftBracket);
834 visit(node.expression); 836 visit(node.expression);
835 token(node.rightBracket); 837 token(node.rightBracket);
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 /// Gets the 1-based line number that the beginning of [token] lies on. 1676 /// Gets the 1-based line number that the beginning of [token] lies on.
1675 int _startLine(Token token) => _lineInfo.getLocation(token.offset).lineNumber; 1677 int _startLine(Token token) => _lineInfo.getLocation(token.offset).lineNumber;
1676 1678
1677 /// Gets the 1-based line number that the end of [token] lies on. 1679 /// Gets the 1-based line number that the end of [token] lies on.
1678 int _endLine(Token token) => _lineInfo.getLocation(token.end).lineNumber; 1680 int _endLine(Token token) => _lineInfo.getLocation(token.end).lineNumber;
1679 1681
1680 /// Gets the 1-based column number that the beginning of [token] lies on. 1682 /// Gets the 1-based column number that the beginning of [token] lies on.
1681 int _startColumn(Token token) => 1683 int _startColumn(Token token) =>
1682 _lineInfo.getLocation(token.offset).columnNumber; 1684 _lineInfo.getLocation(token.offset).columnNumber;
1683 } 1685 }
OLDNEW
« no previous file with comments | « no previous file | test/regression/119.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698