@@ -27,13 +27,13 @@ use super::{
2727 FunctionArg , FunctionArgExpr , FunctionArgumentClause , FunctionArgumentList , FunctionArguments ,
2828 GroupByExpr , HavingBound , IlikeSelectItem , Insert , Interpolate , InterpolateExpr , Join ,
2929 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 ,
3737} ;
3838
3939/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -1385,7 +1385,7 @@ impl Spanned for Expr {
13851385 . union_opt ( & overlay_for. as_ref ( ) . map ( |i| i. span ( ) ) ) ,
13861386 Expr :: Collate { expr, collation } => expr
13871387 . span ( )
1388- . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ) ) ) ,
1388+ . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ( ) ) ) ) ,
13891389 Expr :: Nested ( expr) => expr. span ( ) ,
13901390 Expr :: Value ( value) => value. span ( ) ,
13911391 Expr :: TypedString { .. } => Span :: empty ( ) ,
@@ -1489,7 +1489,7 @@ impl Spanned for Expr {
14891489 object_name
14901490 . 0
14911491 . iter ( )
1492- . map ( |i| i. span )
1492+ . map ( |i| i. span ( ) )
14931493 . chain ( iter:: once ( token. 0 . span ) ) ,
14941494 ) ,
14951495 Expr :: OuterJoin ( expr) => expr. span ( ) ,
@@ -1534,7 +1534,15 @@ impl Spanned for ObjectName {
15341534 fn span ( & self ) -> Span {
15351535 let ObjectName ( segments) = self ;
15361536
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+ }
15381546 }
15391547}
15401548
@@ -1565,7 +1573,7 @@ impl Spanned for Function {
15651573 union_spans (
15661574 name. 0
15671575 . iter ( )
1568- . map ( |i| i. span )
1576+ . map ( |i| i. span ( ) )
15691577 . chain ( iter:: once ( args. span ( ) ) )
15701578 . chain ( iter:: once ( parameters. span ( ) ) )
15711579 . chain ( filter. iter ( ) . map ( |i| i. span ( ) ) )
@@ -1651,7 +1659,7 @@ impl Spanned for SelectItem {
16511659 object_name
16521660 . 0
16531661 . iter ( )
1654- . map ( |i| i. span )
1662+ . map ( |i| i. span ( ) )
16551663 . chain ( iter:: once ( wildcard_additional_options. span ( ) ) ) ,
16561664 ) ,
16571665 SelectItem :: Wildcard ( wildcard_additional_options) => wildcard_additional_options. span ( ) ,
@@ -1761,7 +1769,7 @@ impl Spanned for TableFactor {
17611769 } => union_spans (
17621770 name. 0
17631771 . iter ( )
1764- . map ( |i| i. span )
1772+ . map ( |i| i. span ( ) )
17651773 . chain ( alias. as_ref ( ) . map ( |alias| {
17661774 union_spans (
17671775 iter:: once ( alias. name . span )
@@ -1806,7 +1814,7 @@ impl Spanned for TableFactor {
18061814 } => union_spans (
18071815 name. 0
18081816 . iter ( )
1809- . map ( |i| i. span )
1817+ . map ( |i| i. span ( ) )
18101818 . chain ( args. iter ( ) . map ( |i| i. span ( ) ) )
18111819 . chain ( alias. as_ref ( ) . map ( |alias| alias. span ( ) ) ) ,
18121820 ) ,
@@ -1957,7 +1965,7 @@ impl Spanned for FunctionArgExpr {
19571965 match self {
19581966 FunctionArgExpr :: Expr ( expr) => expr. span ( ) ,
19591967 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 ( ) ) )
19611969 }
19621970 FunctionArgExpr :: Wildcard => Span :: empty ( ) ,
19631971 }
@@ -2168,7 +2176,7 @@ impl Spanned for TableObject {
21682176 fn span ( & self ) -> Span {
21692177 match self {
21702178 TableObject :: TableName ( ObjectName ( segments) ) => {
2171- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
2179+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
21722180 }
21732181 TableObject :: TableFunction ( func) => func. span ( ) ,
21742182 }
0 commit comments