[][src]Struct ssexp::MacroMap

pub struct MacroMap<T>(_);

A map for storing the macro characters and their behaviours. Every character may be set as macro character.

Implementations

impl<T: Iterator<Item = char>> MacroMap<T>[src]

pub fn new() -> Self[src]

Creates a new MacroMap, which is used to save macro characters

pub fn set(
    &mut self,
    char: char,
    value: Option<impl Parser<T> + 'static>
) -> Option<Rc<dyn Parser<T>>>
[src]

Adds a new user defined macro character char. Takes an Option of the new parser.

pub fn with(self, char: char, value: impl Parser<T> + 'static) -> Self[src]

Adds char as a macro character with the user defined parser value

pub fn with_separating_whitespaces(self) -> Self[src]

Adds whitespaces as macro characters for splitting there into tokens.

pub fn with_lists(self, start_char: char, end_char: char) -> Self[src]

Makes start_char the left delimiter and end_char the right delimiter of a list.

pub fn with_macro_characters_ignored(self, delimiter: char) -> Self[src]

Ignores macro characters in some region and parses a symbol

pub fn with_strings(
    self,
    prefix: String,
    delimiter: char,
    replacements: Vec<(String, String)>
) -> Self
[src]

Adds the ability for parsing strings, using char string_delimiter for delimiting strings. A string will be parsed as list, whose first element is a symbol prefix and whose second element is the string itself as symbol.

pub fn with_comments(self, comment_char: char) -> Self[src]

Adds comment_char as macro character for single line comments.

pub fn with_infix(self, infix_char: char, kind: InfixKind, right: bool) -> Self[src]

Adds infix_char as infix operator.

pub fn from_hash_map(map: HashMap<char, Rc<dyn Parser<T>>>) -> Self[src]

Creates a MacroMap from a HashMap

pub fn insert(
    &mut self,
    char: char,
    value: Option<Rc<dyn Parser<T>>>
) -> Option<Rc<dyn Parser<T>>>
[src]

Adds a new user defined macro character char. Takes an Option of the new parser already converted to the inner type.

Auto Trait Implementations

impl<T> !RefUnwindSafe for MacroMap<T>

impl<T> !Send for MacroMap<T>

impl<T> !Sync for MacroMap<T>

impl<T> Unpin for MacroMap<T>

impl<T> !UnwindSafe for MacroMap<T>

Blanket Implementations

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

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

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

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

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

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.

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.