@@ -182,7 +182,7 @@ impl<'t> Parser<'t> {
182
182
}
183
183
184
184
/// 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 ) {
186
186
assert ! ( self . at( SyntaxKind :: FLOAT_NUMBER ) ) ;
187
187
// we have parse `<something>.`
188
188
// `<something>`.0.1
@@ -191,26 +191,23 @@ impl<'t> Parser<'t> {
191
191
// `<something>`. 0. 1;
192
192
// here we need to change the follow up parse, the return value will cause us to emulate a dot
193
193
// 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 ( ) ;
197
197
let idx = marker. pos as usize ;
198
198
match & mut self . events [ idx] {
199
199
Event :: Start { forward_parent, kind } => {
200
200
* kind = SyntaxKind :: FIELD_EXPR ;
201
- * forward_parent = Some ( new_pos . pos - marker. pos ) ;
201
+ * forward_parent = Some ( new_marker . pos - marker. pos ) ;
202
202
}
203
203
_ => unreachable ! ( ) ,
204
204
}
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;
210
207
} ;
211
208
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)
214
211
}
215
212
216
213
/// Advances the parser by one token, remapping its kind.
0 commit comments