Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 * **docgen** is a tool for creating machine readable representations of Dart | 6 * **docgen** is a tool for creating machine readable representations of Dart |
| 7 * code metadata, including: classes, members, comments and annotations. | 7 * code metadata, including: classes, members, comments and annotations. |
| 8 * | 8 * |
| 9 * docgen is run on a `.dart` file or a directory containing `.dart` files. | 9 * docgen is run on a `.dart` file or a directory containing `.dart` files. |
| 10 * | 10 * |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 476 */ | 476 */ |
| 477 void _writeToFile(String text, String filename, {bool append: false}) { | 477 void _writeToFile(String text, String filename, {bool append: false}) { |
| 478 Directory dir = new Directory('docs'); | 478 Directory dir = new Directory('docs'); |
| 479 if (!dir.existsSync()) { | 479 if (!dir.existsSync()) { |
| 480 dir.createSync(); | 480 dir.createSync(); |
| 481 } | 481 } |
| 482 File file = new File('docs/$filename'); | 482 File file = new File('docs/$filename'); |
| 483 if (!file.existsSync()) { | 483 if (!file.existsSync()) { |
| 484 file.createSync(); | 484 file.createSync(); |
| 485 } | 485 } |
| 486 file.writeAsString(text, mode: append ? FileMode.APPEND : FileMode.WRITE); | 486 file.writeAsStringSync(text, mode: append ? FileMode.APPEND : FileMode.WRITE); |
|
Emily Fortuna
2013/08/08 21:07:56
did you time this on linux? does this increase the
Tate Mandel
2013/08/08 21:19:13
I ran each version several times on Linux.
This v
Emily Fortuna
2013/08/08 21:58:22
Curious! Well, I'm convinced! After you submit thi
| |
| 487 } | 487 } |
| 488 | 488 |
| 489 /** | 489 /** |
| 490 * Transforms the map by calling toMap on each value in it. | 490 * Transforms the map by calling toMap on each value in it. |
| 491 */ | 491 */ |
| 492 Map recurseMap(Map inputMap) { | 492 Map recurseMap(Map inputMap) { |
| 493 var outputMap = {}; | 493 var outputMap = {}; |
| 494 inputMap.forEach((key, value) { | 494 inputMap.forEach((key, value) { |
| 495 if (value is Map) { | 495 if (value is Map) { |
| 496 outputMap[key] = recurseMap(value); | 496 outputMap[key] = recurseMap(value); |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1039 String qualifiedName; | 1039 String qualifiedName; |
| 1040 List<String> parameters; | 1040 List<String> parameters; |
| 1041 | 1041 |
| 1042 Annotation(this.qualifiedName, this.parameters); | 1042 Annotation(this.qualifiedName, this.parameters); |
| 1043 | 1043 |
| 1044 Map toMap() => { | 1044 Map toMap() => { |
| 1045 'name': qualifiedName, | 1045 'name': qualifiedName, |
| 1046 'parameters': parameters | 1046 'parameters': parameters |
| 1047 }; | 1047 }; |
| 1048 } | 1048 } |
| OLD | NEW |