pub enum Diagnostic<'text> {
Show 56 variants
NumberMissingIntegralPart {
number: Number<'text>,
},
NumberLeadingZeroIntegralPart {
number: Number<'text>,
},
NumberMissingFractionalPart {
number: Number<'text>,
},
NumberMissingExponentPart {
number: Number<'text>,
},
OptionMissingKey {
span: Span,
},
OptionMissingValue {
span: Span,
},
LoneEqualsSign {
loc: Location,
},
MarkupMissingIdentifier {
span: Span,
},
MarkupInvalidSpaceBeforeIdentifier {
id: Identifier<'text>,
start_loc: Location,
},
MarkupMissingClosingBrace {
span: Span,
},
MarkupCloseInvalidSelfClose {
self_close_loc: Location,
},
MarkupInvalidSpaceBetweenSelfCloseAndBrace {
space: Span,
},
MarkupOptionAfterAttribute {
previous_attribute: Attribute<'text>,
option: FnOrMarkupOption<'text>,
},
FunctionMissingIdentifier {
span: Span,
},
UnterminatedQuoted {
span: Span,
},
PlaceholderMissingClosingBrace {
span: Span,
},
PlaceholderMissingBody {
span: Span,
},
PlaceholderInvalidLiteral {
span: Span,
},
PlaceholderInvalidContents {
span: Span,
},
QuotedPatternInsidePattern {
open_span: Span,
close_span: Option<Span>,
},
MarkupInvalidContents {
span: Span,
},
MissingIdentifierName {
identifier: Identifier<'text>,
},
MissingIdentifierNamespace {
identifier: Identifier<'text>,
},
EscapeInvalidCharacter {
char_loc: Location,
char: char,
},
EscapeMissingCharacter {
slash_loc: Location,
},
InvalidNullCharacter {
char_loc: Location,
},
InvalidClosingBrace {
brace_loc: Location,
},
AnnotationMissingSpaceBefore {
span: Span,
},
AttributeMissingSpaceBefore {
span: Span,
},
AttributeMissingKey {
span: Span,
},
AttributeMissingValue {
span: Span,
},
AttributeValueIsVariable {
span: Span,
},
VariableMissingName {
span: Span,
},
UnterminatedQuotedPattern {
span: Span,
},
LocalKeywordMissingTrailingSpace {
span: Span,
},
LocalVariableMissingDollar {
span: Span,
},
MissingSpaceBeforeMatcherSelector {
span: Span,
},
MissingSpaceBeforeMatcherKey {
span: Span,
},
ComplexMessageMissingBody {
span: Span,
},
ComplexMessageTrailingContent {
span: Span,
},
ComplexMessageBodyNotQuoted {
span: Span,
},
ComplexMessageDeclarationAfterBody {
span: Span,
},
ComplexMessageMultipleBodies {
span: Span,
},
MatcherKeyIsVariable {
span: Span,
},
InvalidMatcherLiteralKey {
span: Span,
},
InvalidStatement {
span: Span,
keyword: &'text str,
},
LocalDeclarationMalformed {
span: Span,
},
LocalDeclarationValueNotWrappedInBraces {
span: Span,
},
LocalDeclarationVariableMissingTrailingEquals {
span: Span,
},
LocalDeclarationMissingExpression {
span: Span,
},
InputDeclarationMissingExpression {
span: Span,
},
InputDeclarationWithInvalidExpression {
span: Span,
expression: Expression<'text>,
},
MatcherMissingSelectors {
span: Span,
},
MatcherVariantMissingKeys {
span: Span,
},
MatcherVariantExpressionBodyNotQuoted {
span: Span,
},
MatcherVariantMissingBody {
span: Span,
},
}Expand description
Diagnostics that can be produced by the parser. Each diagnostic has a message that describes the error, and a span that indicates the location in the source text where the error occurred.
Fatal diagnostics indicate that the parser was unable to recover from the error, and the AST may be incomplete or incorrect. Non-fatal diagnostics indicate that the parser was able to recover from the error, and the AST still fully represents the input text, but the AST may still be invalid in some way (like escaping a character that can not be escaped).
Variants§
NumberMissingIntegralPart
NumberLeadingZeroIntegralPart
NumberMissingFractionalPart
NumberMissingExponentPart
OptionMissingKey
OptionMissingValue
LoneEqualsSign
MarkupMissingIdentifier
MarkupInvalidSpaceBeforeIdentifier
MarkupMissingClosingBrace
MarkupCloseInvalidSelfClose
MarkupInvalidSpaceBetweenSelfCloseAndBrace
MarkupOptionAfterAttribute
FunctionMissingIdentifier
UnterminatedQuoted
PlaceholderMissingClosingBrace
PlaceholderMissingBody
PlaceholderInvalidLiteral
PlaceholderInvalidContents
QuotedPatternInsidePattern
MarkupInvalidContents
MissingIdentifierName
Fields
identifier: Identifier<'text>MissingIdentifierNamespace
Fields
identifier: Identifier<'text>EscapeInvalidCharacter
EscapeMissingCharacter
InvalidNullCharacter
InvalidClosingBrace
AnnotationMissingSpaceBefore
AttributeMissingSpaceBefore
AttributeMissingKey
AttributeMissingValue
AttributeValueIsVariable
VariableMissingName
UnterminatedQuotedPattern
LocalKeywordMissingTrailingSpace
LocalVariableMissingDollar
MissingSpaceBeforeMatcherSelector
MissingSpaceBeforeMatcherKey
ComplexMessageMissingBody
ComplexMessageTrailingContent
ComplexMessageBodyNotQuoted
ComplexMessageDeclarationAfterBody
ComplexMessageMultipleBodies
MatcherKeyIsVariable
InvalidMatcherLiteralKey
InvalidStatement
LocalDeclarationMalformed
LocalDeclarationValueNotWrappedInBraces
LocalDeclarationVariableMissingTrailingEquals
LocalDeclarationMissingExpression
InputDeclarationMissingExpression
InputDeclarationWithInvalidExpression
MatcherMissingSelectors
MatcherVariantMissingKeys
MatcherVariantExpressionBodyNotQuoted
MatcherVariantMissingBody
Implementations§
source§impl<'text> Diagnostic<'text>
impl<'text> Diagnostic<'text>
sourcepub fn fatal(&self) -> bool
pub fn fatal(&self) -> bool
Check if the diagnostic is fatal. Fatal diagnostics indicate that the parser was unable to recover from the error, and the AST may be incomplete or incorrect.
Non-fatal diagnostics indicate that the parser was able to recover from the error, and the AST still fully represents the input text, but the AST may still be invalid in some way (like escaping a character that can not be escaped).