
FandocParser translate fandoc text into an in-memory representation of the document.
See docLib::Fandoc for usage.
Slots
-
private DocElem blockquote()
-
private Void consume()
Consume the current line and advance to the next line
-
private Str cur
-
private Int curIndent
-
private Int curStart
-
private LineType curt
-
private Str filename
-
private DocElem heading()
-
static private Bool isOrderedListMark(Str line, Int i)
Return if line starting at index i is an ordered list item:
number* "." sp (digits) letter "." sp (a-z | A-Z single letter only) roman* "." sp (ivx | IVX combos)
-
private Int lineIndex
-
private Str[] lines
-
private DocElem listItems(DocElem list, LineType listType, Int listIndent)
- main
-
static Void main()
-
private Int numLines
-
private DocElem ol()
-
private DocElem para()
- parse
-
Doc parse(Str filename, InStream in, Bool close := true)
Parse the document from the specified in stream into an in-memory tree structure. If close is true, the stream is guaranteed to be closed.
- parseStr
-
Parse a string into its in-memory document tree structure.
-
private Str peek
-
private Int peekIndent
-
private Int peekStart
-
private LineType peekt
-
private DocElem pre()
-
private DocElem preExplicit()
-
private Void readLines(InStream in, Bool close)
Read all the lines into memory and close stream if required.
-
private Void skipBlankLines()
Skip any blank lines
-
private DocElem topBlock()
-
private DocElem ul()