Parser

Struct Parser 

Source
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.

Source

pub fn parse_grid_table( src_lines: &Vec<String>, line_cursor: &LineCursor, ) -> TableResult

Parses a grid table, returning a TableResult.

Source

pub fn parse_simple_table(table_string: Vec<String>) -> TableResult

Parses a simple table into a TableResult.

Source

pub fn isolate_simple_table(src_lines: &Vec<String>)

Retrieves the lines containing a simple table from the source line vector.

Source§

impl Parser

Source

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.

Source

pub fn parse(&mut self) -> ParsingResult

Starts the parsing process for a single file. Returns the DocTree generated by the StateMachines.

Auto Trait Implementations§

§

impl Freeze for Parser

§

impl RefUnwindSafe for Parser

§

impl Send for Parser

§

impl Sync for Parser

§

impl Unpin for Parser

§

impl UnwindSafe for Parser

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.