| 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 Java code generation. | 6 * Tools for Java code generation. |
| 7 */ | 7 */ |
| 8 import 'package:analyzer/src/codegen/tools.dart'; | 8 import 'package:analyzer/src/codegen/tools.dart'; |
| 9 import 'package:front_end/src/codegen/tools.dart'; | 9 import 'package:front_end/src/codegen/tools.dart'; |
| 10 import 'package:html/dom.dart' as dom; | 10 import 'package:html/dom.dart' as dom; |
| 11 | 11 |
| 12 import 'api.dart'; | 12 import 'api.dart'; |
| 13 import 'from_html.dart'; | 13 import 'from_html.dart'; |
| 14 import 'to_html.dart'; | 14 import 'to_html.dart'; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. | 17 * Create a [GeneratedFile] that creates Java code and outputs it to [path]. |
| 18 * [path] uses Posix-style path separators regardless of the OS. | 18 * [path] uses Posix-style path separators regardless of the OS. |
| 19 */ | 19 */ |
| 20 GeneratedFile javaGeneratedFile( | 20 GeneratedFile javaGeneratedFile( |
| 21 String path, CodegenJavaVisitor createVisitor(Api api)) { | 21 String path, CodegenJavaVisitor createVisitor(Api api)) { |
| 22 return new GeneratedFile(path, (String pkgPath) { | 22 return new GeneratedFile(path, (String pkgPath) async { |
| 23 CodegenJavaVisitor visitor = createVisitor(readApi(pkgPath)); | 23 CodegenJavaVisitor visitor = createVisitor(readApi(pkgPath)); |
| 24 return visitor.collectCode(visitor.visitApi); | 24 return visitor.collectCode(visitor.visitApi); |
| 25 }); | 25 }); |
| 26 } | 26 } |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * Iterate through the values in [map] in the order of increasing keys. | 29 * Iterate through the values in [map] in the order of increasing keys. |
| 30 */ | 30 */ |
| 31 Iterable<String> _valuesSortedByKey(Map<String, String> map) { | 31 Iterable<String> _valuesSortedByKey(Map<String, String> map) { |
| 32 List<String> keys = map.keys.toList(); | 32 List<String> keys = map.keys.toList(); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 /** | 292 /** |
| 293 * Temporary storage for private fields. | 293 * Temporary storage for private fields. |
| 294 */ | 294 */ |
| 295 Map<String, String> privateFields = <String, String>{}; | 295 Map<String, String> privateFields = <String, String>{}; |
| 296 | 296 |
| 297 /** | 297 /** |
| 298 * Temporary storage for constructors. | 298 * Temporary storage for constructors. |
| 299 */ | 299 */ |
| 300 Map<String, String> constructors = <String, String>{}; | 300 Map<String, String> constructors = <String, String>{}; |
| 301 } | 301 } |
| OLD | NEW |