pub enum ParseErrorKind {
Show 39 variants
UnexpectedToken {
expected: TokenType,
found: TokenType,
},
ExpectedContentWord {
found: TokenType,
},
ExpectedCopula,
UnknownQuantifier {
found: TokenType,
},
UnknownModal {
found: TokenType,
},
ExpectedVerb {
found: TokenType,
},
ExpectedTemporalAdverb,
ExpectedPresuppositionTrigger,
ExpectedFocusParticle,
ExpectedScopalAdverb,
ExpectedSuperlativeAdjective,
ExpectedComparativeAdjective,
ExpectedThan,
ExpectedNumber,
EmptyRestriction,
GappingResolutionFailed,
StativeProgressiveConflict,
UndefinedVariable {
name: String,
},
UseAfterMove {
name: String,
},
IsValueEquality {
variable: String,
value: String,
},
ZeroIndex,
ExpectedStatement,
ExpectedKeyword {
keyword: String,
},
ExpectedExpression,
ExpectedIdentifier,
RespectivelyLengthMismatch {
subject_count: usize,
object_count: usize,
},
TypeMismatch {
expected: String,
found: String,
},
TypeMismatchDetailed {
expected: String,
found: String,
context: String,
},
InfiniteType {
var_description: String,
type_description: String,
},
ArityMismatch {
function: String,
expected: usize,
found: usize,
},
FieldNotFound {
type_name: String,
field_name: String,
available: Vec<String>,
},
NotAFunction {
found_type: String,
},
InvalidRefinementPredicate,
GrammarError(String),
ScopeViolation(String),
UnresolvedPronoun {
gender: Gender,
number: Number,
},
TrailingTokens {
found: TokenType,
},
AstTooDeep {
depth: usize,
max_depth: usize,
},
Custom(String),
}Variants§
UnexpectedToken
ExpectedContentWord
ExpectedCopula
UnknownQuantifier
UnknownModal
ExpectedVerb
ExpectedTemporalAdverb
ExpectedPresuppositionTrigger
ExpectedFocusParticle
ExpectedScopalAdverb
ExpectedSuperlativeAdjective
ExpectedComparativeAdjective
ExpectedThan
ExpectedNumber
EmptyRestriction
GappingResolutionFailed
StativeProgressiveConflict
UndefinedVariable
UseAfterMove
IsValueEquality
ZeroIndex
ExpectedStatement
ExpectedKeyword
ExpectedExpression
ExpectedIdentifier
RespectivelyLengthMismatch
Subject and object lists have different lengths in a “respectively” construction.
TypeMismatch
Type mismatch during static type checking.
TypeMismatchDetailed
Type mismatch with context (e.g., “in argument 2 of ‘compute’”).
InfiniteType
A type variable would occur in its own definition (e.g., T = List<T>).
ArityMismatch
Wrong number of arguments in a function call.
FieldNotFound
A field name does not exist on the struct type.
NotAFunction
Tried to call something that is not a function.
InvalidRefinementPredicate
Invalid refinement predicate in a dependent type.
GrammarError(String)
Grammar error (e.g., “its” vs “it’s”).
ScopeViolation(String)
DRS scope violation (pronoun trapped in negation, disjunction, etc.).
UnresolvedPronoun
Unresolved pronoun in discourse mode - no accessible antecedent found.
TrailingTokens
The parser finished a sentence with input left over — accepting it would silently drop the remainder’s meaning.
AstTooDeep
The program’s AST nests deeper than every downstream walker (optimizer, codegen, interpreter, VM compiler) can safely recurse — the depth gate rejects it here so no surface ever stack-overflows.
Fields
max_depth: usizeThe enforced limit (crate::ast_depth::max_ast_depth).
Custom(String)
Custom error message (used for escape analysis, zone errors, etc.).
Implementations§
Source§impl ParseErrorKind
impl ParseErrorKind
Sourcepub fn code(&self) -> &'static str
pub fn code(&self) -> &'static str
The stable kebab-case diagnostic code.
Codes are the kebab-cased variant name, with the collapses the language
server already shipped kept intact: both type-mismatch variants share
"type-mismatch".
Sourcepub fn severity(&self) -> DiagSeverity
pub fn severity(&self) -> DiagSeverity
The presentation severity, agreeing with the LSP decision table.
Sourcepub fn headline(&self) -> String
pub fn headline(&self) -> String
A one-line headline naming what went wrong, without the Socratic prose.
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
The variant’s name, for catalog keys and golden stanza headers.
Sourcepub fn quickfix_note(&self) -> Option<&'static str>
pub fn quickfix_note(&self) -> Option<&'static str>
The mechanical fix note the LSP offers, when one is safe.
Sourcepub fn docs_anchor(&self) -> Option<&'static str>
pub fn docs_anchor(&self) -> Option<&'static str>
The quickguide heading slug, when a lesson teaches this construct.
Trait Implementations§
Source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
Source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more