@@ -2293,7 +2293,7 @@ impl<'a> Parser<'a> {
22932293
22942294 // Snowflake permits a subquery to be passed as an argument without
22952295 // an enclosing set of parens if it's the only argument.
2296- if dialect_of!( self is SnowflakeDialect ) && self.peek_sub_query() {
2296+ if self.dialect.supports_subquery_as_function_arg( ) && self.peek_sub_query() {
22972297 let subquery = self.parse_query()?;
22982298 self.expect_token(&Token::RParen)?;
22992299 return Ok(Function {
@@ -2683,8 +2683,7 @@ impl<'a> Parser<'a> {
26832683
26842684 let syntax = if self.parse_keyword(Keyword::FROM) {
26852685 ExtractSyntax::From
2686- } else if self.consume_token(&Token::Comma)
2687- && dialect_of!(self is SnowflakeDialect | GenericDialect)
2686+ } else if self.dialect.supports_extract_comma_syntax() && self.consume_token(&Token::Comma)
26882687 {
26892688 ExtractSyntax::Comma
26902689 } else {
@@ -6259,7 +6258,7 @@ impl<'a> Parser<'a> {
62596258 None
62606259 };
62616260
6262- let comment = if dialect_of!( self is SnowflakeDialect | GenericDialect )
6261+ let comment = if self.dialect.supports_create_view_comment_syntax( )
62636262 && self.parse_keyword(Keyword::COMMENT)
62646263 {
62656264 self.expect_token(&Token::Eq)?;
@@ -11821,7 +11820,7 @@ impl<'a> Parser<'a> {
1182111820 Keyword::ENUM16 => Ok(DataType::Enum(self.parse_enum_values()?, Some(16))),
1182211821 Keyword::SET => Ok(DataType::Set(self.parse_string_values()?)),
1182311822 Keyword::ARRAY => {
11824- if dialect_of!( self is SnowflakeDialect ) {
11823+ if self.dialect.supports_array_typedef_without_element_type( ) {
1182511824 Ok(DataType::Array(ArrayElemTypeDef::None))
1182611825 } else if dialect_of!(self is ClickHouseDialect) {
1182711826 Ok(self.parse_sub_type(|internal_type| {
@@ -15020,7 +15019,7 @@ impl<'a> Parser<'a> {
1502015019 table_with_joins: Box::new(table_and_joins),
1502115020 alias,
1502215021 })
15023- } else if dialect_of!( self is SnowflakeDialect | GenericDialect ) {
15022+ } else if self.dialect.supports_parens_around_table_factor( ) {
1502415023 // Dialect-specific behavior: Snowflake diverges from the
1502515024 // standard and from most of the other implementations by
1502615025 // allowing extra parentheses not only around a join (B), but
@@ -15067,7 +15066,7 @@ impl<'a> Parser<'a> {
1506715066 // appearing alone in parentheses (e.g. `FROM (mytable)`)
1506815067 self.expected("joined table", self.peek_token())
1506915068 }
15070- } else if dialect_of!( self is SnowflakeDialect | DatabricksDialect | GenericDialect )
15069+ } else if self.dialect.supports_values_as_table_factor( )
1507115070 && matches!(
1507215071 self.peek_tokens(),
1507315072 [
0 commit comments