@@ -666,7 +666,7 @@ var (
666666type contentNodeIs2 []contentNodeI
667667
668668func (n contentNodeIs2 ) Dims () sitematrix.VectorProvider {
669- panic ("contentNodeIs2. Dims: not supported" )
669+ panic ("Dims() : not supported" )
670670}
671671
672672func (n contentNodeIs2 ) Path () string {
@@ -793,9 +793,7 @@ func (s *contentNodeShifter) Delete(n contentNodeI, dims sitematrix.Vector) (con
793793 }
794794 return deleted , wasDeleted , isEmpty
795795 case contentNodeIs2 :
796- if len (v ) == 0 {
797- panic ("empty contentNodeIs2" )
798- }
796+ // panic("TODO1 Delete")
799797 // TODO1 implement me.
800798 return nil , false , false
801799
@@ -870,8 +868,6 @@ func absint(i int) int {
870868}
871869
872870func (s * contentNodeShifter ) Shift (n contentNodeI , dims sitematrix.Vector , exact , delegeeFallback bool ) (contentNodeI , bool , sitematrix.Dimension ) {
873- // dims: language, version and role
874- // How accurate is the match. TODO1 revise this.
875871 accuracy := sitematrix .Language
876872 switch v := n .(type ) {
877873 case contentNodeIs :
@@ -897,14 +893,12 @@ func (s *contentNodeShifter) Shift(n contentNodeI, dims sitematrix.Vector, exact
897893 }
898894 return nil , false , 0
899895 case contentNodeIs2 :
900- if len (v ) == 0 {
901- panic ("empty contentNodeIs2" )
902- }
903896 for _ , vv := range v {
904897 if vv .Dims ().HasVector (dims ) {
905898 return vv , true , sitematrix .Language
906899 }
907900 }
901+
908902 if ! delegeeFallback {
909903 return nil , false , 0
910904 }
@@ -984,6 +978,15 @@ func (s *contentNodeShifter) ForEeachInDimension(n contentNodeI, dims sitematrix
984978 }
985979 }
986980 }
981+
982+ case contentNodeIs2 :
983+ for _ , v := range vv {
984+ if v .Dims ().HasVector (dims ) {
985+ if f (v ) {
986+ return
987+ }
988+ }
989+ }
987990 default :
988991 if n == nil {
989992 return
@@ -1094,7 +1097,8 @@ func (s *contentNodeShifter) Insert(old, new contentNodeI) (contentNodeI, conten
10941097 }*/
10951098
10961099 rs := append (vv , newp )
1097- return contentNodeIs2 (rs ), vv .first (), false
1100+
1101+ return rs , vv , false
10981102
10991103 case * resourceSource :
11001104 newp , ok := new .(* resourceSource )
0 commit comments