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

Side by Side Diff: pkg/analyzer/lib/src/services/formatter_impl.dart

Issue 186153005: New analzyer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use meaningful name instead of '_' in predicate. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | pkg/analyzer/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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 formatter_impl; 5 library formatter_impl;
6 6
7 import 'dart:math'; 7 import 'dart:math';
8 8
9 import 'package:analyzer/analyzer.dart'; 9 import 'package:analyzer/analyzer.dart';
10 import 'package:analyzer/src/generated/parser.dart'; 10 import 'package:analyzer/src/generated/parser.dart';
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 303 }
304 304
305 // Cached parser for testing token types. 305 // Cached parser for testing token types.
306 final tokenTester = new Parser(null,null); 306 final tokenTester = new Parser(null,null);
307 307
308 /// Test if this token is an EOF token. 308 /// Test if this token is an EOF token.
309 bool isEOF(Token token) => tokenIs(token, TokenType.EOF); 309 bool isEOF(Token token) => tokenIs(token, TokenType.EOF);
310 310
311 /// Test for token type. 311 /// Test for token type.
312 bool tokenIs(Token token, TokenType type) => 312 bool tokenIs(Token token, TokenType type) =>
313 token != null && tokenTester.matches4(token, type); 313 token != null && tokenTester.matchesAny(token, [type]);
314 314
315 /// Test if this token is a GT token. 315 /// Test if this token is a GT token.
316 bool isGT(Token token) => tokenIs(token, TokenType.GT); 316 bool isGT(Token token) => tokenIs(token, TokenType.GT);
317 317
318 /// Test if this token is a GT_GT token. 318 /// Test if this token is a GT_GT token.
319 bool isGT_GT(Token token) => tokenIs(token, TokenType.GT_GT); 319 bool isGT_GT(Token token) => tokenIs(token, TokenType.GT_GT);
320 320
321 /// Test if this token is an INDEX token. 321 /// Test if this token is an INDEX token.
322 bool isINDEX(Token token) => tokenIs(token, TokenType.INDEX); 322 bool isINDEX(Token token) => tokenIs(token, TokenType.INDEX);
323 323
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 var lastLine = 1752 var lastLine =
1753 lineInfo.getLocation(lastOffset).lineNumber; 1753 lineInfo.getLocation(lastOffset).lineNumber;
1754 var currentLine = 1754 var currentLine =
1755 lineInfo.getLocation(currentOffset).lineNumber; 1755 lineInfo.getLocation(currentOffset).lineNumber;
1756 return currentLine - lastLine; 1756 return currentLine - lastLine;
1757 } 1757 }
1758 1758
1759 String toString() => writer.toString(); 1759 String toString() => writer.toString();
1760 1760
1761 } 1761 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | pkg/analyzer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698