@@ -28,13 +28,13 @@ use super::{
2828 FunctionArg , FunctionArgExpr , FunctionArgumentClause , FunctionArgumentList , FunctionArguments ,
2929 GroupByExpr , HavingBound , IlikeSelectItem , Insert , Interpolate , InterpolateExpr , Join ,
3030 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 ,
3838} ;
3939
4040/// Given an iterator of spans, return the [Span::union] of all spans.
@@ -1363,7 +1363,7 @@ impl Spanned for Expr {
13631363 . union_opt ( & overlay_for. as_ref ( ) . map ( |i| i. span ( ) ) ) ,
13641364 Expr :: Collate { expr, collation } => expr
13651365 . span ( )
1366- . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ) ) ) ,
1366+ . union ( & union_spans ( collation. 0 . iter ( ) . map ( |i| i. span ( ) ) ) ) ,
13671367 Expr :: Nested ( expr) => expr. span ( ) ,
13681368 Expr :: Value ( value) => value. span ( ) ,
13691369 Expr :: TypedString { .. } => Span :: empty ( ) ,
@@ -1467,7 +1467,7 @@ impl Spanned for Expr {
14671467 object_name
14681468 . 0
14691469 . iter ( )
1470- . map ( |i| i. span )
1470+ . map ( |i| i. span ( ) )
14711471 . chain ( iter:: once ( token. 0 . span ) ) ,
14721472 ) ,
14731473 Expr :: OuterJoin ( expr) => expr. span ( ) ,
@@ -1512,7 +1512,15 @@ impl Spanned for ObjectName {
15121512 fn span ( & self ) -> Span {
15131513 let ObjectName ( segments) = self ;
15141514
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+ }
15161524 }
15171525}
15181526
@@ -1543,7 +1551,7 @@ impl Spanned for Function {
15431551 union_spans (
15441552 name. 0
15451553 . iter ( )
1546- . map ( |i| i. span )
1554+ . map ( |i| i. span ( ) )
15471555 . chain ( iter:: once ( args. span ( ) ) )
15481556 . chain ( iter:: once ( parameters. span ( ) ) )
15491557 . chain ( filter. iter ( ) . map ( |i| i. span ( ) ) )
@@ -1629,7 +1637,7 @@ impl Spanned for SelectItem {
16291637 object_name
16301638 . 0
16311639 . iter ( )
1632- . map ( |i| i. span )
1640+ . map ( |i| i. span ( ) )
16331641 . chain ( iter:: once ( wildcard_additional_options. span ( ) ) ) ,
16341642 ) ,
16351643 SelectItem :: Wildcard ( wildcard_additional_options) => wildcard_additional_options. span ( ) ,
@@ -1739,7 +1747,7 @@ impl Spanned for TableFactor {
17391747 } => union_spans (
17401748 name. 0
17411749 . iter ( )
1742- . map ( |i| i. span )
1750+ . map ( |i| i. span ( ) )
17431751 . chain ( alias. as_ref ( ) . map ( |alias| {
17441752 union_spans (
17451753 iter:: once ( alias. name . span )
@@ -1784,7 +1792,7 @@ impl Spanned for TableFactor {
17841792 } => union_spans (
17851793 name. 0
17861794 . iter ( )
1787- . map ( |i| i. span )
1795+ . map ( |i| i. span ( ) )
17881796 . chain ( args. iter ( ) . map ( |i| i. span ( ) ) )
17891797 . chain ( alias. as_ref ( ) . map ( |alias| alias. span ( ) ) ) ,
17901798 ) ,
@@ -1935,7 +1943,7 @@ impl Spanned for FunctionArgExpr {
19351943 match self {
19361944 FunctionArgExpr :: Expr ( expr) => expr. span ( ) ,
19371945 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 ( ) ) )
19391947 }
19401948 FunctionArgExpr :: Wildcard => Span :: empty ( ) ,
19411949 }
@@ -2146,7 +2154,7 @@ impl Spanned for TableObject {
21462154 fn span ( & self ) -> Span {
21472155 match self {
21482156 TableObject :: TableName ( ObjectName ( segments) ) => {
2149- union_spans ( segments. iter ( ) . map ( |i| i. span ) )
2157+ union_spans ( segments. iter ( ) . map ( |i| i. span ( ) ) )
21502158 }
21512159 TableObject :: TableFunction ( func) => func. span ( ) ,
21522160 }
0 commit comments