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

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

Issue 9452037: Fix apidoc to work with latest frog. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | « no previous file | 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) 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 * `dart:htmlimpl`, or `null` if there is no such correspondence. 157 * `dart:htmlimpl`, or `null` if there is no such correspondence.
158 */ 158 */
159 Member htmlImplToHtmlMember(Member implMember) { 159 Member htmlImplToHtmlMember(Member implMember) {
160 var htmlType = htmlImplToHtmlType(implMember.declaringType); 160 var htmlType = htmlImplToHtmlType(implMember.declaringType);
161 if (htmlType == null) return null; 161 if (htmlType == null) return null;
162 162
163 bool getter, setter; 163 bool getter, setter;
164 if (implMember.isConstructor || implMember.isFactory) { 164 if (implMember.isConstructor || implMember.isFactory) {
165 var constructor = htmlType.constructors[implMember.name]; 165 var constructor = htmlType.constructors[implMember.name];
166 if (constructor != null) return constructor; 166 if (constructor != null) return constructor;
167 return htmlType.factories[implMember.name]; 167
168 // Look for a factory constructor whose type and name matches the member.
169 return htmlType.factories.getFactoriesFor(implMember.name)[
170 implMember.constructorName];
168 } else if ((getter = implMember.name.startsWith('get:')) || 171 } else if ((getter = implMember.name.startsWith('get:')) ||
169 (setter = implMember.name.startsWith('set:'))) { 172 (setter = implMember.name.startsWith('set:'))) {
170 // Use getMember to follow interface inheritance chains. 173 // Use getMember to follow interface inheritance chains.
171 var htmlProperty = htmlType.getMember(implMember.name.substring(4)); 174 var htmlProperty = htmlType.getMember(implMember.name.substring(4));
172 if (htmlProperty != null) { 175 if (htmlProperty != null) {
173 return getter ? htmlProperty.getter : htmlProperty.setter; 176 return getter ? htmlProperty.getter : htmlProperty.setter;
174 } else { 177 } else {
175 return null; 178 return null;
176 } 179 }
177 } else { 180 } else {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 Map<String, String> _getTags(String comment) { 394 Map<String, String> _getTags(String comment) {
392 if (comment == null) return const <String>{}; 395 if (comment == null) return const <String>{};
393 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"); 396 final re = new RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)");
394 final tags = <String>{}; 397 final tags = <String>{};
395 for (var m in re.allMatches(comment.trim())) { 398 for (var m in re.allMatches(comment.trim())) {
396 tags[m[1]] = m[2]; 399 tags[m[1]] = m[2];
397 } 400 }
398 return tags; 401 return tags;
399 } 402 }
400 } 403 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698