HtmlLexicalAnalyzer.SkipWhiteSpace C# (CSharp) Метод

SkipWhiteSpace() приватный Метод

skips whitespace in the input string leaves the first non-whitespace character available in the NextCharacter property this may be the end-of-file character, it performs no checking
private SkipWhiteSpace ( ) : void
Результат void
    private void SkipWhiteSpace()
    {
        // TODO: handle character entities while processing comments, cdata, and directives
        // TODO: SUGGESTION: we could check if lookahead and previous characters are entities also
        while (true)
        {
            if (_nextCharacter == '<' && (_lookAheadCharacter == '?' || _lookAheadCharacter == '!'))
            {
                this.GetNextCharacter();

                if (_lookAheadCharacter == '[')
                {
                    // Skip CDATA block and DTDs(?)
                    while (!this.IsAtEndOfStream && !(_previousCharacter == ']' && _nextCharacter == ']' && _lookAheadCharacter == '>'))
                    {
                        this.GetNextCharacter();
                    }
                    if (_nextCharacter == '>')
                    {
                        this.GetNextCharacter();
                    }
                }
                else
                {
                    // Skip processing instruction, comments
                    while (!this.IsAtEndOfStream && _nextCharacter != '>')
                    {
                        this.GetNextCharacter();
                    }
                    if (_nextCharacter == '>')
                    {
                        this.GetNextCharacter();
                    }
                }
            }

            if (!Char.IsWhiteSpace(this.NextCharacter))
            {
                break;
            }

            this.GetNextCharacter();
        }
    }