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); }
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; }