Enum LarkBuildError
#[non_exhaustive]pub enum LarkBuildError {
Grammar {
message: String,
},
Configuration {
message: String,
},
Lexer(LexerBuildError),
DynamicLexer(LexerBuildError),
Load {
message: String,
},
Unsupported {
message: String,
},
}Expand description
A construction failure — Lark’s build-time exception classes, carrying the class name + verbatim message so a binding reproduces the Python exception. Provisional richness.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Grammar
Lark’s GrammarError (compile / dynamic-callback rejects).
Configuration
Lark’s ConfigurationError (parser×lexer / postlex×dynamic rejects).
Lexer(LexerBuildError)
A lexer-build validation failure (LexerBuildError).
DynamicLexer(LexerBuildError)
A terminal the dynamic Earley lexer refused (LexerBuildError): Lark’s
GrammarError on that front end.
Load
A serialized-grammar load failure (from_json_*).
Unsupported
A configured feature this RC does not implement yet (e.g. use_bytes).
Implementations§
§impl LarkBuildError
impl LarkBuildError
pub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
The binding-facing failure kind — what a binding selects its exception CLASS from. Lives here so a new variant is classified once, not once per binding.
pub fn class_name(&self) -> &'static str
pub fn class_name(&self) -> &'static str
A DISCRIMINATOR label naming the failing core variant. The WASM binding
exposes it as className beside the thrown error, to tell two failures
of one class apart; the Python binding does not carry it. Not a class to
look up — LexerBuildError and LoadError name no binding class, by
design. Select the class from Self::kind.
pub fn without_option_hint(self) -> Self
pub fn without_option_hint(self) -> Self
This error without its advice to set an option, for a front end that
cannot set one: C and TypeScript cannot set translate_python_regex.
Trait Implementations§
§impl Clone for LarkBuildError
impl Clone for LarkBuildError
§impl Debug for LarkBuildError
impl Debug for LarkBuildError
§impl Display for LarkBuildError
impl Display for LarkBuildError
§impl Error for LarkBuildError
impl Error for LarkBuildError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for LarkBuildError
impl RefUnwindSafe for LarkBuildError
impl Send for LarkBuildError
impl Sync for LarkBuildError
impl Unpin for LarkBuildError
impl UnsafeUnpin for LarkBuildError
impl UnwindSafe for LarkBuildError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more