Struct rslnp::Parser [−][src]
pub struct Parser { /* fields omitted */ }
Expand description
Represents the parser.
Implementations
impl Parser
[src]
impl Parser
[src]pub fn indent(self, indent: u8) -> Self
[src]
pub fn indent(self, indent: u8) -> Self
[src]Returns the parser with the indent changed. If indent is zero, indentation based nesting is disabled.
pub fn unpack_single(self, unpack_single: bool) -> Self
[src]
pub fn unpack_single(self, unpack_single: bool) -> Self
[src]Returns the parser with unpacking of single elements in lines enabled or disabled. If enabled, a line, which contains only a single element, is not interpreted as list.
pub fn allow_multi_indent(self, allow_multi_indent: bool) -> Self
[src]
pub fn allow_multi_indent(self, allow_multi_indent: bool) -> Self
[src]Returns the parser with more multi indent enabled or disabled. If enabled, more than one additional indentation per line is allowed.
pub fn with_strings(self, delimiter: char, prefix: Option<String>) -> Self
[src]
pub fn with_strings(self, delimiter: char, prefix: Option<String>) -> Self
[src]Returns the parser with a new string delimiter added. The string might be parsed as list prefixed by a symbol.
pub fn without_strings(self) -> Self
[src]
pub fn without_strings(self) -> Self
[src]Returns the parser with string parsing disabled.
pub fn with_brackets(
self,
left: char,
right: char,
prefix: Option<String>
) -> Self
[src]
pub fn with_brackets(
self,
left: char,
right: char,
prefix: Option<String>
) -> Self
[src]Returns the parser with a new allowed bracket pair. Lists created by specific bracket pairs might be prefixed by a symbol.
pub fn without_brackets(self) -> Self
[src]
pub fn without_brackets(self) -> Self
[src]Returns the parser with no support for brackets.
pub fn with_comments(self, comments: char) -> Self
[src]
pub fn with_comments(self, comments: char) -> Self
[src]Returns the parser with a new character for indicating comments added. A comment might apply to multiple lines.
pub fn without_comments(self) -> Self
[src]
pub fn without_comments(self) -> Self
[src]Returns the parser with no support for comments.
pub fn with_separator(self, separator: char) -> Self
[src]
pub fn with_separator(self, separator: char) -> Self
[src]Returns the parser with a new character as separator added. A separator makes it possible to write multiple lists per line without the need of brackets.
pub fn without_separator(self) -> Self
[src]
pub fn without_separator(self) -> Self
[src]Returns the parser with no support for separators.
pub fn with_symbol_character(self, separator: char) -> Self
[src]
pub fn with_symbol_character(self, separator: char) -> Self
[src]Returns the parser with a new character as symbol character added. Symbol characters will always be parsed as single characters, even if there is no whitespace before or after them.
pub fn without_symbol_character(self) -> Self
[src]
pub fn without_symbol_character(self) -> Self
[src]Returns the parser with no support for symbol characters.
pub fn parse(
&self,
chars: impl IntoIterator<Item = char>
) -> Result<TokenParser>
[src]
pub fn parse(
&self,
chars: impl IntoIterator<Item = char>
) -> Result<TokenParser>
[src]Parses the text into a token parser, which can be used to parse all kinds of data structures.