Skip to main content

ParseNode

Enum ParseNode 

Source
pub enum ParseNode {
Show 57 variants Internal { mode: Mode, }, Raw { mode: Mode, string: String, }, ColorToken { mode: Mode, color: String, }, Size { mode: Mode, value: Measurement, is_blank: bool, }, Url { mode: Mode, url: String, }, Styling { mode: Mode, body: Vec<ParseNode>, style: StyleLevel, reset_font: bool, }, Sqrt { mode: Mode, body: Box<ParseNode>, index: Option<Box<ParseNode>>, }, Infix { mode: Mode, replace_with: String, size: Option<Measurement>, loc: Option<SourceLocation>, }, GenFrac { mode: Mode, numer: Box<ParseNode>, denom: Box<ParseNode>, continued: bool, has_bar_line: bool, bar_size: Option<Measurement>, left_delim: Option<String>, right_delim: Option<String>, }, Text { mode: Mode, body: Vec<ParseNode>, font: String, }, Font { mode: Mode, font: String, body: Box<ParseNode>, }, MClass { mode: Mode, mclass: AtomFamily, body: Vec<ParseNode>, is_character_box: bool, }, Op { mode: Mode, limits: bool, always_handle_sup_sub: bool, parent_is_sup_sub: bool, suppress_base_shift: bool, content: OperatorContent, }, OperatorName { mode: Mode, body: Vec<ParseNode>, always_handle_sup_sub: bool, limits: bool, parent_is_sup_sub: bool, }, Overline { mode: Mode, body: Box<ParseNode>, }, Underline { mode: Mode, body: Box<ParseNode>, }, Smash { mode: Mode, body: Box<ParseNode>, smash_height: bool, smash_depth: bool, }, Phantom { mode: Mode, body: Vec<ParseNode>, }, VPhantom { mode: Mode, body: Box<ParseNode>, }, Pmb { mode: Mode, mclass: AtomFamily, body: Vec<ParseNode>, }, VCenter { mode: Mode, body: Box<ParseNode>, }, Rule { mode: Mode, shift: Option<Measurement>, width: Measurement, height: Measurement, }, RaiseBox { mode: Mode, dy: Measurement, body: Box<ParseNode>, }, HBox { mode: Mode, body: Vec<ParseNode>, }, Lap { mode: Mode, alignment: LapAlignment, body: Box<ParseNode>, }, MathChoice { mode: Mode, display: Vec<ParseNode>, text: Vec<ParseNode>, script: Vec<ParseNode>, scriptscript: Vec<ParseNode>, }, Sizing { mode: Mode, size: usize, body: Vec<ParseNode>, }, HorizBrace { mode: Mode, label: String, is_over: bool, base: Box<ParseNode>, }, XArrow { mode: Mode, label: String, body: Box<ParseNode>, below: Option<Box<ParseNode>>, }, AccentUnder { mode: Mode, label: String, base: Box<ParseNode>, }, DelimSizing { mode: Mode, size: usize, mclass: AtomFamily, delim: String, }, LeftRightRight { mode: Mode, delim: String, color: Option<String>, }, LeftRight { mode: Mode, body: Vec<ParseNode>, left: String, right: String, right_color: Option<String>, }, Middle { mode: Mode, delim: String, }, Kern { mode: Mode, dimension: Measurement, }, Enclose { mode: Mode, body: Box<ParseNode>, label: String, background_color: Option<String>, border_color: Option<String>, }, Href { mode: Mode, href: String, body: Vec<ParseNode>, }, Html { mode: Mode, attributes: HashMap<String, String>, body: Vec<ParseNode>, }, IncludeGraphics { mode: Mode, alt: String, width: Measurement, height: Measurement, totalheight: Measurement, src: String, }, Tag { mode: Mode, body: Vec<ParseNode>, tag: Vec<ParseNode>, }, Array { mode: Mode, body: Vec<Vec<ParseNode>>, add_jot: bool, array_stretch: f64, columns: Option<Vec<ArrayColumn>>, row_gaps: Vec<Option<Measurement>>, hskip_before_and_after: bool, hlines_before_row: Vec<Vec<bool>>, column_separation_type: Option<ColumnSeparationType>, tags: Option<Vec<Option<Vec<ParseNode>>>>, auto_tags: Option<Vec<bool>>, leqno: bool, }, EnvironmentEnd { mode: Mode, name: String, }, CdLabel { mode: Mode, side: String, label: Box<ParseNode>, }, CdParent { mode: Mode, fragment: Box<ParseNode>, }, Cr { mode: Mode, new_line: bool, size: Option<Measurement>, }, HtmlMathML { mode: Mode, html: Vec<ParseNode>, mathml: Vec<ParseNode>, }, OrdGroup { mode: Mode, loc: Option<SourceLocation>, body: Vec<ParseNode>, semisimple: bool, }, SupSub { mode: Mode, base: Option<Box<ParseNode>>, sup: Option<Box<ParseNode>>, sub: Option<Box<ParseNode>>, }, TextOrd { mode: Mode, loc: Option<SourceLocation>, text: String, }, MathOrd { mode: Mode, loc: Option<SourceLocation>, text: String, }, Spacing { mode: Mode, loc: Option<SourceLocation>, text: String, }, AccentToken { mode: Mode, loc: Option<SourceLocation>, text: String, }, OperatorToken { mode: Mode, loc: Option<SourceLocation>, text: String, }, Accent { mode: Mode, loc: Option<SourceLocation>, label: String, is_stretchy: bool, is_shifty: bool, base: Box<ParseNode>, }, Verb { mode: Mode, loc: Option<SourceLocation>, body: String, star: bool, }, Atom { mode: Mode, loc: Option<SourceLocation>, family: AtomFamily, text: String, }, Color { mode: Mode, color: String, body: Vec<ParseNode>, },
}
Expand description

A parsed node in the LaTeX AST.

Variants§

§

Internal

Fields

§mode: Mode
§

Raw

Fields

§mode: Mode
§string: String
§

ColorToken

Fields

§mode: Mode
§color: String
§

Size

Fields

§mode: Mode
§is_blank: bool
§

Url

Fields

§mode: Mode
§

Styling

Fields

§mode: Mode
§reset_font: bool
§

Sqrt

Fields

§mode: Mode
§

Infix

Fields

§mode: Mode
§replace_with: String
§

GenFrac

Fields

§mode: Mode
§continued: bool
§has_bar_line: bool
§left_delim: Option<String>
§right_delim: Option<String>
§

Text

Fields

§mode: Mode
§font: String
§

Font

Fields

§mode: Mode
§font: String
§

MClass

Fields

§mode: Mode
§mclass: AtomFamily
§is_character_box: bool
§

Op

Fields

§mode: Mode
§limits: bool
§always_handle_sup_sub: bool
§parent_is_sup_sub: bool
§suppress_base_shift: bool
§

OperatorName

Fields

§mode: Mode
§always_handle_sup_sub: bool
§limits: bool
§parent_is_sup_sub: bool
§

Overline

Fields

§mode: Mode
§

Underline

Fields

§mode: Mode
§

Smash

Fields

§mode: Mode
§smash_height: bool
§smash_depth: bool
§

Phantom

Fields

§mode: Mode
§

VPhantom

Fields

§mode: Mode
§

Pmb

Fields

§mode: Mode
§mclass: AtomFamily
§

VCenter

Fields

§mode: Mode
§

Rule

Fields

§mode: Mode
§

RaiseBox

Fields

§mode: Mode
§

HBox

Fields

§mode: Mode
§

Lap

Fields

§mode: Mode
§alignment: LapAlignment
§

MathChoice

Fields

§mode: Mode
§display: Vec<ParseNode>
§script: Vec<ParseNode>
§scriptscript: Vec<ParseNode>
§

Sizing

Fields

§mode: Mode
§size: usize
§

HorizBrace

Fields

§mode: Mode
§label: String
§is_over: bool
§

XArrow

Fields

§mode: Mode
§label: String
§

AccentUnder

Fields

§mode: Mode
§label: String
§

DelimSizing

Fields

§mode: Mode
§size: usize
§mclass: AtomFamily
§delim: String
§

LeftRightRight

Fields

§mode: Mode
§delim: String
§

LeftRight

Fields

§mode: Mode
§left: String
§right: String
§right_color: Option<String>
§

Middle

Fields

§mode: Mode
§delim: String
§

Kern

Fields

§mode: Mode
§dimension: Measurement
§

Enclose

Fields

§mode: Mode
§label: String
§background_color: Option<String>
§border_color: Option<String>
§

Href

Fields

§mode: Mode
§href: String
§

Html

Fields

§mode: Mode
§attributes: HashMap<String, String>
§

IncludeGraphics

Fields

§mode: Mode
§totalheight: Measurement
§

Tag

Fields

§mode: Mode
§

Array

Fields

§mode: Mode
§add_jot: bool
§array_stretch: f64
§hskip_before_and_after: bool
§hlines_before_row: Vec<Vec<bool>>
§column_separation_type: Option<ColumnSeparationType>
§auto_tags: Option<Vec<bool>>
§leqno: bool
§

EnvironmentEnd

Fields

§mode: Mode
§name: String
§

CdLabel

Fields

§mode: Mode
§side: String
§

CdParent

Fields

§mode: Mode
§fragment: Box<ParseNode>
§

Cr

Fields

§mode: Mode
§new_line: bool
§

HtmlMathML

Fields

§mode: Mode
§mathml: Vec<ParseNode>
§

OrdGroup

Fields

§mode: Mode
§semisimple: bool
§

SupSub

§

TextOrd

Fields

§mode: Mode
§text: String
§

MathOrd

Fields

§mode: Mode
§text: String
§

Spacing

Fields

§mode: Mode
§text: String
§

AccentToken

Fields

§mode: Mode
§text: String
§

OperatorToken

Fields

§mode: Mode
§text: String
§

Accent

Fields

§mode: Mode
§label: String
§is_stretchy: bool
§is_shifty: bool
§

Verb

Fields

§mode: Mode
§body: String
§star: bool
§

Atom

Fields

§mode: Mode
§family: AtomFamily
§text: String
§

Color

Fields

§mode: Mode
§color: String

Implementations§

Source§

impl ParseNode

Source

pub fn mode(&self) -> Mode

Returns the Mode this node was parsed in.

Trait Implementations§

Source§

impl Clone for ParseNode

Source§

fn clone(&self) -> ParseNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParseNode

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ParseNode

Source§

fn eq(&self, other: &ParseNode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ParseNode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.