Skip to content

Commit b0c789c

Browse files
committed
fix conflicts
1 parent 9aea2e8 commit b0c789c

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

src/parser/mod.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,28 +2811,6 @@ impl<'a> Parser<'a> {
28112811
op: UnaryOperator::PGPostfixFactorial,
28122812
expr: Box::new(expr),
28132813
})
2814-
} else if Token::ExclamationMark == tok && self.dialect.supports_bang_not_operator() {
2815-
let token = self.next_token();
2816-
match token.token {
2817-
Token::Word(_) | Token::Number(..)
2818-
if !matches!(
2819-
expr,
2820-
Expr::Value(_)
2821-
| Expr::Identifier(_)
2822-
| Expr::Nested(_)
2823-
| Expr::BinaryOp { .. }
2824-
) =>
2825-
{
2826-
Ok(Expr::UnaryOp {
2827-
op: UnaryOperator::BangNot,
2828-
expr: Box::new(expr),
2829-
})
2830-
}
2831-
_ => parser_err!(
2832-
"current dialect support bang not operator, but with wrong syntax",
2833-
tok.location
2834-
),
2835-
}
28362814
} else if Token::LBracket == tok {
28372815
if dialect_of!(self is PostgreSqlDialect | DuckDbDialect | GenericDialect) {
28382816
self.parse_subscript(expr)

tests/sqlparser_common.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11431,9 +11431,7 @@ fn parse_bang_not() {
1143111431
for &sql in &sql_statements {
1143211432
assert_eq!(
1143311433
dialects.parse_sql_statements(sql).unwrap_err(),
11434-
ParserError::ParserError(
11435-
"current dialect support bang not operator, but with wrong syntax".to_string()
11436-
)
11434+
ParserError::ParserError("No infix parser for token ExclamationMark".to_string())
1143711435
);
1143811436
}
1143911437

@@ -11487,7 +11485,7 @@ fn parse_factorial_operator() {
1148711485

1148811486
// Due to the exclamation mark, which is both part of the `bang not` operator
1148911487
// and the `factorial` operator, additional filtering not supports
11490-
// `bang not` operator is required here.
11488+
// `bang not` operator is required here.
1149111489
let dialects =
1149211490
all_dialects_where(|d| !d.supports_factorial_operator() && !d.supports_bang_not_operator());
1149311491

@@ -11500,16 +11498,14 @@ fn parse_factorial_operator() {
1150011498

1150111499
// Due to the exclamation mark, which is both part of the `bang not` operator
1150211500
// and the `factorial` operator, additional filtering supports
11503-
// `bang not` operator is required here.
11501+
// `bang not` operator is required here.
1150411502
let dialects =
1150511503
all_dialects_where(|d| !d.supports_factorial_operator() && d.supports_bang_not_operator());
1150611504

1150711505
for &sql in &sql_statements {
1150811506
assert_eq!(
1150911507
dialects.parse_sql_statements(sql).unwrap_err(),
11510-
ParserError::ParserError(
11511-
"current dialect support bang not operator, but with wrong syntax".to_string()
11512-
)
11508+
ParserError::ParserError("No infix parser for token ExclamationMark".to_string())
1151311509
);
1151411510
}
1151511511
}

0 commit comments

Comments
 (0)