Struct rslnp::Parser[][src]

pub struct Parser { /* fields omitted */ }
Expand description

Represents the parser.

Implementations

impl Parser[src]

pub fn new() -> Self[src]

Creates a new parser with minimal enabled features.

pub fn scopes() -> Self[src]

Creates a new parser with all the features of SLN.

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]

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]

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]

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]

Returns the parser with string parsing disabled.

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]

Returns the parser with no support for brackets.

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]

Returns the parser with no support for comments.

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]

Returns the parser with no support for separators.

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]

Returns the parser with no support for symbol characters.

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.

Auto Trait Implementations

impl RefUnwindSafe for Parser

impl Send for Parser

impl Sync for Parser

impl Unpin for Parser

impl UnwindSafe for Parser

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.