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

Unified Diff: lib/dartdoc/comment_map.dart

Issue 10823257: Refactored accessors in mirrors from methods to properties. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/dartdoc/dartdoc.dart » ('j') | lib/dartdoc/mirrors/dart2js_mirror.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dartdoc/comment_map.dart
diff --git a/lib/dartdoc/comment_map.dart b/lib/dartdoc/comment_map.dart
index 5bd10d7e861f73d5621409d71aa04efade0ad695..c291fa978bed32c6c975faded0d7d02917b8fed0 100644
--- a/lib/dartdoc/comment_map.dart
+++ b/lib/dartdoc/comment_map.dart
@@ -27,8 +27,8 @@ class CommentMap {
String find(Location span) {
if (span == null) return null;
- _ensureFileParsed(span.source());
- final comment = _comments[span.source().uri().toString()][span.start()];
+ _ensureFileParsed(span.source);
+ final comment = _comments[span.source.uri.toString()][span.start];
if (comment == null) return '';
return comment;
}
@@ -39,20 +39,20 @@ class CommentMap {
*/
String findLibrary(Source source) {
_ensureFileParsed(source);
- final comment = _libraryComments[source.uri().toString()];
+ final comment = _libraryComments[source.uri.toString()];
if (comment == null) return '';
return comment;
}
_ensureFileParsed(Source source) {
- _comments.putIfAbsent(source.uri().toString(), () =>
+ _comments.putIfAbsent(source.uri.toString(), () =>
_parseComments(source));
}
_parseComments(Source source) {
final comments = new Map<int, String>();
- final scanner = new dart2js.StringScanner(source.text(), true);
+ final scanner = new dart2js.StringScanner(source.text, true);
var lastComment = null;
var token = scanner.tokenize();
@@ -76,7 +76,7 @@ class CommentMap {
// Look for #library() to find the library comment.
final next = token.next;
if ((lastComment != null) && (next.stringValue == 'library')) {
- _libraryComments[source.uri().toString()] = lastComment;
+ _libraryComments[source.uri.toString()] = lastComment;
lastComment = null;
}
} else if (lastComment != null) {
« no previous file with comments | « no previous file | lib/dartdoc/dartdoc.dart » ('j') | lib/dartdoc/mirrors/dart2js_mirror.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698