@@ -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 {
@@ -6228,7 +6227,7 @@ impl<'a> Parser<'a> {
62286227 None
62296228 };
62306229
6231- let comment = if dialect_of!( self is SnowflakeDialect | GenericDialect )
6230+ let comment = if self.dialect.supports_create_view_comment_syntax( )
62326231 && self.parse_keyword(Keyword::COMMENT)
62336232 {
62346233 self.expect_token(&Token::Eq)?;
@@ -11790,7 +11789,7 @@ impl<'a> Parser<'a> {
1179011789 Keyword::ENUM16 => Ok(DataType::Enum(self.parse_enum_values()?, Some(16))),
1179111790 Keyword::SET => Ok(DataType::Set(self.parse_string_values()?)),
1179211791 Keyword::ARRAY => {
11793- if dialect_of!( self is SnowflakeDialect ) {
11792+ if self.dialect.supports_array_typedef_without_element_type( ) {
1179411793 Ok(DataType::Array(ArrayElemTypeDef::None))
1179511794 } else if dialect_of!(self is ClickHouseDialect) {
1179611795 Ok(self.parse_sub_type(|internal_type| {
@@ -14989,7 +14988,7 @@ impl<'a> Parser<'a> {
1498914988 table_with_joins: Box::new(table_and_joins),
1499014989 alias,
1499114990 })
14992- } else if dialect_of!( self is SnowflakeDialect | GenericDialect ) {
14991+ } else if self.dialect.supports_parens_around_table_factor( ) {
1499314992 // Dialect-specific behavior: Snowflake diverges from the
1499414993 // standard and from most of the other implementations by
1499514994 // allowing extra parentheses not only around a join (B), but
@@ -15035,7 +15034,7 @@ impl<'a> Parser<'a> {
1503515034 // appearing alone in parentheses (e.g. `FROM (mytable)`)
1503615035 self.expected("joined table", self.peek_token())
1503715036 }
15038- } else if dialect_of!( self is SnowflakeDialect | DatabricksDialect | GenericDialect )
15037+ } else if self.dialect.supports_values_as_table_factor( )
1503915038 && matches!(
1504015039 self.peek_tokens(),
1504115040 [
0 commit comments