pub(crate) struct Processor<'a> {
pub(crate) rules: HashMap<String, Rule>,
pub(crate) grammar: &'a str,
pub(crate) scope: Scope,
pub(crate) line: u32,
pub(crate) out: String,
}
Expand description
Transforms abnf file into Markdown.
Fields§
§rules: HashMap<String, Rule>
§grammar: &'a str
§scope: Scope
§line: u32
§out: String
Implementations§
Source§impl<'a> Processor<'a>
impl<'a> Processor<'a>
pub(crate) fn new(grammar: &'a str, abnf: Vec<Rule>) -> Processor<'a>
Sourcepub(crate) fn process(&mut self)
pub(crate) fn process(&mut self)
Main function for this struct. Goes through each line and transforms it into proper markdown.
Sourcepub(crate) fn append_str(&mut self, line: &str)
pub(crate) fn append_str(&mut self, line: &str)
Append new line into output, add newline character.
Sourcepub(crate) fn enter_scope(&mut self, new_scope: Scope)
pub(crate) fn enter_scope(&mut self, new_scope: Scope)
Enter new scope (definition or code block). Allows customizing pre and post lines for each scope entered or exited.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Processor<'a>
impl<'a> RefUnwindSafe for Processor<'a>
impl<'a> Send for Processor<'a>
impl<'a> Sync for Processor<'a>
impl<'a> Unpin for Processor<'a>
impl<'a> UnwindSafe for Processor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more