Module rstast

This module implements an AST for the reStructuredText parser.

Types

TRstNodeKind = enum 
  rnInner, 
  rnHeadline, 
  rnOverline, 
  rnTransition, 
  rnParagraph, 
  rnBulletList, 
  rnBulletItem, 
  rnEnumList, 
  rnEnumItem, 
  rnDefList, 
  rnDefItem, 
  rnDefName, 
  rnDefBody, 
  rnFieldList, 
  rnField, 
  rnFieldName, 
  rnFieldBody, 
  rnOptionList, rnOptionListItem, rnOptionGroup, rnOption, rnOptionString, 
  rnOptionArgument, rnDescription, rnLiteralBlock, rnQuotedLiteralBlock, rnLineBlock, 
  rnLineBlockItem, 
  rnBlockQuote, 
  rnTable, rnGridTable, rnTableRow, rnTableHeaderCell, rnTableDataCell, rnLabel, 
  rnFootnote, 
  rnCitation, 
  rnStandaloneHyperlink, rnHyperlink, rnRef, rnDirective, 
  rnDirArg, rnRaw, rnTitle, rnContents, rnImage, rnFigure, rnCodeBlock, 
  rnRawHtml, rnRawLatex, rnContainer, 
  rnIndex, 
  rnSubstitutionDef, 
  rnGeneralRole, 
  rnSub, rnSup, rnIdx, rnEmphasis, 
  rnStrongEmphasis, 
  rnTripleEmphasis, 
  rnInterpretedText, 
  rnInlineLiteral, 
  rnSubstitutionReferences, 
  rnSmiley, 
  rnLeaf
the possible node kinds of an PRstNode See source
PRstNode = ref TRstNode
an RST node See source
TRstNodeSeq = seq[PRstNode]
See source
TRstNode = object 
  kind*: TRstNodeKind         ## the node's kind
  text*: string               ## valid for leafs in the AST; and the title of
                              ## the document or the section
  level*: int                 ## valid for some node kinds
  sons*: TRstNodeSeq          ## the node's sons
  
an RST node's description See source

Procs

proc len(n: PRstNode): int {.raises: [], tags: [], uses: [].}
See source
proc newRstNode(kind: TRstNodeKind): PRstNode {.raises: [], tags: [], uses: [].}
See source
proc newRstNode(kind: TRstNodeKind; s: string): PRstNode {.raises: [], tags: [], 
    uses: [].}
See source
proc lastSon(n: PRstNode): PRstNode {.raises: [], tags: [], uses: [].}
See source
proc add(father, son: PRstNode) {.raises: [], tags: [], uses: [].}
See source
proc addIfNotNil(father, son: PRstNode) {.raises: [], tags: [], uses: [].}
See source
proc renderRstToRst(n: PRstNode; result: var string) {.raises: [E_Base], 
    tags: [TEffect], uses: [].}
renders n into its string representation and appends to result. See source
proc renderRstToJson(node: PRstNode): string {.raises: [], tags: [], uses: [].}
See source
Generated: 2014-09-18 18:52:47 UTC