| 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 taking a JSON file and putting the comments located within into | 6 * Library for taking a JSON file and putting the comments located within into |
| 7 * the HTML files the comments are associated with. | 7 * the HTML files the comments are associated with. |
| 8 * | 8 * |
| 9 * The format of the JSON file is: | 9 * The format of the JSON file is: |
| 10 * | 10 * |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 unusedComments.putIfAbsent(key, () => comments); | 133 unusedComments.putIfAbsent(key, () => comments); |
| 134 } | 134 } |
| 135 }); | 135 }); |
| 136 | 136 |
| 137 unusedComments.forEach((String key, _) { | 137 unusedComments.forEach((String key, _) { |
| 138 print('WARNING: the following key was found in the JSON but not in ' | 138 print('WARNING: the following key was found in the JSON but not in ' |
| 139 '${new Path(file.fullPathSync()).filename}:\n"$key"'); | 139 '${new Path(file.fullPathSync()).filename}:\n"$key"'); |
| 140 _anyErrors = true; | 140 _anyErrors = true; |
| 141 }); | 141 }); |
| 142 | 142 |
| 143 for (var i = 0; i < fileLines.length; ++i) { |
| 144 fileLines[i] = fileLines[i].replaceAll(new RegExp(r'\s+$'), ''); |
| 145 } |
| 146 |
| 143 // TODO(amouravski): file.writeAsStringSync('${Strings.join(fileLines, '\n')}\
n'); | 147 // TODO(amouravski): file.writeAsStringSync('${Strings.join(fileLines, '\n')}\
n'); |
| 144 var outputStream = file.openOutputStream(); | 148 var outputStream = file.openOutputStream(); |
| 145 outputStream.writeString(Strings.join(fileLines, '\n')); | 149 outputStream.writeString(Strings.join(fileLines, '\n')); |
| 146 outputStream.writeString('\n'); | 150 outputStream.writeString('\n'); |
| 147 | 151 |
| 148 outputStream.onNoPendingWrites = () { | 152 outputStream.onNoPendingWrites = () { |
| 149 outputStream.close(); | 153 outputStream.close(); |
| 150 }; | 154 }; |
| 151 } | 155 } |
| OLD | NEW |