private static bool IsToken(Token token, string value, TokenType type) { if (token == null) return false; if (token.TokenType != type) return false; if (type == TokenType.Name) return token.Value.Equals(value, StringComparison.InvariantCultureIgnoreCase); return token.Value.Equals(value); }
private static bool IsName(Token token, string value) { return IsToken(token, value, TokenType.Name); }