pub struct ParseNodeSupSub {
pub mode: Mode,
pub loc: Option<SourceLocation>,
pub base: Option<Box<AnyParseNode>>,
pub sup: Option<Box<AnyParseNode>>,
pub sub: Option<Box<AnyParseNode>>,
}
Expand description
Represents superscript and subscript combinations in mathematical expressions.
This struct handles the attachment of superscript and/or subscript expressions to a base expression, supporting complex nested structures.
§Fields
mode
- The parsing mode (Mode::Math
orMode::Text
)loc
- Optional source location for error reportingbase
- The base expression being modifiedsup
- Optional superscript expressionsub
- Optional subscript expression
§LaTeX Correspondence
Corresponds to LaTeX superscript/subscript syntax:
x^2 % Superscript
a_i % Subscript
x^{n+1} % Complex superscript
a_{i,j} % Complex subscript
§Usage
SupSub nodes are fundamental for mathematical notation, allowing expressions like exponents, indices, and other modifiers to be properly positioned relative to their base.
Fields§
§mode: Mode
The parsing mode (Mode::Math
or Mode::Text
)
loc: Option<SourceLocation>
Optional source location for error reporting
base: Option<Box<AnyParseNode>>
The base expression being modified
sup: Option<Box<AnyParseNode>>
Optional superscript expression
sub: Option<Box<AnyParseNode>>
Optional subscript expression
Trait Implementations§
Source§impl Clone for ParseNodeSupSub
impl Clone for ParseNodeSupSub
Source§fn clone(&self) -> ParseNodeSupSub
fn clone(&self) -> ParseNodeSupSub
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParseNodeSupSub
impl Debug for ParseNodeSupSub
Source§impl PartialEq for ParseNodeSupSub
impl PartialEq for ParseNodeSupSub
impl StructuralPartialEq for ParseNodeSupSub
Auto Trait Implementations§
impl Freeze for ParseNodeSupSub
impl RefUnwindSafe for ParseNodeSupSub
impl Send for ParseNodeSupSub
impl Sync for ParseNodeSupSub
impl Unpin for ParseNodeSupSub
impl UnwindSafe for ParseNodeSupSub
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more