pub enum ParseNodeOp {
Symbol {
mode: Mode,
loc: Option<SourceLocation>,
limits: bool,
always_handle_sup_sub: Option<bool>,
suppress_base_shift: Option<bool>,
parent_is_sup_sub: bool,
name: String,
symbol: bool,
},
Body {
mode: Mode,
loc: Option<SourceLocation>,
limits: bool,
always_handle_sup_sub: Option<bool>,
suppress_base_shift: Option<bool>,
parent_is_sup_sub: bool,
body: Vec<AnyParseNode>,
},
}
Expand description
Represents mathematical operators in KaTeX expressions, supporting both symbolic and compound operators.
This enum handles operators that can appear in mathematical expressions, including those with limits (subscripts/superscripts above/below) and those that contain other expressions as their body.
§Usage
Used for operators like \sum
, \int
, \lim
, etc. The limits
field
controls whether sub/super scripts appear as limits (above/below) or as
regular scripts (right side).
§LaTeX Examples
\sum_{i=1}^{n} x_i % limits = true
\int_a^b f(x) dx % limits = false (default)
\lim_{x \to 0} f(x) % limits = true
Variants§
Symbol
A simple operator symbol with optional limit positioning
Fields
mode: Mode
The parsing mode (Mode::Math
or Mode::Text
)
loc: Option<SourceLocation>
Optional source location for error reporting
Body
An operator that contains other expressions as its body
Fields
mode: Mode
The parsing mode (Mode::Math
or Mode::Text
)
loc: Option<SourceLocation>
Optional source location for error reporting
body: Vec<AnyParseNode>
The expressions that form the operator’s content
Implementations§
Source§impl ParseNodeOp
impl ParseNodeOp
Sourcepub const fn limits_mut(&mut self) -> &mut bool
pub const fn limits_mut(&mut self) -> &mut bool
Mutate the limits field
Sourcepub fn always_handle_sup_sub(&self) -> bool
pub fn always_handle_sup_sub(&self) -> bool
Get the always_handle_sup_sub field
Sourcepub const fn always_handle_sup_sub_mut(&mut self) -> &mut Option<bool>
pub const fn always_handle_sup_sub_mut(&mut self) -> &mut Option<bool>
Mutate the always_handle_sup_sub field
Trait Implementations§
Source§impl Clone for ParseNodeOp
impl Clone for ParseNodeOp
Source§fn clone(&self) -> ParseNodeOp
fn clone(&self) -> ParseNodeOp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more