@@ -439,11 +439,13 @@ fn test_node() {
439439            name:  KdlIdentifier  { 
440440                value:  "foo" . into( ) , 
441441                repr:  Some ( "foo" . into( ) ) , 
442+                 #[ cfg( feature = "span" ) ] 
442443                span:  ( 0 ..3 ) . into( ) 
443444            } , 
444445            entries:  vec![ ] , 
445446            children:  None , 
446447            format:  Some ( Default :: default ( ) ) , 
448+             #[ cfg( feature = "span" ) ] 
447449            span:  ( 0 ..7 ) . into( ) 
448450        } 
449451    ) ; 
@@ -455,6 +457,7 @@ fn test_node() {
455457            name:  KdlIdentifier  { 
456458                value:  "foo" . into( ) , 
457459                repr:  Some ( "foo" . into( ) ) , 
460+                 #[ cfg( feature = "span" ) ] 
458461                span:  ( 0 ..3 ) . into( ) 
459462            } , 
460463            entries:  vec![ KdlEntry  { 
@@ -466,12 +469,14 @@ fn test_node() {
466469                    leading:  " " . into( ) , 
467470                    ..Default :: default ( ) 
468471                } ) , 
472+                 #[ cfg( feature = "span" ) ] 
469473                span:  SourceSpan :: new( 3 . into( ) ,  4 ) 
470474            } ] , 
471475            children:  None , 
472476            format:  Some ( KdlNodeFormat  { 
473477                ..Default :: default ( ) 
474478            } ) , 
479+             #[ cfg( feature = "span" ) ] 
475480            span:  ( 0 ..8 ) . into( ) 
476481        } 
477482    ) ; 
@@ -552,7 +557,6 @@ fn node_entry(input: &mut Input<'_>) -> PResult<Option<KdlEntry>> {
552557                fmt. after_key  = after_key. into ( ) ; 
553558                fmt. after_eq  = after_eq. into ( ) ; 
554559            } 
555-             #[ cfg( feature = "span" ) ]  
556560            value
557561        } ) 
558562    }  else  if  let  Some ( ident)  = maybe_ident { 
@@ -607,6 +611,7 @@ fn entry_test() {
607611                value_repr:  "bar" . into( ) , 
608612                ..Default :: default ( ) 
609613            } ) , 
614+             #[ cfg( feature = "span" ) ] 
610615            span:  ( 0 ..7 ) . into( ) 
611616        } ) 
612617    ) ; 
@@ -621,6 +626,7 @@ fn entry_test() {
621626                value_repr:  "foo" . into( ) , 
622627                ..Default :: default ( ) 
623628            } ) , 
629+             #[ cfg( feature = "span" ) ] 
624630            span:  ( 0 ..3 ) . into( ) 
625631        } ) 
626632    ) ; 
@@ -636,6 +642,7 @@ fn entry_test() {
636642                leading:  "/-foo " . into( ) , 
637643                ..Default :: default ( ) 
638644            } ) , 
645+             #[ cfg( feature = "span" ) ] 
639646            span:  ( 6 ..9 ) . into( ) 
640647        } ) 
641648    ) ; 
@@ -648,6 +655,7 @@ fn entry_test() {
648655            name:  Some ( KdlIdentifier  { 
649656                value:  "bar" . into( ) , 
650657                repr:  Some ( "bar" . into( ) ) , 
658+                 #[ cfg( feature = "span" ) ] 
651659                span:  ( 9 ..12 ) . into( ) , 
652660            } ) , 
653661            format:  Some ( KdlEntryFormat  { 
@@ -657,6 +665,7 @@ fn entry_test() {
657665                after_eq:  " " . into( ) , 
658666                ..Default :: default ( ) 
659667            } ) , 
668+             #[ cfg( feature = "span" ) ] 
660669            span:  ( 9 ..16 ) . into( ) 
661670        } ) 
662671    ) ; 
@@ -669,6 +678,7 @@ fn entry_test() {
669678            name:  Some ( KdlIdentifier  { 
670679                value:  "bar" . into( ) , 
671680                repr:  Some ( "bar" . into( ) ) , 
681+                 #[ cfg( feature = "span" ) ] 
672682                span:  ( 12 ..16 ) . into( ) , 
673683            } ) , 
674684            format:  Some ( KdlEntryFormat  { 
@@ -678,6 +688,7 @@ fn entry_test() {
678688                after_eq:  " " . into( ) , 
679689                ..Default :: default ( ) 
680690            } ) , 
691+             #[ cfg( feature = "span" ) ] 
681692            span:  ( 12 ..18 ) . into( ) 
682693        } ) 
683694    ) ; 
@@ -749,10 +760,7 @@ fn node_children(input: &mut Input<'_>) -> PResult<KdlDocument> {
749760            . or_else ( |mut  e :  ErrMode < KdlParseError > | { 
750761                e = match  e { 
751762                    ErrMode :: Cut ( mut  pe)  => { 
752-                         #[ cfg( feature = "span" ) ]  
753-                         { 
754-                             pe. span  = Some ( ( _before_open_loc.._after_open_loc) . into ( ) ) ; 
755-                         } 
763+                         pe. span  = Some ( ( _before_open_loc.._after_open_loc) . into ( ) ) ; 
756764                        ErrMode :: Cut ( pe) 
757765                    } 
758766                    e => return  Err ( e) , 
@@ -1508,6 +1516,7 @@ mod string_tests {
15081516            KdlIdentifier  { 
15091517                value:  "foo" . into( ) , 
15101518                repr:  Some ( "foo" . into( ) ) , 
1519+                 #[ cfg( feature = "span" ) ] 
15111520                span:  ( 0 ..3 ) . into( ) 
15121521            } 
15131522        ) ; 
@@ -1516,6 +1525,7 @@ mod string_tests {
15161525            KdlIdentifier  { 
15171526                value:  "+." . into( ) , 
15181527                repr:  Some ( "+." . into( ) ) , 
1528+                 #[ cfg( feature = "span" ) ] 
15191529                span:  ( 0 ..1 ) . into( ) 
15201530            } 
15211531        ) 
0 commit comments