Skip to content

Commit 20d842f

Browse files
committed
fix(spans): remove unrelated PARTITION OF changes from spans.rs
1 parent 187eae9 commit 20d842f

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

src/ast/spans.rs

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -600,31 +600,6 @@ impl Spanned for CreateTable {
600600
}
601601
}
602602

603-
impl Spanned for PartitionBoundValue {
604-
fn span(&self) -> Span {
605-
match self {
606-
PartitionBoundValue::Expr(expr) => expr.span(),
607-
PartitionBoundValue::MinValue => Span::empty(),
608-
PartitionBoundValue::MaxValue => Span::empty(),
609-
}
610-
}
611-
}
612-
613-
impl Spanned for ForValues {
614-
fn span(&self) -> Span {
615-
match self {
616-
ForValues::In(exprs) => union_spans(exprs.iter().map(|e| e.span())),
617-
ForValues::From { from, to } => union_spans(
618-
from.iter()
619-
.map(|v| v.span())
620-
.chain(to.iter().map(|v| v.span())),
621-
),
622-
ForValues::With { .. } => Span::empty(),
623-
ForValues::Default => Span::empty(),
624-
}
625-
}
626-
}
627-
628603
impl Spanned for ColumnDef {
629604
fn span(&self) -> Span {
630605
let ColumnDef {
@@ -660,6 +635,33 @@ impl Spanned for TableConstraint {
660635
}
661636
}
662637

638+
impl Spanned for PartitionBoundValue {
639+
fn span(&self) -> Span {
640+
match self {
641+
PartitionBoundValue::Expr(expr) => expr.span(),
642+
// MINVALUE and MAXVALUE are keywords without tracked spans
643+
PartitionBoundValue::MinValue => Span::empty(),
644+
PartitionBoundValue::MaxValue => Span::empty(),
645+
}
646+
}
647+
}
648+
649+
impl Spanned for ForValues {
650+
fn span(&self) -> Span {
651+
match self {
652+
ForValues::In(exprs) => union_spans(exprs.iter().map(|e| e.span())),
653+
ForValues::From { from, to } => union_spans(
654+
from.iter()
655+
.map(|v| v.span())
656+
.chain(to.iter().map(|v| v.span())),
657+
),
658+
// WITH (MODULUS n, REMAINDER r) - u64 values have no spans
659+
ForValues::With { .. } => Span::empty(),
660+
ForValues::Default => Span::empty(),
661+
}
662+
}
663+
}
664+
663665
impl Spanned for CreateIndex {
664666
fn span(&self) -> Span {
665667
let CreateIndex {

0 commit comments

Comments
 (0)