VBF.Compilers.Scanners.Scanner.PeekLexeme C# (CSharp) Method

PeekLexeme() private method

private PeekLexeme ( int lookAhead ) : Lexeme
lookAhead int
return Lexeme
        private Lexeme PeekLexeme(int lookAhead)
        {
            int currentCursor = m_valuableCursor;

            m_valuableCursor = m_valuableHistory.Count;
            while (currentCursor + lookAhead - 1 >= m_valuableHistory.Count)
            {
                //look ahead more
                Read();
            }
            int lookAheadFullIndex = m_valuableHistory[currentCursor + lookAhead - 1];
            Lexeme lookAheadLexeme = m_fullHistory[lookAheadFullIndex];

            m_valuableCursor = currentCursor;

            return lookAheadLexeme;
        }