@@ -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.
@@ -1363,7 +1363,7 @@ impl Spanned for Expr {
1363
1363
. union_opt ( & overlay_for. as_ref ( ) . map ( |i| i. span ( ) ) ) ,
1364
1364
Expr :: Collate { expr, collation } => expr
1365
1365
. span ( )
1366
- . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ) ) ) ,
1366
+ . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ( ) ) ) ) ,
1367
1367
Expr :: Nested ( expr) => expr. span ( ) ,
1368
1368
Expr :: Value ( value) => value. span ( ) ,
1369
1369
Expr :: TypedString { .. } => Span :: empty ( ) ,
@@ -1467,7 +1467,7 @@ impl Spanned for Expr {
1467
1467
object_name
1468
1468
. 0
1469
1469
. iter ( )
1470
- . map ( |i| i. span )
1470
+ . map ( |i| i. span ( ) )
1471
1471
. chain ( iter:: once ( token. 0 . span ) ) ,
1472
1472
) ,
1473
1473
Expr :: OuterJoin ( expr) => expr. span ( ) ,
@@ -1512,7 +1512,15 @@ impl Spanned for ObjectName {
1512
1512
fn span ( & self ) -> Span {
1513
1513
let ObjectName ( segments) = self ;
1514
1514
1515
- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
1515
+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
1516
+ }
1517
+ }
1518
+
1519
+ impl Spanned for ObjectNamePart {
1520
+ fn span ( & self ) -> Span {
1521
+ match self {
1522
+ ObjectNamePart :: Identifier ( ident) => ident. span ,
1523
+ }
1516
1524
}
1517
1525
}
1518
1526
@@ -1543,7 +1551,7 @@ impl Spanned for Function {
1543
1551
union_spans (
1544
1552
name. 0
1545
1553
. iter ( )
1546
- . map ( |i| i. span )
1554
+ . map ( |i| i. span ( ) )
1547
1555
. chain ( iter:: once ( args. span ( ) ) )
1548
1556
. chain ( iter:: once ( parameters. span ( ) ) )
1549
1557
. chain ( filter. iter ( ) . map ( |i| i. span ( ) ) )
@@ -1629,7 +1637,7 @@ impl Spanned for SelectItem {
1629
1637
object_name
1630
1638
. 0
1631
1639
. iter ( )
1632
- . map ( |i| i. span )
1640
+ . map ( |i| i. span ( ) )
1633
1641
. chain ( iter:: once ( wildcard_additional_options. span ( ) ) ) ,
1634
1642
) ,
1635
1643
SelectItem :: Wildcard ( wildcard_additional_options) => wildcard_additional_options. span ( ) ,
@@ -1739,7 +1747,7 @@ impl Spanned for TableFactor {
1739
1747
} => union_spans (
1740
1748
name. 0
1741
1749
. iter ( )
1742
- . map ( |i| i. span )
1750
+ . map ( |i| i. span ( ) )
1743
1751
. chain ( alias. as_ref ( ) . map ( |alias| {
1744
1752
union_spans (
1745
1753
iter:: once ( alias. name . span )
@@ -1784,7 +1792,7 @@ impl Spanned for TableFactor {
1784
1792
} => union_spans (
1785
1793
name. 0
1786
1794
. iter ( )
1787
- . map ( |i| i. span )
1795
+ . map ( |i| i. span ( ) )
1788
1796
. chain ( args. iter ( ) . map ( |i| i. span ( ) ) )
1789
1797
. chain ( alias. as_ref ( ) . map ( |alias| alias. span ( ) ) ) ,
1790
1798
) ,
@@ -1935,7 +1943,7 @@ impl Spanned for FunctionArgExpr {
1935
1943
match self {
1936
1944
FunctionArgExpr :: Expr ( expr) => expr. span ( ) ,
1937
1945
FunctionArgExpr :: QualifiedWildcard ( object_name) => {
1938
- union_spans ( object_name. 0 . iter ( ) . map ( |i| i. span ) )
1946
+ union_spans ( object_name. 0 . iter ( ) . map ( |i| i. span ( ) ) )
1939
1947
}
1940
1948
FunctionArgExpr :: Wildcard => Span :: empty ( ) ,
1941
1949
}
@@ -2146,7 +2154,7 @@ impl Spanned for TableObject {
2146
2154
fn span ( & self ) -> Span {
2147
2155
match self {
2148
2156
TableObject :: TableName ( ObjectName ( segments) ) => {
2149
- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
2157
+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
2150
2158
}
2151
2159
TableObject :: TableFunction ( func) => func. span ( ) ,
2152
2160
}
0 commit comments