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

Side by Side Diff: sdk/lib/_internal/dartdoc/lib/src/dartdoc/comment_map.dart

Issue 11358134: Fix for triple-slash dartdocs (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Indent multi-line string 2 more spaces. Created 8 years, 1 month 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 | sdk/lib/_internal/dartdoc/test/comment_map_test.dart » ('j') | 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 part of dartdoc; 5 part of dartdoc;
6 6
7 /** 7 /**
8 * The cached lookup-table to associate doc comments with spans. The outer map 8 * The cached lookup-table to associate doc comments with spans. The outer map
9 * is from filenames to doc comments in that file. The inner map maps from the 9 * is from filenames to doc comments in that file. The inner map maps from the
10 * token positions to doc comments. Each position is the starting offset of the 10 * token positions to doc comments. Each position is the starting offset of the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 if (text.startsWith('/**')) { 71 if (text.startsWith('/**')) {
72 // Remember that we've encountered a doc comment. 72 // Remember that we've encountered a doc comment.
73 lastComment = stripComment(token.slowToString()); 73 lastComment = stripComment(token.slowToString());
74 } else if (text.startsWith('///')) { 74 } else if (text.startsWith('///')) {
75 var line = text.substring(3); 75 var line = text.substring(3);
76 // Allow a leading space. 76 // Allow a leading space.
77 if (line.startsWith(' ')) line = line.substring(1); 77 if (line.startsWith(' ')) line = line.substring(1);
78 if (lastComment == null) { 78 if (lastComment == null) {
79 lastComment = line; 79 lastComment = line;
80 } else { 80 } else {
81 lastComment = '$lastComment$line'; 81 lastComment = '$lastComment\n$line';
82 } 82 }
83 } 83 }
84 } else if (token.kind == dart2js.HASH_TOKEN) { 84 } else if (token.kind == dart2js.HASH_TOKEN) {
85 // Look for `library` to find the library comment. 85 // Look for `library` to find the library comment.
86 final next = token.next; 86 final next = token.next;
87 if ((lastComment != null) && (next.stringValue == 'library')) { 87 if ((lastComment != null) && (next.stringValue == 'library')) {
88 _libraryComments[source.sourceUri.toString()] = lastComment; 88 _libraryComments[source.sourceUri.toString()] = lastComment;
89 lastComment = null; 89 lastComment = null;
90 } 90 }
91 } else if (lastComment != null) { 91 } else if (lastComment != null) {
(...skipping 28 matching lines...) Expand all
120 line = line.substring(1); 120 line = line.substring(1);
121 } 121 }
122 122
123 buf.add(line); 123 buf.add(line);
124 buf.add('\n'); 124 buf.add('\n');
125 } 125 }
126 126
127 return buf.toString(); 127 return buf.toString();
128 } 128 }
129 } 129 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/dartdoc/test/comment_map_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698