Skip to main content

DeclarationErrorKind

Enum DeclarationErrorKind 

Source
pub enum DeclarationErrorKind {
Show 14 variants EmptyCommandEntry, InvalidCommandName { name: SmolStr, }, BuiltinCommandName { name: SmolStr, }, UnknownCommandLikeTarget { target: SmolStr, }, EmptyEntry, UnknownLikeTarget { target: SmolStr, }, VerbatimTarget, TargetTakesArguments, UndeclaredTarget, DuplicateDelimiter { name: CommandName, first: SmolStr, }, RepeatedDelimiter { name: CommandName, }, SpellingIsALiteralDelimiter { name: CommandName, environment: SmolStr, }, NotAControlWord { name: CommandName, }, SpellingIsABuiltinCommand { name: CommandName, },
}
Expand description

Why a declaration was rejected. Each variant is a rule from AGENTS.md decision #12 or its architecture section.

Variants§

§

EmptyCommandEntry

A [commands.<name>] entry without its required like target.

§

InvalidCommandName

A command map key that could never lex as one control word.

Fields

§name: SmolStr
§

BuiltinCommandName

A declaration attempted to reclassify a curated built-in command.

Fields

§name: SmolStr
§

UnknownCommandLikeTarget

like did not name a curated reference or citation command.

Fields

§target: SmolStr
§

EmptyEntry

An entry with no keys at all. Nothing to reject it on rule grounds, and nothing for it to do either — which is the outcome this module exists to avoid.

§

UnknownLikeTarget

like named something the curated built-in database does not have. Never resolved against the CWL tier or scanned definitions: behavior comes from curated data only.

Fields

§target: SmolStr
§

VerbatimTarget

Delimiter spellings for a verbatim environment. Not conservatism but TeX truth, which is why it is rejected rather than merely discouraged.

§

TargetTakesArguments

Delimiter spellings for an environment that takes arguments. A bare control word carries none, and attaching them from the target’s signature would be arity-directed grouping from declaration data.

§

UndeclaredTarget

Delimiter spellings for an environment whose behavior is unknown — no like, and no built-in of that name.

§

DuplicateDelimiter

A spelling two entries both claim. Silently letting the last one win would make the pairing depend on map order.

Fields

§first: SmolStr
§

RepeatedDelimiter

A spelling one entry lists twice — across its two sides, or twice on one. The DuplicateDelimiter mistake seen from inside a single entry, where naming the “other” entry is no help.

Fields

§

SpellingIsALiteralDelimiter

A spelling that is the written-out delimiter (\end{split}) rather than a command standing in for one. A special case of NotAControlWord with its own fix: the literal delimiter is already a spelling of both sides, so the key is redundant.

Fields

§environment: SmolStr
§

NotAControlWord

A spelling the lexer could never produce as one control word, so it could never match anything.

Fields

§

SpellingIsABuiltinCommand

A spelling the curated database already knows as a command. Not a no-op — it would take effect, on a command the project did not mean to redefine.

Fields

Trait Implementations§

Source§

impl Clone for DeclarationErrorKind

Source§

fn clone(&self) -> DeclarationErrorKind

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
Source§

impl Debug for DeclarationErrorKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for DeclarationErrorKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for DeclarationErrorKind

Source§

impl PartialEq for DeclarationErrorKind

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DeclarationErrorKind

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.

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> ToSmolStr for T
where T: Display + ?Sized,

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.