Struct outline::parser::bird::BirdParser
source · pub struct BirdParser {
pub code_marker: String,
pub code_name_marker: String,
pub comment_start: String,
pub interpolation_start: String,
pub interpolation_end: String,
pub macro_start: String,
pub macro_end: String,
}
Expand description
The config for parsing a Bird Style document
Fields
code_marker: String
The line starter to identify code lines
Default: >
code_name_marker: String
The line starter to identify the name of a code block
Default: >>>
comment_start: String
The sequence to identify a comment which should be omitted from the compiled code.
Default: //
interpolation_start: String
The sequence to identify the start of a meta variable interpolation.
Default: @{
interpolation_end: String
The sequence to identify the end of a meta variable interpolation.
Default: }
macro_start: String
The sequence to identify the start of a macro invocation.
Default: ==>
macro_end: String
The sequence to identify the end of a macro invocation.
Default: .
Trait Implementations
sourceimpl Debug for BirdParser
impl Debug for BirdParser
sourceimpl Default for BirdParser
impl Default for BirdParser
sourceimpl<'de> Deserialize<'de> for BirdParser
impl<'de> Deserialize<'de> for BirdParser
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Parser for BirdParser
impl Parser for BirdParser
sourcefn parse<'a>(&self, input: &'a str) -> Result<Document<'a>, Self::Error>
fn parse<'a>(&self, input: &'a str) -> Result<Document<'a>, Self::Error>
Parses the text part of the document. Should delegate the code section on a line-by-line
basis to the built in code parser. Read more
sourcefn parse_name<'a>(
&self,
input: &'a str
) -> Result<(String, Vec<&'a str>), ParseError>
fn parse_name<'a>(
&self,
input: &'a str
) -> Result<(String, Vec<&'a str>), ParseError>
Parses a macro name, returning the name and the extracted variables
sourcefn parse_line<'a>(
&self,
line_number: usize,
input: &'a str
) -> Result<Line<'a>, ParseError>
fn parse_line<'a>(
&self,
line_number: usize,
input: &'a str
) -> Result<Line<'a>, ParseError>
Parses a line as code, returning the parsed
Line
objectsourceimpl ParserConfig for BirdParser
impl ParserConfig for BirdParser
sourcefn comment_start(&self) -> &str
fn comment_start(&self) -> &str
The token to denote the start of a comment that should be rendered in the documentation.
This may be specified as the actual line comment symbol used by the source language to
exclude all comments from the transpiled file, or it can be a completely separate symbol
to allow for some comments to be left untouched even in the output files. Read more
sourcefn interpolation_start(&self) -> &str
fn interpolation_start(&self) -> &str
The token to denote the start of a meta-variable interpolation
sourcefn interpolation_end(&self) -> &str
fn interpolation_end(&self) -> &str
The token to denote the end of a meta-variable interpolation
sourcefn macro_start(&self) -> &str
fn macro_start(&self) -> &str
The token to denote the start of a macro invocation
sourceimpl Printer for BirdParser
impl Printer for BirdParser
sourcefn print_text_block<'a>(&self, block: &TextBlock<'a>) -> String
fn print_text_block<'a>(&self, block: &TextBlock<'a>) -> String
Prints a text block
sourcefn print_code_block<'a>(&self, block: &CodeBlock<'a>) -> String
fn print_code_block<'a>(&self, block: &CodeBlock<'a>) -> String
Prints a code block
sourcefn print_name(&self, name: String, vars: &[&str]) -> String
fn print_name(&self, name: String, vars: &[&str]) -> String
Fills a name with its placeholders
sourcefn print_line<'a>(&self, line: &Line<'a>, print_comments: bool) -> String
fn print_line<'a>(&self, line: &Line<'a>, print_comments: bool) -> String
Prints a line of a code block
Auto Trait Implementations
impl RefUnwindSafe for BirdParser
impl Send for BirdParser
impl Sync for BirdParser
impl Unpin for BirdParser
impl UnwindSafe for BirdParser
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more