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

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

Issue 118333003: Fix to handle loop variables not declared in the for. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/stmt_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/java_core.dart' show CharSequence; 10 import 'package:analyzer/src/generated/java_core.dart' show CharSequence;
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 token(node.thisToken); 747 token(node.thisToken);
748 token(node.period); 748 token(node.period);
749 visit(node.identifier); 749 visit(node.identifier);
750 visit(node.parameters); 750 visit(node.parameters);
751 } 751 }
752 752
753 visitForEachStatement(ForEachStatement node) { 753 visitForEachStatement(ForEachStatement node) {
754 token(node.forKeyword); 754 token(node.forKeyword);
755 space(); 755 space();
756 token(node.leftParenthesis); 756 token(node.leftParenthesis);
757 visit(node.loopVariable); 757 if (node.loopVariable != null) {
758 visit(node.loopVariable);
759 } else {
760 visit(node.identifier);
761 }
758 space(); 762 space();
759 token(node.inKeyword); 763 token(node.inKeyword);
760 space(); 764 space();
761 visit(node.iterator); 765 visit(node.iterator);
762 token(node.rightParenthesis); 766 token(node.rightParenthesis);
763 space(); 767 space();
764 visit(node.body); 768 visit(node.body);
765 } 769 }
766 770
767 visitFormalParameterList(FormalParameterList node) { 771 visitFormalParameterList(FormalParameterList node) {
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 var lastLine = 1672 var lastLine =
1669 lineInfo.getLocation(lastOffset).lineNumber; 1673 lineInfo.getLocation(lastOffset).lineNumber;
1670 var currentLine = 1674 var currentLine =
1671 lineInfo.getLocation(currentOffset).lineNumber; 1675 lineInfo.getLocation(currentOffset).lineNumber;
1672 return currentLine - lastLine; 1676 return currentLine - lastLine;
1673 } 1677 }
1674 1678
1675 String toString() => writer.toString(); 1679 String toString() => writer.toString();
1676 1680
1677 } 1681 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/services/data/stmt_tests.data » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698