[Markup] Add Tag field

You can now specify multiple - Tag: simple fields in documentation
comments for general purpose use. These are not currently intended
to show up in rendered documentation but are for metadata purposes
only.
This commit is contained in:
David Farler
2017-02-16 16:36:56 -08:00
parent 3b48b4b697
commit 2dd61ad0eb
5 changed files with 21 additions and 3 deletions

View File

@@ -39,6 +39,10 @@ public:
return Parts;
}
ArrayRef<StringRef> getTags() const {
return Parts.Tags;
}
Optional<const swift::markup::Paragraph *> getBrief() const {
return Parts.Brief;
}

View File

@@ -26,6 +26,7 @@ class MarkupASTNode;
class Paragraph;
class ParamField;
class ReturnsField;
class TagField;
class ThrowsField;
/// The basic structure of a doc comment attached to a Swift
@@ -36,6 +37,7 @@ struct CommentParts {
ArrayRef<ParamField *> ParamFields;
Optional<const ReturnsField *> ReturnsField;
Optional<const ThrowsField *> ThrowsField;
ArrayRef<StringRef> Tags;
bool isEmpty() const {
return !Brief.hasValue() &&

View File

@@ -72,6 +72,7 @@ MARKUP_AST_NODE(PrivateExtension, MarkupASTNode)
MARKUP_AST_NODE(RequiresField, PrivateExtension)
MARKUP_AST_NODE(SeeField, PrivateExtension)
MARKUP_AST_NODE(SinceField, PrivateExtension)
MARKUP_AST_NODE(TagField, PrivateExtension)
MARKUP_AST_NODE(TODOField, PrivateExtension)
MARKUP_AST_NODE(ThrowsField, PrivateExtension)
MARKUP_AST_NODE(VersionField, PrivateExtension)

View File

@@ -43,6 +43,7 @@ MARKUP_SIMPLE_FIELD(ThrowsField, throws, Throws)
MARKUP_SIMPLE_FIELD(RequiresField, requires, Requires)
MARKUP_SIMPLE_FIELD(SeeField, seealso, See)
MARKUP_SIMPLE_FIELD(SinceField, since, Since)
MARKUP_SIMPLE_FIELD(TagField, tag, Tag)
MARKUP_SIMPLE_FIELD(TODOField, todo, TODO)
MARKUP_SIMPLE_FIELD(VersionField, version, Version)
MARKUP_SIMPLE_FIELD(WarningField, warning, Warning)