Microsoft.VisualStudio.Language.Spellchecker.LineProgress.NextNextChar C# (CSharp) Method

NextNextChar() public method

public NextNextChar ( ) : char
return char
        public char NextNextChar()
        {
            return _linePosition < _snapshotLine.Length - 2 ?
                _lineText[_linePosition + 2] :
                (char)0;
        }

Usage Example

Example #1
0
        private void ScanDefault(LineProgress p)
        {
            while (!p.EndOfLine)
            {
                if (p.Char() == '/' && p.NextChar() == '/' && p.NextNextChar() == '/') // doc comment.
                {
                    p.Advance(3);
                    p.State = State.DocComment;
                    ScanDocComment(p);
                }
                else if (p.Char() == '/' && p.NextChar() == '/') // single line comment
                {
                    p.Advance(2);
                    p.StartNaturalText();
                    p.AdvanceToEndOfLine();
                    p.EndNaturalText();

                    p.State = State.Default;
                    return;
                }
                else if (p.Char() == '/' && p.NextChar() == '*') // multi-line comment
                {
                    p.Advance(2);
                    p.State = State.MultiLineComment;
                    ScanMultiLineComment(p);
                }
                else if (p.Char() == '@' && p.NextChar() == '"') // multi-line string
                {
                    p.Advance(2);
                    p.State = State.MultiLineString;
                    ScanMultiLineString(p);
                }
                else if (p.Char() == '"') // single-line string
                {
                    p.Advance(1);
                    p.State = State.String;
                    ScanString(p);
                }
                else if (p.Char() == '\'') // character literal
                {
                    p.Advance(1);
                    p.State = State.Character;
                    ScanCharacter(p);
                }
                else
                {
                    p.Advance();
                }
            }
        }