@@ -140,6 +140,7 @@ impl<'a> TtIter<'a> {
140140
141141 let mut cursor = buffer. begin ( ) ;
142142 let mut error = false ;
143+ let mut float_splits = vec ! [ ] ;
143144 for step in tree_traversal. iter ( ) {
144145 match step {
145146 parser:: Step :: Token { kind, mut n_input_tokens } => {
@@ -150,6 +151,10 @@ impl<'a> TtIter<'a> {
150151 cursor = cursor. bump_subtree ( ) ;
151152 }
152153 }
154+ parser:: Step :: FloatSplit { .. } => {
155+ float_splits. push ( cursor) ;
156+ cursor = cursor. bump_subtree ( ) ;
157+ }
153158 parser:: Step :: Enter { .. } | parser:: Step :: Exit => ( ) ,
154159 parser:: Step :: Error { .. } => error = true ,
155160 }
@@ -167,18 +172,17 @@ impl<'a> TtIter<'a> {
167172 if cursor. is_root ( ) {
168173 while curr != cursor {
169174 if let Some ( token) = curr. token_tree ( ) {
170- res. push ( token) ;
175+ res. push ( token. cloned ( ) ) ;
171176 }
172177 curr = curr. bump ( ) ;
173178 }
174179 }
175180 self . inner = self . inner . as_slice ( ) [ res. len ( ) ..] . iter ( ) ;
176181 let res = match res. len ( ) {
177- 1 => Some ( res[ 0 ] . cloned ( ) ) ,
178- 0 => None ,
182+ 0 | 1 => res. pop ( ) ,
179183 _ => Some ( tt:: TokenTree :: Subtree ( tt:: Subtree {
180184 delimiter : tt:: Delimiter :: unspecified ( ) ,
181- token_trees : res. into_iter ( ) . map ( |it| it . cloned ( ) ) . collect ( ) ,
185+ token_trees : res,
182186 } ) ) ,
183187 } ;
184188 ExpandResult { value : res, err }
0 commit comments