pub struct ParserConfig { /* private fields */ }Expand description
Controls optional parser behavior beyond core AST construction.
Keep defaults for pure parsing. Enable extras only when your tool needs them (for example, token-level highlighting or parser debugging).
Implementations§
Source§impl ParserConfig
impl ParserConfig
Sourcepub fn trace(&self) -> bool
pub fn trace(&self) -> bool
Whether parser debug trace logging is enabled. Default: false.
Useful when debugging grammar behavior; usually disabled in production.
Sourcepub fn collect_tokens(&self) -> bool
pub fn collect_tokens(&self) -> bool
Whether parser tokens/comments are recorded for each statement. Default: false.
Enable this for tooling that needs precise token streams (formatters, diagnostics, semantic highlighting).
Sourcepub fn with_trace(self, trace: bool) -> Self
pub fn with_trace(self, trace: bool) -> Self
Enable or disable parser trace logging.
Sourcepub fn with_collect_tokens(self, collect_tokens: bool) -> Self
pub fn with_collect_tokens(self, collect_tokens: bool) -> Self
Enable or disable token/comment capture on parse results.
Sourcepub fn macro_fallback(&self) -> bool
pub fn macro_fallback(&self) -> bool
Whether macro fallback is enabled. Default: false.
When enabled and the dialect uses Rust-style macros, unregistered
name!(args) calls are consumed as a single TK_ID token instead
of causing a parse error. A MacroRegion is recorded so the
formatter can emit the call verbatim.
Sourcepub fn with_macro_fallback(self, macro_fallback: bool) -> Self
pub fn with_macro_fallback(self, macro_fallback: bool) -> Self
Enable or disable macro fallback for unregistered macro calls.
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more