예제 #1
0
        private static bool IsNextTokenValid(IStatedTwoWayEnumerator <Token> enumerator, TokenType expectedTokenType)
        {
            if (!enumerator.MoveNext())
            {
                return(false);
            }

            if (enumerator.Current.Type == expectedTokenType)
            {
                return(true);
            }

            enumerator.MovePrevious();
            return(false);
        }
예제 #2
0
        private static bool IsNextTokenValid(IStatedTwoWayEnumerator<Token> enumerator, TokenType expectedTokenType)
        {
            if (!enumerator.MoveNext())
                return false;

            if (enumerator.Current.Type == expectedTokenType)
                return true;

            enumerator.MovePrevious();
            return false;
        }