@@ -182,7 +182,7 @@ impl<'t> Parser<'t> {
182182 }
183183
184184 /// Advances the parser by one token
185- pub ( crate ) fn split_float ( & mut self , marker : Marker ) -> ( bool , Marker ) {
185+ pub ( crate ) fn split_float ( & mut self , mut marker : Marker ) -> ( bool , Marker ) {
186186 assert ! ( self . at( SyntaxKind :: FLOAT_NUMBER ) ) ;
187187 // we have parse `<something>.`
188188 // `<something>`.0.1
@@ -191,26 +191,23 @@ impl<'t> Parser<'t> {
191191 // `<something>`. 0. 1;
192192 // here we need to change the follow up parse, the return value will cause us to emulate a dot
193193 // the actual splitting happens later
194- let has_pseudo_dot = !self . inp . is_joint ( self . pos ) ;
195- let marker = if !has_pseudo_dot {
196- let new_pos = self . start ( ) ;
194+ let ends_in_dot = !self . inp . is_joint ( self . pos ) ;
195+ if !ends_in_dot {
196+ let new_marker = self . start ( ) ;
197197 let idx = marker. pos as usize ;
198198 match & mut self . events [ idx] {
199199 Event :: Start { forward_parent, kind } => {
200200 * kind = SyntaxKind :: FIELD_EXPR ;
201- * forward_parent = Some ( new_pos . pos - marker. pos ) ;
201+ * forward_parent = Some ( new_marker . pos - marker. pos ) ;
202202 }
203203 _ => unreachable ! ( ) ,
204204 }
205- // NOTE: This brings the start / finish pairs out of balance!
206- std:: mem:: forget ( marker) ;
207- new_pos
208- } else {
209- marker
205+ marker. bomb . defuse ( ) ;
206+ marker = new_marker;
210207 } ;
211208 self . pos += 1 as usize ;
212- self . push_event ( Event :: FloatSplitHack { has_pseudo_dot } ) ;
213- ( has_pseudo_dot , marker)
209+ self . push_event ( Event :: FloatSplitHack { ends_in_dot } ) ;
210+ ( ends_in_dot , marker)
214211 }
215212
216213 /// Advances the parser by one token, remapping its kind.
0 commit comments