@@ -27,13 +27,13 @@ use super::{
27
27
FunctionArg , FunctionArgExpr , FunctionArgumentClause , FunctionArgumentList , FunctionArguments ,
28
28
GroupByExpr , HavingBound , IlikeSelectItem , Insert , Interpolate , InterpolateExpr , Join ,
29
29
JoinConstraint , JoinOperator , JsonPath , JsonPathElem , LateralView , MatchRecognizePattern ,
30
- Measure , NamedWindowDefinition , ObjectName , Offset , OnConflict , OnConflictAction , OnInsert ,
31
- OrderBy , OrderByExpr , Partition , PivotValueSource , ProjectionSelect , Query , ReferentialAction ,
32
- RenameSelectItem , ReplaceSelectElement , ReplaceSelectItem , Select , SelectInto , SelectItem ,
33
- SetExpr , SqlOption , Statement , Subscript , SymbolDefinition , TableAlias , TableAliasColumnDef ,
34
- TableConstraint , TableFactor , TableObject , TableOptionsClustered , TableWithJoins ,
35
- UpdateTableFromKind , Use , Value , Values , ViewColumnDef , WildcardAdditionalOptions , With ,
36
- WithFill ,
30
+ Measure , NamedWindowDefinition , ObjectName , ObjectNamePart , Offset , OnConflict ,
31
+ OnConflictAction , OnInsert , OrderBy , OrderByExpr , Partition , PivotValueSource ,
32
+ ProjectionSelect , Query , ReferentialAction , RenameSelectItem , ReplaceSelectElement ,
33
+ ReplaceSelectItem , Select , SelectInto , SelectItem , SetExpr , SqlOption , Statement , Subscript ,
34
+ SymbolDefinition , TableAlias , TableAliasColumnDef , TableConstraint , TableFactor , TableObject ,
35
+ TableOptionsClustered , TableWithJoins , UpdateTableFromKind , Use , Value , Values , ViewColumnDef ,
36
+ WildcardAdditionalOptions , With , WithFill ,
37
37
} ;
38
38
39
39
/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -1385,7 +1385,7 @@ impl Spanned for Expr {
1385
1385
. union_opt ( & overlay_for. as_ref ( ) . map ( |i| i. span ( ) ) ) ,
1386
1386
Expr :: Collate { expr, collation } => expr
1387
1387
. span ( )
1388
- . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ) ) ) ,
1388
+ . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ( ) ) ) ) ,
1389
1389
Expr :: Nested ( expr) => expr. span ( ) ,
1390
1390
Expr :: Value ( value) => value. span ( ) ,
1391
1391
Expr :: TypedString { .. } => Span :: empty ( ) ,
@@ -1489,7 +1489,7 @@ impl Spanned for Expr {
1489
1489
object_name
1490
1490
. 0
1491
1491
. iter ( )
1492
- . map ( |i| i. span )
1492
+ . map ( |i| i. span ( ) )
1493
1493
. chain ( iter:: once ( token. 0 . span ) ) ,
1494
1494
) ,
1495
1495
Expr :: OuterJoin ( expr) => expr. span ( ) ,
@@ -1534,7 +1534,15 @@ impl Spanned for ObjectName {
1534
1534
fn span ( & self ) -> Span {
1535
1535
let ObjectName ( segments) = self ;
1536
1536
1537
- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
1537
+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
1538
+ }
1539
+ }
1540
+
1541
+ impl Spanned for ObjectNamePart {
1542
+ fn span ( & self ) -> Span {
1543
+ match self {
1544
+ ObjectNamePart :: Identifier ( ident) => ident. span ,
1545
+ }
1538
1546
}
1539
1547
}
1540
1548
@@ -1565,7 +1573,7 @@ impl Spanned for Function {
1565
1573
union_spans (
1566
1574
name. 0
1567
1575
. iter ( )
1568
- . map ( |i| i. span )
1576
+ . map ( |i| i. span ( ) )
1569
1577
. chain ( iter:: once ( args. span ( ) ) )
1570
1578
. chain ( iter:: once ( parameters. span ( ) ) )
1571
1579
. chain ( filter. iter ( ) . map ( |i| i. span ( ) ) )
@@ -1651,7 +1659,7 @@ impl Spanned for SelectItem {
1651
1659
object_name
1652
1660
. 0
1653
1661
. iter ( )
1654
- . map ( |i| i. span )
1662
+ . map ( |i| i. span ( ) )
1655
1663
. chain ( iter:: once ( wildcard_additional_options. span ( ) ) ) ,
1656
1664
) ,
1657
1665
SelectItem :: Wildcard ( wildcard_additional_options) => wildcard_additional_options. span ( ) ,
@@ -1761,7 +1769,7 @@ impl Spanned for TableFactor {
1761
1769
} => union_spans (
1762
1770
name. 0
1763
1771
. iter ( )
1764
- . map ( |i| i. span )
1772
+ . map ( |i| i. span ( ) )
1765
1773
. chain ( alias. as_ref ( ) . map ( |alias| {
1766
1774
union_spans (
1767
1775
iter:: once ( alias. name . span )
@@ -1806,7 +1814,7 @@ impl Spanned for TableFactor {
1806
1814
} => union_spans (
1807
1815
name. 0
1808
1816
. iter ( )
1809
- . map ( |i| i. span )
1817
+ . map ( |i| i. span ( ) )
1810
1818
. chain ( args. iter ( ) . map ( |i| i. span ( ) ) )
1811
1819
. chain ( alias. as_ref ( ) . map ( |alias| alias. span ( ) ) ) ,
1812
1820
) ,
@@ -1957,7 +1965,7 @@ impl Spanned for FunctionArgExpr {
1957
1965
match self {
1958
1966
FunctionArgExpr :: Expr ( expr) => expr. span ( ) ,
1959
1967
FunctionArgExpr :: QualifiedWildcard ( object_name) => {
1960
- union_spans ( object_name. 0 . iter ( ) . map ( |i| i. span ) )
1968
+ union_spans ( object_name. 0 . iter ( ) . map ( |i| i. span ( ) ) )
1961
1969
}
1962
1970
FunctionArgExpr :: Wildcard => Span :: empty ( ) ,
1963
1971
}
@@ -2168,7 +2176,7 @@ impl Spanned for TableObject {
2168
2176
fn span ( & self ) -> Span {
2169
2177
match self {
2170
2178
TableObject :: TableName ( ObjectName ( segments) ) => {
2171
- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
2179
+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
2172
2180
}
2173
2181
TableObject :: TableFunction ( func) => func. span ( ) ,
2174
2182
}
0 commit comments