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

Side by Side Diff: lib/dartdoc/dartdoc.dart

Issue 10779010: Parameters with function types supported + Added features in mirrors implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments + mdn bug fixed. Created 8 years, 5 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
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 * To generate docs for a library, run this script with the path to an 6 * To generate docs for a library, run this script with the path to an
7 * entrypoint .dart file, like: 7 * entrypoint .dart file, like:
8 * 8 *
9 * $ dart dartdoc.dart foo.dart 9 * $ dart dartdoc.dart foo.dart
10 * 10 *
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 } 1256 }
1257 1257
1258 /** Writes a link to a human-friendly string representation for a type. */ 1258 /** Writes a link to a human-friendly string representation for a type. */
1259 linkToType(ObjectMirror enclosingType, TypeMirror type) { 1259 linkToType(ObjectMirror enclosingType, TypeMirror type) {
1260 if (type.isVoid) { 1260 if (type.isVoid) {
1261 // Do not generate links for void. 1261 // Do not generate links for void.
1262 // TODO(johnniwinter): Generate span for specific style? 1262 // TODO(johnniwinter): Generate span for specific style?
1263 write('void'); 1263 write('void');
1264 return; 1264 return;
1265 } 1265 }
1266 if (type.isDynamic) {
1267 // Do not generate links for Dynamic.
1268 write('Dynamic');
1269 return;
1270 }
1266 1271
1267 if (type.isTypeVariable) { 1272 if (type.isTypeVariable) {
1268 // If we're using a type parameter within the body of a generic class then 1273 // If we're using a type parameter within the body of a generic class then
1269 // just link back up to the class. 1274 // just link back up to the class.
1270 write(a(typeUrl(enclosingType), type.simpleName())); 1275 write(a(typeUrl(enclosingType), type.simpleName()));
1271 return; 1276 return;
1272 } 1277 }
1273 1278
1274 assert(type is InterfaceMirror); 1279 assert(type is InterfaceMirror);
1275 1280
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 } 1483 }
1479 1484
1480 /** 1485 /**
1481 * Returns [:true:] if [type] should be regarded as an exception. 1486 * Returns [:true:] if [type] should be regarded as an exception.
1482 */ 1487 */
1483 bool isException(TypeMirror type) { 1488 bool isException(TypeMirror type) {
1484 return type.simpleName().endsWith('Exception'); 1489 return type.simpleName().endsWith('Exception');
1485 } 1490 }
1486 } 1491 }
1487 1492
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698