class Luce::BlockParser
- Luce::BlockParser
- Reference
- Object
Overview
Maintains the internal state needed to parse a series of lines into blocks of Markdown suitable for further inline parsing.
Defined in:
luce/block_parser.crConstructors
Instance Method Summary
- #advance : Nil
-
#block_syntaxes : Array(Luce::BlockSyntax)
The enabled block syntaxes
-
#current : String
Return the current line
-
#document : Document
The Markdown document this parser is parsing
- #done? : Bool
-
#encountered_blank_line : Bool
Whether the parser has encountered a blank line between two block-level elements.
-
#encountered_blank_line=(encountered_blank_line : Bool)
Whether the parser has encountered a blank line between two block-level elements.
- #lines : Array(String)
-
#matches?(regex : Regex) : Bool
Return if the current line matches the given regex or not.
-
#matches_next?(regex : Regex) : Bool
Return if the next line matches the given regex or not.
-
#next : String | Nil
Return the line after the current one or
nil
if there is none. - #parse_lines : Array(Node)
-
#peek(lines_ahead : Int32) : String | Nil
Return the line that is lines_ahead lines ahead of the current one, or
nil
if there is none. -
#standard_block_syntaxes : Array(Luce::BlockSyntax)
The collection of built-in block parsers
Constructor Detail
Instance Method Detail
The enabled block syntaxes
To turn a series of lines into blocks, each of these will be tried in turn. Order matters here.
Whether the parser has encountered a blank line between two block-level elements.
Whether the parser has encountered a blank line between two block-level elements.