@@ -28,13 +28,13 @@ use super::{
28
28
FunctionArg , FunctionArgExpr , FunctionArgumentClause , FunctionArgumentList , FunctionArguments ,
29
29
GroupByExpr , HavingBound , IlikeSelectItem , Insert , Interpolate , InterpolateExpr , Join ,
30
30
JoinConstraint , JoinOperator , JsonPath , JsonPathElem , LateralView , MatchRecognizePattern ,
31
- Measure , NamedWindowDefinition , ObjectName , Offset , OnConflict , OnConflictAction , OnInsert ,
32
- OrderBy , OrderByExpr , Partition , PivotValueSource , ProjectionSelect , Query , ReferentialAction ,
33
- RenameSelectItem , ReplaceSelectElement , ReplaceSelectItem , Select , SelectInto , SelectItem ,
34
- SetExpr , SqlOption , Statement , Subscript , SymbolDefinition , TableAlias , TableAliasColumnDef ,
35
- TableConstraint , TableFactor , TableObject , TableOptionsClustered , TableWithJoins ,
36
- UpdateTableFromKind , Use , Value , Values , ViewColumnDef , WildcardAdditionalOptions , With ,
37
- WithFill ,
31
+ Measure , NamedWindowDefinition , ObjectName , ObjectNamePart , Offset , OnConflict ,
32
+ OnConflictAction , OnInsert , OrderBy , OrderByExpr , Partition , PivotValueSource ,
33
+ ProjectionSelect , Query , ReferentialAction , RenameSelectItem , ReplaceSelectElement ,
34
+ ReplaceSelectItem , Select , SelectInto , SelectItem , SetExpr , SqlOption , Statement , Subscript ,
35
+ SymbolDefinition , TableAlias , TableAliasColumnDef , TableConstraint , TableFactor , TableObject ,
36
+ TableOptionsClustered , TableWithJoins , UpdateTableFromKind , Use , Value , Values , ViewColumnDef ,
37
+ WildcardAdditionalOptions , With , WithFill ,
38
38
} ;
39
39
40
40
/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -1358,7 +1358,7 @@ impl Spanned for Expr {
1358
1358
. union_opt ( & overlay_for. as_ref ( ) . map ( |i| i. span ( ) ) ) ,
1359
1359
Expr :: Collate { expr, collation } => expr
1360
1360
. span ( )
1361
- . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ) ) ) ,
1361
+ . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ( ) ) ) ) ,
1362
1362
Expr :: Nested ( expr) => expr. span ( ) ,
1363
1363
Expr :: Value ( value) => value. span ( ) ,
1364
1364
Expr :: TypedString { .. } => Span :: empty ( ) ,
@@ -1462,7 +1462,7 @@ impl Spanned for Expr {
1462
1462
object_name
1463
1463
. 0
1464
1464
. iter ( )
1465
- . map ( |i| i. span )
1465
+ . map ( |i| i. span ( ) )
1466
1466
. chain ( iter:: once ( token. 0 . span ) ) ,
1467
1467
) ,
1468
1468
Expr :: OuterJoin ( expr) => expr. span ( ) ,
@@ -1507,7 +1507,15 @@ impl Spanned for ObjectName {
1507
1507
fn span ( & self ) -> Span {
1508
1508
let ObjectName ( segments) = self ;
1509
1509
1510
- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
1510
+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
1511
+ }
1512
+ }
1513
+
1514
+ impl Spanned for ObjectNamePart {
1515
+ fn span ( & self ) -> Span {
1516
+ match self {
1517
+ ObjectNamePart :: Identifier ( ident) => ident. span ,
1518
+ }
1511
1519
}
1512
1520
}
1513
1521
@@ -1538,7 +1546,7 @@ impl Spanned for Function {
1538
1546
union_spans (
1539
1547
name. 0
1540
1548
. iter ( )
1541
- . map ( |i| i. span )
1549
+ . map ( |i| i. span ( ) )
1542
1550
. chain ( iter:: once ( args. span ( ) ) )
1543
1551
. chain ( iter:: once ( parameters. span ( ) ) )
1544
1552
. chain ( filter. iter ( ) . map ( |i| i. span ( ) ) )
@@ -1624,7 +1632,7 @@ impl Spanned for SelectItem {
1624
1632
object_name
1625
1633
. 0
1626
1634
. iter ( )
1627
- . map ( |i| i. span )
1635
+ . map ( |i| i. span ( ) )
1628
1636
. chain ( iter:: once ( wildcard_additional_options. span ( ) ) ) ,
1629
1637
) ,
1630
1638
SelectItem :: Wildcard ( wildcard_additional_options) => wildcard_additional_options. span ( ) ,
@@ -1734,7 +1742,7 @@ impl Spanned for TableFactor {
1734
1742
} => union_spans (
1735
1743
name. 0
1736
1744
. iter ( )
1737
- . map ( |i| i. span )
1745
+ . map ( |i| i. span ( ) )
1738
1746
. chain ( alias. as_ref ( ) . map ( |alias| {
1739
1747
union_spans (
1740
1748
iter:: once ( alias. name . span )
@@ -1779,7 +1787,7 @@ impl Spanned for TableFactor {
1779
1787
} => union_spans (
1780
1788
name. 0
1781
1789
. iter ( )
1782
- . map ( |i| i. span )
1790
+ . map ( |i| i. span ( ) )
1783
1791
. chain ( args. iter ( ) . map ( |i| i. span ( ) ) )
1784
1792
. chain ( alias. as_ref ( ) . map ( |alias| alias. span ( ) ) ) ,
1785
1793
) ,
@@ -1930,7 +1938,7 @@ impl Spanned for FunctionArgExpr {
1930
1938
match self {
1931
1939
FunctionArgExpr :: Expr ( expr) => expr. span ( ) ,
1932
1940
FunctionArgExpr :: QualifiedWildcard ( object_name) => {
1933
- union_spans ( object_name. 0 . iter ( ) . map ( |i| i. span ) )
1941
+ union_spans ( object_name. 0 . iter ( ) . map ( |i| i. span ( ) ) )
1934
1942
}
1935
1943
FunctionArgExpr :: Wildcard => Span :: empty ( ) ,
1936
1944
}
@@ -2141,7 +2149,7 @@ impl Spanned for TableObject {
2141
2149
fn span ( & self ) -> Span {
2142
2150
match self {
2143
2151
TableObject :: TableName ( ObjectName ( segments) ) => {
2144
- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
2152
+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
2145
2153
}
2146
2154
TableObject :: TableFunction ( func) => func. span ( ) ,
2147
2155
}
0 commit comments