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 code generation. |
7 */ | 7 */ |
8 library codegen.tools; | 8 library codegen.tools; |
9 | 9 |
10 import 'dart:io'; | 10 import 'dart:io'; |
11 | 11 |
12 import 'package:html5lib/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_tools.dart'; |
16 import 'text_formatter.dart'; | 16 import 'text_formatter.dart'; |
17 | 17 |
18 final RegExp trailingWhitespaceRegExp = new RegExp(r' +$', multiLine: true); | 18 final RegExp trailingWhitespaceRegExp = new RegExp(r' +$', multiLine: true); |
19 | 19 |
20 /** | 20 /** |
21 * 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 |
22 * part will be capitalized as well. | 22 * part will be capitalized as well. |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 if (lines.last.isEmpty) { | 522 if (lines.last.isEmpty) { |
523 lines.removeLast(); | 523 lines.removeLast(); |
524 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); | 524 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); |
525 indentNeeded = true; | 525 indentNeeded = true; |
526 } else { | 526 } else { |
527 buffer.add(new dom.Text(lines.join('\n$indent'))); | 527 buffer.add(new dom.Text(lines.join('\n$indent'))); |
528 indentNeeded = false; | 528 indentNeeded = false; |
529 } | 529 } |
530 } | 530 } |
531 } | 531 } |
OLD | NEW |