| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * Library for extracting the documentation comments from files generated by | 6 * Library for extracting the documentation comments from files generated by |
| 7 * the HTML library. The comments are stored in a JSON file. | 7 * the HTML library. The comments are stored in a JSON file. |
| 8 * | 8 * |
| 9 * Comments must be in either the block style with leading *s: | 9 * Comments must be in either the block style with leading *s: |
| 10 * | 10 * |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 _anyErrors = true; | 98 _anyErrors = true; |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 | 101 |
| 102 fileFutures.add(_convertFile(file)); | 102 fileFutures.add(_convertFile(file)); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 | 105 |
| 106 // Combine all JSON objects | 106 // Combine all JSON objects |
| 107 lister.onDone = (_) { | 107 lister.onDone = (_) { |
| 108 Future.wait(fileFutures).then((jsonList) { | 108 Futures.wait(fileFutures).then((jsonList) { |
| 109 var convertedJson = {}; | 109 var convertedJson = {}; |
| 110 jsonList.forEach((json) { | 110 jsonList.forEach((json) { |
| 111 final k = json.keys[0]; | 111 final k = json.keys[0]; |
| 112 convertedJson.putIfAbsent(k, () => json[k]); | 112 convertedJson.putIfAbsent(k, () => json[k]); |
| 113 }); | 113 }); |
| 114 completer.complete(convertedJson); | 114 completer.complete(convertedJson); |
| 115 }); | 115 }); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 // TODO(amouravski): add more error handling. | 118 // TODO(amouravski): add more error handling. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 '${prettyPrintJson(json[key], '$indentation ')}'); | 308 '${prettyPrintJson(json[key], '$indentation ')}'); |
| 309 var recursiveOutput = Strings.join(mapList, ',\n'); | 309 var recursiveOutput = Strings.join(mapList, ',\n'); |
| 310 output = '$indentation{\n' | 310 output = '$indentation{\n' |
| 311 '$recursiveOutput' | 311 '$recursiveOutput' |
| 312 '\n$indentation}'; | 312 '\n$indentation}'; |
| 313 } else { | 313 } else { |
| 314 output = '$indentation${JSON.stringify(json)}'; | 314 output = '$indentation${JSON.stringify(json)}'; |
| 315 } | 315 } |
| 316 return output; | 316 return output; |
| 317 } | 317 } |
| OLD | NEW |