parse() {
        while (this.shouldContinue()) {
            const c = this.buffer.charCodeAt(this.index - this.offset);
            if (this.state === State.Text) {
                this.stateText(c);
            }
            else if (this.state === State.SpecialStartSequence) {
                this.stateSpecialStartSequence(c);
            }
            else if (this.state === State.InSpecialTag) {
                this.stateInSpecialTag(c);
            }
            else if (this.state === State.CDATASequence) {
                this.stateCDATASequence(c);
            }
            else if (this.state === State.InAttributeValueDq) {
                this.stateInAttributeValueDoubleQuotes(c);
            }
            else if (this.state === State.InAttributeName) {
                this.stateInAttributeName(c);
            }
            else if (this.state === State.InCommentLike) {
                this.stateInCommentLike(c);
            }
            else if (this.state === State.InSpecialComment) {
                this.stateInSpecialComment(c);
            }
            else if (this.state === State.BeforeAttributeName) {
                this.stateBeforeAttributeName(c);
            }
            else if (this.state === State.InTagName) {
                this.stateInTagName(c);
            }
            else if (this.state === State.InClosingTagName) {
                this.stateInClosingTagName(c);
            }
            else if (this.state === State.BeforeTagName) {
                this.stateBeforeTagName(c);
            }
            else if (this.state === State.AfterAttributeName) {
                this.stateAfterAttributeName(c);
            }
            else if (this.state === State.InAttributeValueSq) {
                this.stateInAttributeValueSingleQuotes(c);
            }
            else if (this.state === State.BeforeAttributeValue) {
                this.stateBeforeAttributeValue(c);
            }
            else if (this.state === State.BeforeClosingTagName) {
                this.stateBeforeClosingTagName(c);
            }
            else if (this.state === State.AfterClosingTagName) {
                this.stateAfterClosingTagName(c);
            }
            else if (this.state === State.BeforeSpecialS) {
                this.stateBeforeSpecialS(c);
            }
            else if (this.state === State.InAttributeValueNq) {
                this.stateInAttributeValueNoQuotes(c);
            }
            else if (this.state === State.InSelfClosingTag) {
                this.stateInSelfClosingTag(c);
            }
            else if (this.state === State.InDeclaration) {
                this.stateInDeclaration(c);
            }
            else if (this.state === State.BeforeDeclaration) {
                this.stateBeforeDeclaration(c);
            }
            else if (this.state === State.BeforeComment) {
                this.stateBeforeComment(c);
            }
            else if (this.state === State.InProcessingInstruction) {
                this.stateInProcessingInstruction(c);
            }
            else if (this.state === State.InNamedEntity) {
                this.stateInNamedEntity(c);
            }
            else if (this.state === State.BeforeEntity) {
                this.stateBeforeEntity(c);
            }
            else if (this.state === State.InHexEntity) {
                this.stateInHexEntity(c);
            }
            else if (this.state === State.InNumericEntity) {
                this.stateInNumericEntity(c);
            }
            else {
                // `this._state === State.BeforeNumericEntity`
                this.stateBeforeNumericEntity(c);
            }
            this.index++;
        }
        this.cleanup();
    }
/**
     * Iterates through the buffer, calling the function corresponding to the current state.
     *
     * States that are more likely to be hit are higher up, as a performance improvement.
     */
Iterates through the buffer, calling the function corresponding to the current state.
States that are more likely to be hit are higher up, as a performance improvement.
Iterates through the buffer calling the function corresponding to the current state . States that are more likely to be hit are higher up as a performance improvement .
parse() {
        while (this.shouldContinue()) {
            const c = this.buffer.charCodeAt(this.index - this.offset);
            if (this.state === State.Text) {
                this.stateText(c);
            }
            else if (this.state === State.SpecialStartSequence) {
                this.stateSpecialStartSequence(c);
            }
            else if (this.state === State.InSpecialTag) {
                this.stateInSpecialTag(c);
            }
            else if (this.state === State.CDATASequence) {
                this.stateCDATASequence(c);
            }
            else if (this.state === State.InAttributeValueDq) {
                this.stateInAttributeValueDoubleQuotes(c);
            }
            else if (this.state === State.InAttributeName) {
                this.stateInAttributeName(c);
            }
            else if (this.state === State.InCommentLike) {
                this.stateInCommentLike(c);
            }
            else if (this.state === State.InSpecialComment) {
                this.stateInSpecialComment(c);
            }
            else if (this.state === State.BeforeAttributeName) {
                this.stateBeforeAttributeName(c);
            }
            else if (this.state === State.InTagName) {
                this.stateInTagName(c);
            }
            else if (this.state === State.InClosingTagName) {
                this.stateInClosingTagName(c);
            }
            else if (this.state === State.BeforeTagName) {
                this.stateBeforeTagName(c);
            }
            else if (this.state === State.AfterAttributeName) {
                this.stateAfterAttributeName(c);
            }
            else if (this.state === State.InAttributeValueSq) {
                this.stateInAttributeValueSingleQuotes(c);
            }
            else if (this.state === State.BeforeAttributeValue) {
                this.stateBeforeAttributeValue(c);
            }
            else if (this.state === State.BeforeClosingTagName) {
                this.stateBeforeClosingTagName(c);
            }
            else if (this.state === State.AfterClosingTagName) {
                this.stateAfterClosingTagName(c);
            }
            else if (this.state === State.BeforeSpecialS) {
                this.stateBeforeSpecialS(c);
            }
            else if (this.state === State.InAttributeValueNq) {
                this.stateInAttributeValueNoQuotes(c);
            }
            else if (this.state === State.InSelfClosingTag) {
                this.stateInSelfClosingTag(c);
            }
            else if (this.state === State.InDeclaration) {
                this.stateInDeclaration(c);
            }
            else if (this.state === State.BeforeDeclaration) {
                this.stateBeforeDeclaration(c);
            }
            else if (this.state === State.BeforeComment) {
                this.stateBeforeComment(c);
            }
            else if (this.state === State.InProcessingInstruction) {
                this.stateInProcessingInstruction(c);
            }
            else if (this.state === State.InNamedEntity) {
                this.stateInNamedEntity(c);
            }
            else if (this.state === State.BeforeEntity) {
                this.stateBeforeEntity(c);
            }
            else if (this.state === State.InHexEntity) {
                this.stateInHexEntity(c);
            }
            else if (this.state === State.InNumericEntity) {
                this.stateInNumericEntity(c);
            }
            else {
                this.stateBeforeNumericEntity(c);
            }
            this.index++;
        }
        this.cleanup();
    }
parse ( ) { while ( this . shouldContinue ( ) ) { const c = this . buffer . charCodeAt ( this . index - this . offset ) ; if ( this . state === State . Text ) { this . stateText ( c ) ; } else if ( this . state === State . SpecialStartSequence ) { this . stateSpecialStartSequence ( c ) ; } else if ( this . state === State . InSpecialTag ) { this . stateInSpecialTag ( c ) ; } else if ( this . state === State . CDATASequence ) { this . stateCDATASequence ( c ) ; } else if ( this . state === State . InAttributeValueDq ) { this . stateInAttributeValueDoubleQuotes ( c ) ; } else if ( this . state === State . InAttributeName ) { this . stateInAttributeName ( c ) ; } else if ( this . state === State . InCommentLike ) { this . stateInCommentLike ( c ) ; } else if ( this . state === State . InSpecialComment ) { this . stateInSpecialComment ( c ) ; } else if ( this . state === State . BeforeAttributeName ) { this . stateBeforeAttributeName ( c ) ; } else if ( this . state === State . InTagName ) { this . stateInTagName ( c ) ; } else if ( this . state === State . InClosingTagName ) { this . stateInClosingTagName ( c ) ; } else if ( this . state === State . BeforeTagName ) { this . stateBeforeTagName ( c ) ; } else if ( this . state === State . AfterAttributeName ) { this . stateAfterAttributeName ( c ) ; } else if ( this . state === State . InAttributeValueSq ) { this . stateInAttributeValueSingleQuotes ( c ) ; } else if ( this . state === State . BeforeAttributeValue ) { this . stateBeforeAttributeValue ( c ) ; } else if ( this . state === State . BeforeClosingTagName ) { this . stateBeforeClosingTagName ( c ) ; } else if ( this . state === State . AfterClosingTagName ) { this . stateAfterClosingTagName ( c ) ; } else if ( this . state === State . BeforeSpecialS ) { this . stateBeforeSpecialS ( c ) ; } else if ( this . state === State . InAttributeValueNq ) { this . stateInAttributeValueNoQuotes ( c ) ; } else if ( this . state === State . InSelfClosingTag ) { this . stateInSelfClosingTag ( c ) ; } else if ( this . state === State . InDeclaration ) { this . stateInDeclaration ( c ) ; } else if ( this . state === State . BeforeDeclaration ) { this . stateBeforeDeclaration ( c ) ; } else if ( this . state === State . BeforeComment ) { this . stateBeforeComment ( c ) ; } else if ( this . state === State . InProcessingInstruction ) { this . stateInProcessingInstruction ( c ) ; } else if ( this . state === State . InNamedEntity ) { this . stateInNamedEntity ( c ) ; } else if ( this . state === State . BeforeEntity ) { this . stateBeforeEntity ( c ) ; } else if ( this . state === State . InHexEntity ) { this . stateInHexEntity ( c ) ; } else if ( this . state === State . InNumericEntity ) { this . stateInNumericEntity ( c ) ; } else { this . stateBeforeNumericEntity ( c ) ; } this . index ++ ; } this . cleanup ( ) ; }
Iterates through the buffer, calling the function corresponding to the current state.
Iterates through the buffer calling the function corresponding to the current state .
// `this._state === State.BeforeNumericEntity`