mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This change adds infrastructure to represent inline markup in the AST, implements parsing of some of the inline markup (*emphasis*, **strong emphasis**, `interpreted text`, ``inline literal``), and XML generation for these constructs for SourceKit clients to consume. The parsing itself is incomplete for constructs not mentioned above. Most notably, we don't parse hyperlinks, and we don't parse the double-colon that changes the next paragraph into a literal block. Swift SVN r22752
58 lines
2.1 KiB
C++
58 lines
2.1 KiB
C++
//===-- ASTNodes.def - ReST AST Metaprogramming -----------------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See http://swift.org/LICENSE.txt for license information
|
|
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines macros used for macro-metaprogramming with ReST AST
|
|
// nodes.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
/// REST_AST_NODE(Id, Parent)
|
|
///
|
|
/// ABSTRACT_REST_AST_NODE(Id, Parent)
|
|
///
|
|
/// REST_AST_NODE_RANGE(Id, FirstId, LastId)
|
|
|
|
REST_AST_NODE(Document, ReSTASTNode)
|
|
REST_AST_NODE(Section, ReSTASTNode)
|
|
REST_AST_NODE(Topic, ReSTASTNode)
|
|
REST_AST_NODE(Sidebar, ReSTASTNode)
|
|
REST_AST_NODE(Title, ReSTASTNode)
|
|
REST_AST_NODE(Subtitle, ReSTASTNode)
|
|
REST_AST_NODE(Transition, ReSTASTNode)
|
|
REST_AST_NODE(Paragraph, ReSTASTNode)
|
|
REST_AST_NODE(BulletList, ReSTASTNode)
|
|
REST_AST_NODE(EnumeratedList, ReSTASTNode)
|
|
REST_AST_NODE(DefinitionListItem, ReSTASTNode)
|
|
REST_AST_NODE(DefinitionList, ReSTASTNode)
|
|
REST_AST_NODE(Field, ReSTASTNode)
|
|
REST_AST_NODE(FieldList, ReSTASTNode)
|
|
REST_AST_NODE(BlockQuote, ReSTASTNode)
|
|
REST_AST_NODE(TextAndInline, ReSTASTNode)
|
|
ABSTRACT_REST_AST_NODE(InlineContent, ReSTASTNode)
|
|
REST_AST_NODE(PlainText, InlineContent)
|
|
REST_AST_NODE(Emphasis, InlineContent)
|
|
REST_AST_NODE(StrongEmphasis, InlineContent)
|
|
REST_AST_NODE(InterpretedText, InlineContent)
|
|
REST_AST_NODE(InlineLiteral, InlineContent)
|
|
REST_AST_NODE(HyperlinkReference, InlineContent)
|
|
REST_AST_NODE(InlineHyperlinkTarget, InlineContent)
|
|
REST_AST_NODE(FootnoteReference, InlineContent)
|
|
REST_AST_NODE(CitationReference, InlineContent)
|
|
REST_AST_NODE(SubstitutionReference, InlineContent)
|
|
REST_AST_NODE_RANGE(InlineContent, PlainText, SubstitutionReference)
|
|
REST_AST_NODE(PrivateExtension, ReSTASTNode)
|
|
|
|
#undef REST_AST_NODE
|
|
#undef ABSTRACT_REST_AST_NODE
|
|
#undef REST_AST_NODE_RANGE
|
|
|