marianoguerra/html/kind does not have a README file

    ErrorKind

    pub(all) enum ErrorKind {
    EofInTag
    EofInComment
    EofInRawText(String)
    EofInDoctype
    UnclosedElement(String)
    MismatchedEndTag(String, String)
    StrayEndTag(String)
    EndTagForVoid(String)
    ChildrenOnVoid(String)
    NonVoidSelfClosing(String)
    DuplicateAttribute(String)
    UnexpectedSolidusInTag
    MissingTagName
    InvalidFirstCharacterOfTagName
    UnexpectedEqualsSignBeforeAttributeName
    UnexpectedCharacterInUnquotedAttributeValue
    AbruptClosingOfEmptyComment
    NestedComment
    IncorrectlyClosedComment
    BogusComment
    CdataInHtmlContent
    DoctypeNotFirst
    MalformedDoctype
    UnknownNamedCharacterReference(String)
    MissingSemicolonAfterCharacterReference
    AbsenceOfDigitsInNumericCharacterReference
    CharacterReferenceOutsideUnicodeRange
    UnexpectedNullCharacter
    UnprintableRawText(String)
    Unexpected(String)
    } derive(Eq,
    Debug
    )

    What went wrong, as a closed set.

    This package has no dependencies at all, and that is deliberate: the tree stores a kind on every Bogus node, so if kinds lived beside the Diagnostic that renders them, building a tree would link the diagnostic library. Splitting the name of a problem from the reporting of one is what keeps ast and write free of error-report.

    The names are the specification's. WHATWG names roughly seventy parse errors -- eof-in-tag, abrupt-closing-of-empty-comment, unexpected-solidus-in-tag -- and taking those names costs nothing and buys a message that is greppable against the spec and comparable against any other parser's output. Where a kind has no counterpart there, because it is about the markup tree rather than the token stream, the name is ours and says so by being ordinary English.

    ErrorKind::code

    fn ErrorKind::code(self : ErrorKind) -> String

    A stable identifier for this kind.

    Stable is the whole point: it goes in error[...] headers, in JSON output and in a harness's expectations, so it must not change when the prose does. Written out rather than derived from the variant name, so that renaming a variant is a local edit and not a silent break of everything downstream that matched on the string.

    ErrorKind::is_warning

    fn ErrorKind::is_warning(self : ErrorKind) -> Bool

    Whether this kind is a hard error or something a tolerant parse may carry.

    The distinction is what makes strict mode meaningful, and here it carries more weight than it does in CSS: most of these are recoveries rather than failures. A stray </div> is what half the web looks like, and a library that refused it would be a library nobody could point at a real page.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io