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

Unified Diff: sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart

Issue 11726005: Dartdoc comments retrieved as metadata through dart2js mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 11 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
Index: sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
index 34bccc2f88f7180ba0a4f063afc84fbee86a11bb..6f5189e973aebc204e5370729b5d73ae79f50216 100644
--- a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart
@@ -233,6 +233,32 @@ abstract class TypeInstanceMirror implements InstanceMirror {
}
/**
+ * Specialized [InstanceMirror] used for reflection on comments as metadata.
+ */
+abstract class CommentInstanceMirror implements InstanceMirror {
+ /**
+ * The comment text as written in the source text.
+ */
+ String get text;
+
+ /**
+ * The comment text without the start, end, and padding text.
+ *
+ * For example, if [text] is [: /** Comment text. */ :] then the [trimmedText]
+ * is [: Comment text. :].
+ */
+ String get trimmedText;
+
+ /**
+ * Is [:true:] if this comment is a documentation comment.
+ *
+ * That is, that the comment is either enclosed in [: /** ... */ :] or starts
+ * with [: /// :].
+ */
+ bool get isDocComment;
+}
+
+/**
* Common interface for classes and libraries.
*/
abstract class ContainerMirror implements Mirror {
@@ -710,12 +736,3 @@ abstract class SourceLocation {
*/
String get sourceText;
}
-
-/**
- * Class used for encoding dartdoc comments as metadata annotations.
- */
-class DartdocComment {
- final String text;
-
- const DartdocComment(this.text);
-}

Powered by Google App Engine
This is Rietveld 408576698