Skip to main content

LexerBuildError

Enum LexerBuildError 

pub enum LexerBuildError {
    Uncompilable {
        terminal: String,
        reason: String,
    },
    ZeroWidth {
        terminal: String,
    },
    UnknownIgnore {
        name: String,
    },
    UnsupportedGlobalFlags {
        flags: u32,
    },
    DivergentConstruct {
        terminal: String,
        construct: String,
        at: usize,
        reason: String,
        pattern: String,
        hint: Option<String>,
    },
}
Expand description

Construction-time errors, mirroring Lark’s validation, all gated by skip_validation.

Variants§

§

Uncompilable

Neither engine compiles the terminal.

Fields

§terminal: String
§reason: String
§

ZeroWidth

The terminal can match the empty string.

Fields

§terminal: String
§

UnknownIgnore

%ignore names a terminal that does not exist.

Fields

§name: String
§

UnsupportedGlobalFlags

Unsupported g_regex_flags bits (surfaced from the scanner build).

Fields

§flags: u32
§

DivergentConstruct

A terminal uses a Python-re construct whose Rust-engine semantics differ, and it was neither suppressed by flag context nor rewritten (translation off, or an untranslatable exotic). Enable LexerConf::translate_python_regex to rewrite the mechanical set (user decision 2026-07-07; see [crate::py_regex]). Lark itself never raises this — it runs on CPython re directly — so there is no Lark parity to preserve; hyperlark refuses what it cannot match Python-exactly.

Fields

§terminal: String
§construct: String

Human name of the divergent construct (e.g. $, \Z).

§at: usize

Byte offset of the construct in the terminal’s to_regexp() output.

§reason: String

Why it is refused — specific to the construct, and names the dialect (Python re, the regex module) the prefix no longer states.

§pattern: String

A window of the pattern around at. The terminal named above may only REFER to the one the construct was written in, so the text is what makes it findable.

§hint: Option<String>

The LexerConf flag that would rewrite the mechanical set, when one would; None for constructs no flag can fix.

Trait Implementations§

§

impl Clone for LexerBuildError

§

fn clone(&self) -> LexerBuildError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for LexerBuildError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Display for LexerBuildError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Eq for LexerBuildError

§

impl Error for LexerBuildError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
§

impl PartialEq for LexerBuildError

§

fn eq(&self, other: &LexerBuildError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl StructuralPartialEq for LexerBuildError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToCompactString for T
where T: Display,

§

fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>

Fallible version of [ToCompactString::to_compact_string()] Read more
§

fn to_compact_string(&self) -> CompactString

Converts the given value to a [CompactString]. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.