pub struct ParserConfig {
pub max_depth: usize,
pub unicode_ops: bool,
pub suggestions: bool,
pub error_recovery: bool,
pub allow_commands: bool,
}Expand description
Configuration options for the parser.
These influence how the parser handles ambiguity, error recovery, and diagnostic reporting.
Fields§
§max_depth: usizeMaximum expression nesting depth before the parser gives up.
Default: 512.
unicode_ops: boolWhether to enable experimental Unicode operator support.
Default: true.
suggestions: boolWhether to emit “did you mean?” suggestions on parse errors.
Default: true.
error_recovery: boolWhether to allow recovery from parse errors and continue parsing.
Default: false (strict mode).
allow_commands: boolWhether #check, #eval, and similar commands are permitted.
Default: true.
Implementations§
Source§impl ParserConfig
impl ParserConfig
Sourcepub fn with_max_depth(self, depth: usize) -> Self
pub fn with_max_depth(self, depth: usize) -> Self
Set the maximum nesting depth.
Sourcepub fn with_unicode_ops(self, enabled: bool) -> Self
pub fn with_unicode_ops(self, enabled: bool) -> Self
Enable or disable unicode operator support.
Sourcepub fn with_error_recovery(self, enabled: bool) -> Self
pub fn with_error_recovery(self, enabled: bool) -> Self
Enable error recovery mode.
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
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 ParserConfig
impl Debug for ParserConfig
Auto Trait Implementations§
impl Freeze for ParserConfig
impl RefUnwindSafe for ParserConfig
impl Send for ParserConfig
impl Sync for ParserConfig
impl Unpin for ParserConfig
impl UnsafeUnpin for ParserConfig
impl UnwindSafe for ParserConfig
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