OLD | NEW |
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 /** | 5 /** |
6 * Tools for generating code in analyzer and analysis server. | 6 * Tools for generating code in analyzer and analysis server. |
7 */ | 7 */ |
8 library analyzer.src.codegen.tools; | 8 library analyzer.src.codegen.tools; |
9 | 9 |
10 import 'dart:io'; | 10 import 'dart:io'; |
11 | 11 |
| 12 import 'package:analyzer/src/codegen/html.dart'; |
| 13 import 'package:analyzer/src/codegen/text_formatter.dart'; |
12 import 'package:html/dom.dart' as dom; | 14 import 'package:html/dom.dart' as dom; |
13 import 'package:path/path.dart'; | 15 import 'package:path/path.dart'; |
14 | 16 |
15 import 'html.dart'; | |
16 import 'text_formatter.dart'; | |
17 | |
18 final RegExp trailingSpacesInLineRegExp = new RegExp(r' +$', multiLine: true); | 17 final RegExp trailingSpacesInLineRegExp = new RegExp(r' +$', multiLine: true); |
19 final RegExp trailingWhitespaceRegExp = new RegExp(r'[\n ]+$'); | 18 final RegExp trailingWhitespaceRegExp = new RegExp(r'[\n ]+$'); |
20 | 19 |
21 /** | 20 /** |
22 * Join the given strings using camelCase. If [doCapitalize] is true, the first | 21 * Join the given strings using camelCase. If [doCapitalize] is true, the first |
23 * part will be capitalized as well. | 22 * part will be capitalized as well. |
24 */ | 23 */ |
25 String camelJoin(List<String> parts, {bool doCapitalize: false}) { | 24 String camelJoin(List<String> parts, {bool doCapitalize: false}) { |
26 List<String> upcasedParts = <String>[]; | 25 List<String> upcasedParts = <String>[]; |
27 for (int i = 0; i < parts.length; i++) { | 26 for (int i = 0; i < parts.length; i++) { |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 if (lines.last.isEmpty) { | 597 if (lines.last.isEmpty) { |
599 lines.removeLast(); | 598 lines.removeLast(); |
600 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); | 599 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); |
601 indentNeeded = true; | 600 indentNeeded = true; |
602 } else { | 601 } else { |
603 buffer.add(new dom.Text(lines.join('\n$indent'))); | 602 buffer.add(new dom.Text(lines.join('\n$indent'))); |
604 indentNeeded = false; | 603 indentNeeded = false; |
605 } | 604 } |
606 } | 605 } |
607 } | 606 } |
OLD | NEW |