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

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

Issue 884513002: Support for 'async' in the old formatter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/services/data/cu_tests.data » ('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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 if (!node.statements.isEmpty) { 500 if (!node.statements.isEmpty) {
501 visitNodes(node.statements, precededBy: newlines, separatedBy: newlines); 501 visitNodes(node.statements, precededBy: newlines, separatedBy: newlines);
502 newlines(); 502 newlines();
503 } else { 503 } else {
504 preserveLeadingNewlines(); 504 preserveLeadingNewlines();
505 } 505 }
506 token(node.rightBracket, precededBy: unindent); 506 token(node.rightBracket, precededBy: unindent);
507 } 507 }
508 508
509 visitBlockFunctionBody(BlockFunctionBody node) { 509 visitBlockFunctionBody(BlockFunctionBody node) {
510 token(node.keyword, followedBy: nonBreakingSpace);
510 visit(node.block); 511 visit(node.block);
511 } 512 }
512 513
513 visitBooleanLiteral(BooleanLiteral node) { 514 visitBooleanLiteral(BooleanLiteral node) {
514 token(node.literal); 515 token(node.literal);
515 } 516 }
516 517
517 visitBreakStatement(BreakStatement node) { 518 visitBreakStatement(BreakStatement node) {
518 token(node.keyword); 519 token(node.keyword);
519 visitNode(node.label, precededBy: space); 520 visitNode(node.label, precededBy: space);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 space(); 776 space();
776 visit(node.uri); 777 visit(node.uri);
777 allowContinuedLines((){ 778 allowContinuedLines((){
778 visitNodes(node.combinators, precededBy: space, separatedBy: space); 779 visitNodes(node.combinators, precededBy: space, separatedBy: space);
779 }); 780 });
780 token(node.semicolon); 781 token(node.semicolon);
781 } 782 }
782 783
783 visitExpressionFunctionBody(ExpressionFunctionBody node) { 784 visitExpressionFunctionBody(ExpressionFunctionBody node) {
784 int weight = lastSpaceWeight++; 785 int weight = lastSpaceWeight++;
786 token(node.keyword, followedBy: nonBreakingSpace);
785 token(node.functionDefinition); 787 token(node.functionDefinition);
786 levelSpace(weight); 788 levelSpace(weight);
787 visit(node.expression); 789 visit(node.expression);
788 token(node.semicolon); 790 token(node.semicolon);
789 } 791 }
790 792
791 visitExpressionStatement(ExpressionStatement node) { 793 visitExpressionStatement(ExpressionStatement node) {
792 visit(node.expression); 794 visit(node.expression);
793 token(node.semicolon); 795 token(node.semicolon);
794 } 796 }
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 @override 1845 @override
1844 visitEnumConstantDeclaration(EnumConstantDeclaration node) { 1846 visitEnumConstantDeclaration(EnumConstantDeclaration node) {
1845 // TODO: implement visitEnumConstantDeclaration 1847 // TODO: implement visitEnumConstantDeclaration
1846 } 1848 }
1847 1849
1848 @override 1850 @override
1849 visitEnumDeclaration(EnumDeclaration node) { 1851 visitEnumDeclaration(EnumDeclaration node) {
1850 // TODO: implement visitEnumDeclaration 1852 // TODO: implement visitEnumDeclaration
1851 } 1853 }
1852 } 1854 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/services/data/cu_tests.data » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698