OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 final Map<Member, Set<Member>> htmlToDom; | 78 final Map<Member, Set<Member>> htmlToDom; |
79 | 79 |
80 /** A map from `dart:dom` types to corresponding `dart:html` types. */ | 80 /** A map from `dart:dom` types to corresponding `dart:html` types. */ |
81 final Map<Type, Set<Type>> domTypesToHtml; | 81 final Map<Type, Set<Type>> domTypesToHtml; |
82 | 82 |
83 /** A map from `dart:html` types to corresponding `dart:dom` types. */ | 83 /** A map from `dart:html` types to corresponding `dart:dom` types. */ |
84 final Map<Type, Set<Type>> htmlTypesToDom; | 84 final Map<Type, Set<Type>> htmlTypesToDom; |
85 | 85 |
86 final CommentMap comments; | 86 final CommentMap comments; |
87 | 87 |
88 final Library dom; | 88 static Library dom; |
89 | 89 |
90 /** | 90 /** |
91 * Perform static initialization of [world]. This should be run before | 91 * Perform static initialization of [world]. This should be run before |
92 * calling [HtmlDiff.run]. | 92 * calling [HtmlDiff.run]. |
93 */ | 93 */ |
94 static void initialize() { | 94 static void initialize() { |
95 world.processDartScript('dart:htmlimpl'); | 95 world.processDartScript('dart:htmlimpl'); |
96 world.resolveAll(); | 96 world.resolveAll(); |
97 dom = world.libraries['dart:dom']; | 97 dom = world.libraries['dart:dom']; |
98 } | 98 } |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 Map<String, String> _getTags(String comment) { | 428 Map<String, String> _getTags(String comment) { |
429 if (comment == null) return const <String>{}; | 429 if (comment == null) return const <String>{}; |
430 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); | 430 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); |
431 final tags = <String>{}; | 431 final tags = <String>{}; |
432 for (var m in re.allMatches(comment.trim())) { | 432 for (var m in re.allMatches(comment.trim())) { |
433 tags[m[1]] = m[2]; | 433 tags[m[1]] = m[2]; |
434 } | 434 } |
435 return tags; | 435 return tags; |
436 } | 436 } |
437 } | 437 } |
OLD | NEW |