| 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 code generation. | 6 * Tools for generating code in analyzer and analysis server. |
| 7 */ | 7 */ |
| 8 library codegen.tools; | 8 library analyzer.src.codegen.tools; |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| 11 | 11 |
| 12 import 'package:html/dom.dart' as dom; | 12 import 'package:html/dom.dart' as dom; |
| 13 import 'package:path/path.dart'; | 13 import 'package:path/path.dart'; |
| 14 | 14 |
| 15 import 'html_tools.dart'; | 15 import 'html.dart'; |
| 16 import 'text_formatter.dart'; | 16 import 'text_formatter.dart'; |
| 17 | 17 |
| 18 final RegExp trailingWhitespaceRegExp = new RegExp(r'[\n ]+$'); | 18 final RegExp trailingWhitespaceRegExp = new RegExp(r'[\n ]+$'); |
| 19 final RegExp trailingSpacesInLineRegExp = new RegExp(r' +$', multiLine: true); | 19 final RegExp trailingSpacesInLineRegExp = new RegExp(r' +$', multiLine: true); |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Join the given strings using camelCase. If [doCapitalize] is true, the first | 22 * Join the given strings using camelCase. If [doCapitalize] is true, the first |
| 23 * part will be capitalized as well. | 23 * part will be capitalized as well. |
| 24 */ | 24 */ |
| 25 String camelJoin(List<String> parts, {bool doCapitalize: false}) { | 25 String camelJoin(List<String> parts, {bool doCapitalize: false}) { |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 if (lines.last.isEmpty) { | 548 if (lines.last.isEmpty) { |
| 549 lines.removeLast(); | 549 lines.removeLast(); |
| 550 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); | 550 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); |
| 551 indentNeeded = true; | 551 indentNeeded = true; |
| 552 } else { | 552 } else { |
| 553 buffer.add(new dom.Text(lines.join('\n$indent'))); | 553 buffer.add(new dom.Text(lines.join('\n$indent'))); |
| 554 indentNeeded = false; | 554 indentNeeded = false; |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 } | 557 } |
| OLD | NEW |