pub struct ParseNodeLeftRight {
pub mode: Mode,
pub loc: Option<SourceLocation>,
pub body: Vec<AnyParseNode>,
pub left: String,
pub right: String,
pub right_color: Option<String>,
}
Expand description
Represents left-right delimiter pairs in mathematical expressions.
This struct handles matching delimiter pairs that enclose mathematical content, such as parentheses, brackets, and braces with automatic sizing.
§Fields
mode
- The parsing mode (Mode::Math
orMode::Text
)loc
- Optional source location for error reportingbody
- The enclosed mathematical expressionsleft
- The left delimiter symbolright
- The right delimiter symbolright_color
- Optional color for the right delimiter
§LaTeX Correspondence
Corresponds to LaTeX left-right delimiters:
\left( \frac{a}{b} \right)
\left[ x + y \right]
\left\{ a, b, c \right\}
§Usage
LeftRight nodes automatically size delimiters to fit their content, ensuring proper visual grouping of mathematical expressions.
Fields§
§mode: Mode
The parsing mode (Mode::Math
or Mode::Text
)
loc: Option<SourceLocation>
Optional source location for error reporting
body: Vec<AnyParseNode>
The enclosed mathematical expressions
left: String
The left delimiter symbol
right: String
The right delimiter symbol
right_color: Option<String>
Optional color for the right delimiter
Trait Implementations§
Source§impl Clone for ParseNodeLeftRight
impl Clone for ParseNodeLeftRight
Source§fn clone(&self) -> ParseNodeLeftRight
fn clone(&self) -> ParseNodeLeftRight
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 ParseNodeLeftRight
impl Debug for ParseNodeLeftRight
Source§impl PartialEq for ParseNodeLeftRight
impl PartialEq for ParseNodeLeftRight
impl StructuralPartialEq for ParseNodeLeftRight
Auto Trait Implementations§
impl Freeze for ParseNodeLeftRight
impl RefUnwindSafe for ParseNodeLeftRight
impl Send for ParseNodeLeftRight
impl Sync for ParseNodeLeftRight
impl Unpin for ParseNodeLeftRight
impl UnwindSafe for ParseNodeLeftRight
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