Fix CASE expression spans (#1874)

This commit is contained in:
Elia Perantoni 2025-06-06 16:06:33 +02:00 committed by GitHub
parent e2b1ae36e9
commit ff29dd25b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 43 additions and 9 deletions

View file

@ -967,6 +967,8 @@ pub enum Expr {
/// not `< 0` nor `1, 2, 3` as allowed in a `<simple when clause>` per
/// <https://jakewheat.github.io/sql-overview/sql-2011-foundation-grammar.html#simple-when-clause>
Case {
case_token: AttachedToken,
end_token: AttachedToken,
operand: Option<Box<Expr>>,
conditions: Vec<CaseWhen>,
else_result: Option<Box<Expr>>,
@ -1675,6 +1677,8 @@ impl fmt::Display for Expr {
}
Expr::Function(fun) => fun.fmt(f),
Expr::Case {
case_token: _,
end_token: _,
operand,
conditions,
else_result,