| 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 * A script to assist in documenting the difference between the dart:html API | 6 * A script to assist in documenting the difference between the dart:html API |
| 7 * and the old DOM API. | 7 * and the old DOM API. |
| 8 */ | 8 */ |
| 9 library html_diff; | 9 library html_diff; |
| 10 | 10 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 /** | 227 /** |
| 228 * Extracts a [Map] from tag names to values from [comment], which is parsed | 228 * Extracts a [Map] from tag names to values from [comment], which is parsed |
| 229 * from a Dart source file via dartdoc. Tags are of the form `@NAME VALUE`, | 229 * from a Dart source file via dartdoc. Tags are of the form `@NAME VALUE`, |
| 230 * where `NAME` is alphabetic and `VALUE` can contain any character other than | 230 * where `NAME` is alphabetic and `VALUE` can contain any character other than |
| 231 * `;`. Multiple tags can be separated by semicolons. | 231 * `;`. Multiple tags can be separated by semicolons. |
| 232 * | 232 * |
| 233 * At time of writing, the only tag that's used is `@domName`. | 233 * At time of writing, the only tag that's used is `@domName`. |
| 234 */ | 234 */ |
| 235 Map<String, String> _getTags(String comment) { | 235 Map<String, String> _getTags(String comment) { |
| 236 if (comment == null) return const <String, String>{}; | 236 if (comment == null) return const <String, String>{}; |
| 237 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); | 237 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); |
| 238 final tags = <String, String>{}; | 238 final tags = <String, String>{}; |
| 239 for (var m in re.allMatches(comment.trim())) { | 239 for (var m in re.allMatches(comment.trim())) { |
| 240 tags[m[1]] = m[2]; | 240 tags[m[1]] = m[2]; |
| 241 } | 241 } |
| 242 return tags; | 242 return tags; |
| 243 } | 243 } |
| 244 } | 244 } |
| OLD | NEW |