@@ -140,7 +140,6 @@ impl<'a> TtIter<'a> {
140140
141141 let mut cursor = buffer. begin ( ) ;
142142 let mut error = false ;
143- let mut float_splits = vec ! [ ] ;
144143 for step in tree_traversal. iter ( ) {
145144 match step {
146145 parser:: Step :: Token { kind, mut n_input_tokens } => {
@@ -152,7 +151,8 @@ impl<'a> TtIter<'a> {
152151 }
153152 }
154153 parser:: Step :: FloatSplit { .. } => {
155- float_splits. push ( cursor) ;
154+ // FIXME: We need to split the tree properly here, but mutating the token trees
155+ // in the buffer is somewhat tricky to pull off.
156156 cursor = cursor. bump_subtree ( ) ;
157157 }
158158 parser:: Step :: Enter { .. } | parser:: Step :: Exit => ( ) ,
@@ -170,40 +170,13 @@ impl<'a> TtIter<'a> {
170170 let mut res = vec ! [ ] ;
171171
172172 if cursor. is_root ( ) {
173- if float_splits. is_empty ( ) {
174- while curr != cursor {
175- if let Some ( token) = curr. token_tree ( ) {
176- res. push ( token. cloned ( ) ) ;
177- }
178- curr = curr. bump ( ) ;
179- }
180- } else {
181- // let mut float_splits = float_splits.into_iter().peekable();
182- // while let Some(tt) = curr.token_tree() {
183- // let mut tt = tt.cloned();
184- // let mut tt_mut_ref = &mut tt;
185- // if let Some(fs) = float_splits.peek() {
186- // loop {
187- // curr = curr.bump_subtree();
188- // if curr == *fs {
189- // float_splits.next();
190- // }
191- // if curr.is_root() {
192- // break;
193- // }
194- // }
195- // }
196- // res.push(tt);
197- // }
198-
199- while curr != cursor {
200- if let Some ( token) = curr. token_tree ( ) {
201- res. push ( token. cloned ( ) ) ;
202- }
203- curr = curr. bump ( ) ;
204- }
173+ while curr != cursor {
174+ let Some ( token) = curr. token_tree ( ) else { break } ;
175+ res. push ( token. cloned ( ) ) ;
176+ curr = curr. bump ( ) ;
205177 }
206178 }
179+
207180 self . inner = self . inner . as_slice ( ) [ res. len ( ) ..] . iter ( ) ;
208181 let res = match res. len ( ) {
209182 0 | 1 => res. pop ( ) ,
0 commit comments