| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// **docgen** is a tool for creating machine readable representations of Dart | 5 /// **docgen** is a tool for creating machine readable representations of Dart |
| 6 /// code metadata, including: classes, members, comments and annotations. | 6 /// code metadata, including: classes, members, comments and annotations. |
| 7 /// | 7 /// |
| 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. | 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. |
| 9 /// | 9 /// |
| 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] | 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 536 |
| 537 var classScope = currentClass == null ? | 537 var classScope = currentClass == null ? |
| 538 null : lookupFunc(currentClass, name); | 538 null : lookupFunc(currentClass, name); |
| 539 if (classScope != null) return docName(classScope); | 539 if (classScope != null) return docName(classScope); |
| 540 | 540 |
| 541 var libraryScope = currentLibrary == null ? | 541 var libraryScope = currentLibrary == null ? |
| 542 null : lookupFunc(currentLibrary, name); | 542 null : lookupFunc(currentLibrary, name); |
| 543 if (libraryScope != null) return docName(libraryScope); | 543 if (libraryScope != null) return docName(libraryScope); |
| 544 | 544 |
| 545 // Look in the dart core library scope. | 545 // Look in the dart core library scope. |
| 546 var coreScope = lookupFunc(_coreLibrary, name); | 546 var coreScope = _coreLibrary == null? null : lookupFunc(_coreLibrary, name); |
| 547 if (coreScope != null) return docName(_coreLibrary); | 547 if (coreScope != null) return docName(_coreLibrary); |
| 548 | 548 |
| 549 // If it's a reference that starts with a another library name, then it | 549 // If it's a reference that starts with a another library name, then it |
| 550 // looks for a match of that library name in the other sdk libraries. | 550 // looks for a match of that library name in the other sdk libraries. |
| 551 if(name.contains('.')) { | 551 if(name.contains('.')) { |
| 552 var index = name.indexOf('.'); | 552 var index = name.indexOf('.'); |
| 553 var libraryName = name.substring(0, index); | 553 var libraryName = name.substring(0, index); |
| 554 var remainingName = name.substring(index + 1); | 554 var remainingName = name.substring(index + 1); |
| 555 foundLibraryName(library) => library.uri.pathSegments[0] == libraryName; | 555 foundLibraryName(library) => library.uri.pathSegments[0] == libraryName; |
| 556 | 556 |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 /// Remove statics from the map of inherited items before adding them. | 1367 /// Remove statics from the map of inherited items before adding them. |
| 1368 Map _filterStatics(Map items) { | 1368 Map _filterStatics(Map items) { |
| 1369 var result = {}; | 1369 var result = {}; |
| 1370 items.forEach((name, item) { | 1370 items.forEach((name, item) { |
| 1371 if (!item.isStatic) { | 1371 if (!item.isStatic) { |
| 1372 result[name] = item; | 1372 result[name] = item; |
| 1373 } | 1373 } |
| 1374 }); | 1374 }); |
| 1375 return result; | 1375 return result; |
| 1376 } | 1376 } |
| OLD | NEW |