Enum subscript_compiler::backend::ast::Ast[][src]

pub enum Ast<'a> {
    Tag(Tag<'a>),
    Enclosure(Enclosure<'a, Ast<'a>>),
    Ident(Atom<'a>),
    Content(Atom<'a>),
    Token(Atom<'a>),
}

Variants

Tag(Tag<'a>)
Enclosure(Enclosure<'a, Ast<'a>>)

Some other enclosure, perhaps as a result of an error, such as in the case of curly braces or square parentheses thar Isn’t affiliated with a block node. Parentheses are fine though, since it’s used in math mode.

Ident(Atom<'a>)

Some identifier not followed by a block.

Content(Atom<'a>)
Token(Atom<'a>)

Implementations

impl<'a> Ast<'a>[src]

pub fn new_fragment(nodes: Vec<Self>) -> Self[src]

pub fn into_fragment(self) -> Vec<Self>[src]

Unpacks an Ast::Enclosure with the Fragment kind or returns a singleton vec.

pub fn transform<F: Fn(Ast<'a>) -> Ast<'a>>(self, f: Rc<F>) -> Self[src]

Bottom up transformation.

pub fn is_named_block(&self, name: &str) -> bool[src]

pub fn is_tag(&self) -> bool[src]

pub fn is_ident(&self) -> bool[src]

pub fn is_enclosure(&self) -> bool[src]

pub fn is_content(&self) -> bool[src]

pub fn is_token(&self) -> bool[src]

pub fn unpack_tag(&self) -> Option<&Tag<'a>>[src]

pub fn unpack_tag_mut(&mut self) -> Option<&mut Tag<'a>>[src]

pub fn unpack_ident(&self) -> Option<&Atom<'a>>[src]

pub fn unpack_enclosure(&self) -> Option<&Enclosure<'a, Ast<'a>>>[src]

pub fn unpack_content(&self) -> Option<&Atom<'a>>[src]

pub fn unpack_content_mut(&mut self) -> Option<&mut Atom<'a>>[src]

pub fn unpack_token(&self) -> Option<&Atom<'a>>[src]

pub fn into_tag(self) -> Option<Tag<'a>>[src]

pub fn into_enclosure(self) -> Option<Enclosure<'a, Ast<'a>>>[src]

pub fn into_enclosure_children(
    self,
    kind: EnclosureKind<'_>
) -> Option<Vec<Ast<'a>>>
[src]

pub fn into_ident(self) -> Option<Atom<'a>>[src]

pub fn into_parens(self) -> Option<Enclosure<'a, Ast<'a>>>[src]

pub fn into_content(self) -> Option<Atom<'a>>[src]

pub fn into_token(self) -> Option<Atom<'a>>[src]

pub fn unsafe_unwrap_ident(&self) -> &Atom<'a>[src]

pub fn is_whitespace(&self) -> bool[src]

pub fn to_string(self) -> String[src]

pub fn unblock(self) -> Vec<Self>[src]

impl<'a> Ast<'a>[src]

pub fn child_list_transformer<F, G, H>(
    self,
    f: Rc<ChildListTransformer<'a, F, G, H>>
) -> Self where
    F: Fn(Vec<Ast<'a>>) -> Vec<Ast<'a>>,
    G: Fn(Vec<Ast<'a>>) -> Vec<Ast<'a>>,
    H: Fn(Vec<RewriteRule<Ast<'a>>>) -> Vec<RewriteRule<Ast<'a>>>, 
[src]

Trait Implementations

impl<'a> Clone for Ast<'a>[src]

fn clone(&self) -> Ast<'a>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for Ast<'a>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'a> PartialEq<Ast<'a>> for Ast<'a>[src]

fn eq(&self, other: &Ast<'a>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Ast<'a>) -> bool[src]

This method tests for !=.

impl<'a> StructuralPartialEq for Ast<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Ast<'a>

impl<'a> Send for Ast<'a>

impl<'a> Sync for Ast<'a>

impl<'a> Unpin for Ast<'a>

impl<'a> UnwindSafe for Ast<'a>

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.