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

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

Issue 943033002: Change executable name to "darfmt". Fix #163. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Fix warning. Created 5 years, 10 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 | « bin/format.dart ('k') | pubspec.yaml » ('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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 token(node.period); 1123 token(node.period);
1124 visit(node.identifier); 1124 visit(node.identifier);
1125 } 1125 }
1126 1126
1127 visitPrefixExpression(PrefixExpression node) { 1127 visitPrefixExpression(PrefixExpression node) {
1128 token(node.operator); 1128 token(node.operator);
1129 1129
1130 // Corner case: put a space between successive "-" operators so we don't 1130 // Corner case: put a space between successive "-" operators so we don't
1131 // inadvertently turn them into a "--" decrement operator. 1131 // inadvertently turn them into a "--" decrement operator.
1132 if (node.operand is PrefixExpression && 1132 if (node.operand is PrefixExpression &&
1133 node.operand.operator.lexeme == "-") { 1133 (node.operand as PrefixExpression).operator.lexeme == "-") {
1134 space(); 1134 space();
1135 } 1135 }
1136 1136
1137 visit(node.operand); 1137 visit(node.operand);
1138 } 1138 }
1139 1139
1140 visitPropertyAccess(PropertyAccess node) { 1140 visitPropertyAccess(PropertyAccess node) {
1141 if (node.isCascaded) { 1141 if (node.isCascaded) {
1142 token(node.operator); 1142 token(node.operator);
1143 } else { 1143 } else {
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 /// Gets the 1-based line number that the beginning of [token] lies on. 1931 /// Gets the 1-based line number that the beginning of [token] lies on.
1932 int _startLine(Token token) => _lineInfo.getLocation(token.offset).lineNumber; 1932 int _startLine(Token token) => _lineInfo.getLocation(token.offset).lineNumber;
1933 1933
1934 /// Gets the 1-based line number that the end of [token] lies on. 1934 /// Gets the 1-based line number that the end of [token] lies on.
1935 int _endLine(Token token) => _lineInfo.getLocation(token.end).lineNumber; 1935 int _endLine(Token token) => _lineInfo.getLocation(token.end).lineNumber;
1936 1936
1937 /// Gets the 1-based column number that the beginning of [token] lies on. 1937 /// Gets the 1-based column number that the beginning of [token] lies on.
1938 int _startColumn(Token token) => 1938 int _startColumn(Token token) =>
1939 _lineInfo.getLocation(token.offset).columnNumber; 1939 _lineInfo.getLocation(token.offset).columnNumber;
1940 } 1940 }
OLDNEW
« no previous file with comments | « bin/format.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698