pub struct Parser { /* private fields */ }Expand description
The parser type. Contains an optional
source line vector and a document tree.
These are optional to facilitate their passing
to any transitions functions via
std::option::Option::take
without invalidating the fields.
Implementations§
Source§impl Parser
Implementation of the table parsing functions for the Parser type.
impl Parser
Implementation of the table parsing functions for the Parser type.
Sourcepub fn parse_grid_table(
src_lines: &Vec<String>,
line_cursor: &LineCursor,
) -> TableResult
pub fn parse_grid_table( src_lines: &Vec<String>, line_cursor: &LineCursor, ) -> TableResult
Parses a grid table, returning a TableResult.
Sourcepub fn parse_simple_table(table_string: Vec<String>) -> TableResult
pub fn parse_simple_table(table_string: Vec<String>) -> TableResult
Parses a simple table into a TableResult.
Sourcepub fn isolate_simple_table(src_lines: &Vec<String>)
pub fn isolate_simple_table(src_lines: &Vec<String>)
Retrieves the lines containing a simple table from the source line vector.
Source§impl Parser
impl Parser
Sourcepub fn new(
src: Vec<String>,
doctree: DocTree,
base_indent: usize,
base_line: Line,
initial_state: State,
section_level: usize,
) -> Self
pub fn new( src: Vec<String>, doctree: DocTree, base_indent: usize, base_line: Line, initial_state: State, section_level: usize, ) -> Self
The Parser constructor. Transforms a given source string
into a vector of lines and wraps this and a given DocTree
in Options. This wrapping allows the passing of these to owned
state machnes via swapping the optional contents
to None before granting ownership of the original contents.
Sourcepub fn parse(&mut self) -> ParsingResult
pub fn parse(&mut self) -> ParsingResult
Starts the parsing process for a single file.
Returns the DocTree generated by the StateMachines.