Enum subscript_compiler::frontend::ast::Node[][src]

pub enum Node<'a> {
    Tag(Tag<'a>),
    Ident(Ann<Atom<'a>>),
    Enclosure(Ann<Enclosure<'a, Node<'a>>>),
    String(Ann<Atom<'a>>),
    InvalidToken(Ann<Atom<'a>>),
}

Variants

Tag(Tag<'a>)

The parser doesn’t emit AST Tag nodes. This is done in a later processing phase.

Ident(Ann<Atom<'a>>)

Some identifier that may or may not be followed by square parentheses and/or a curly brace enclosure. E.g. \name.

Enclosure(Ann<Enclosure<'a, Node<'a>>>)

An enclosure can be a multitude of things:

  • Some syntactic enclosure:
    • Curly braces
    • Parentheses
    • Square parentheses
  • Some error with it’s invalid start & end token (i.e. a opening [ and closing })
  • Additionally, after parsing, an enclosure can also be a fragment (i.e. a list of AST nodes)
String(Ann<Atom<'a>>)

Some string of arbitrary characters or a single special token.

InvalidToken(Ann<Atom<'a>>)

Some unbalanced token that isn’t associated with an enclosure. In Subscript, enclosure symbols must be balanced. If the author must use such in their publications, then use the tag version.

Implementations

Some tag with no parameters and just children.

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

Bottom up ‘node to ndoe’ transformation.

Bottom up transformation of AST child nodes within the same enclosure.

For syntax highlighting VIA the compiler frontend.

Push to a fragment or tag node. TODO: Should we also push to any EnclosureKind?

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.