Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: utils/apidoc/html_diff.dart

Issue 10559030: Remove uses of string + from API document generator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove process_test.cc changes. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/dartdoc/frog/world.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 * calling [HtmlDiff.run]. 70 * calling [HtmlDiff.run].
71 */ 71 */
72 static void initialize() { 72 static void initialize() {
73 world.getOrAddLibrary('dart:dom_deprecated'); 73 world.getOrAddLibrary('dart:dom_deprecated');
74 world.getOrAddLibrary('dart:html'); 74 world.getOrAddLibrary('dart:html');
75 world.process(); 75 world.process();
76 76
77 dom = world.libraries['dart:dom_deprecated']; 77 dom = world.libraries['dart:dom_deprecated'];
78 } 78 }
79 79
80 HtmlDiff([bool printWarnings = false]) : 80 HtmlDiff([bool printWarnings = false]) :
81 _printWarnings = printWarnings, 81 _printWarnings = printWarnings,
82 domToHtml = new Map<Member, Set<Member>>(), 82 domToHtml = new Map<Member, Set<Member>>(),
83 htmlToDom = new Map<Member, Set<Member>>(), 83 htmlToDom = new Map<Member, Set<Member>>(),
84 domTypesToHtml = new Map<Type, Set<Type>>(), 84 domTypesToHtml = new Map<Type, Set<Type>>(),
85 htmlTypesToDom = new Map<Type, Set<Type>>(), 85 htmlTypesToDom = new Map<Type, Set<Type>>(),
86 comments = new CommentMap(); 86 comments = new CommentMap();
87 87
88 void warn(String s) { 88 void warn(String s) {
89 if (_printWarnings) { 89 if (_printWarnings) {
90 print('Warning: ' + s); 90 print('Warning: $s');
91 } 91 }
92 } 92 }
93 93
94 /** 94 /**
95 * Computes the `dart:dom_deprecated` to `dart:html` mapping, and 95 * Computes the `dart:dom_deprecated` to `dart:html` mapping, and
96 * places it in [domToHtml], [htmlToDom], [domTypesToHtml], and 96 * places it in [domToHtml], [htmlToDom], [domTypesToHtml], and
97 * [htmlTypesToDom]. Before this is run, Frog should be initialized 97 * [htmlTypesToDom]. Before this is run, Frog should be initialized
98 * (via [parseOptions] and [initializeWorld]) and 98 * (via [parseOptions] and [initializeWorld]) and
99 * [HtmlDiff.initialize] should be called. 99 * [HtmlDiff.initialize] should be called.
100 */ 100 */
(...skipping 22 matching lines...) Expand all
123 * defining [Type]. 123 * defining [Type].
124 */ 124 */
125 void _addMemberDiff(Member htmlMember, List<Type> domTypes) { 125 void _addMemberDiff(Member htmlMember, List<Type> domTypes) {
126 if (htmlMember.isProperty) { 126 if (htmlMember.isProperty) {
127 if (htmlMember.canGet) _addMemberDiff(htmlMember.getter, domTypes); 127 if (htmlMember.canGet) _addMemberDiff(htmlMember.getter, domTypes);
128 if (htmlMember.canSet) _addMemberDiff(htmlMember.setter, domTypes); 128 if (htmlMember.canSet) _addMemberDiff(htmlMember.setter, domTypes);
129 } 129 }
130 130
131 var domMembers = htmlToDomMembers(htmlMember, domTypes); 131 var domMembers = htmlToDomMembers(htmlMember, domTypes);
132 if (htmlMember == null && !domMembers.isEmpty()) { 132 if (htmlMember == null && !domMembers.isEmpty()) {
133 warn('dart:html member ${htmlMember.declaringType.name}.' + 133 warn('dart:html member ${htmlMember.declaringType.name}.'
134 '${htmlMember.name} has no corresponding dart:html member.'); 134 '${htmlMember.name} has no corresponding dart:html member.');
135 } 135 }
136 136
137 if (htmlMember == null) return; 137 if (htmlMember == null) return;
138 if (!domMembers.isEmpty()) htmlToDom[htmlMember] = domMembers; 138 if (!domMembers.isEmpty()) htmlToDom[htmlMember] = domMembers;
139 domMembers.forEach((m) => 139 domMembers.forEach((m) =>
140 domToHtml.putIfAbsent(m, () => new Set()).add(htmlMember)); 140 domToHtml.putIfAbsent(m, () => new Set()).add(htmlMember));
141 } 141 }
142 142
143 /** 143 /**
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 Map<String, String> _getTags(String comment) { 243 Map<String, String> _getTags(String comment) {
244 if (comment == null) return const <String>{}; 244 if (comment == null) return const <String>{};
245 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); 245 final re = const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)");
246 final tags = <String>{}; 246 final tags = <String>{};
247 for (var m in re.allMatches(comment.trim())) { 247 for (var m in re.allMatches(comment.trim())) {
248 tags[m[1]] = m[2]; 248 tags[m[1]] = m[2];
249 } 249 }
250 return tags; 250 return tags;
251 } 251 }
252 } 252 }
OLDNEW
« no previous file with comments | « lib/dartdoc/frog/world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698