File tree Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -263,18 +263,17 @@ pub fn split_name(name: &str) -> Option<Vec<(PrimComponent, &str)>> {
263
263
continue ;
264
264
}
265
265
// 1-letter planet notation
266
- if sub_name
267
- . strip_prefix ( 'f' )
268
- . unwrap_or ( sub_name)
269
- . strip_suffix ( [ 'i' , 'p' ] )
270
- . unwrap_or ( sub_name)
266
+ let unforked = sub_name. strip_prefix ( 'f' ) . unwrap_or ( sub_name) ;
267
+ if unforked
268
+ . strip_suffix ( [ 'i' , 'p' , 'f' ] )
269
+ . unwrap_or ( unforked)
271
270
. chars ( )
272
271
. all ( |c| "gd" . contains ( c) )
273
- && sub_name != "fi"
274
272
{
275
273
for ( i, c) in sub_name. char_indices ( ) {
276
274
let prim = match c {
277
- 'f' => Primitive :: Fork ,
275
+ 'f' if i == 0 => Primitive :: Fork ,
276
+ 'f' => Primitive :: Fix ,
278
277
'g' => Primitive :: Gap ,
279
278
'd' => Primitive :: Dip ,
280
279
'i' => Primitive :: Identity ,
@@ -286,24 +285,6 @@ pub fn split_name(name: &str) -> Option<Vec<(PrimComponent, &str)>> {
286
285
start += len;
287
286
continue ' outer;
288
287
}
289
- // Dip fix
290
- if sub_name
291
- . strip_suffix ( 'f' )
292
- . unwrap_or ( sub_name)
293
- . chars ( )
294
- . all ( |c| c == 'd' )
295
- {
296
- for ( i, c) in sub_name. char_indices ( ) {
297
- let prim = match c {
298
- 'd' => Primitive :: Dip ,
299
- 'f' => Primitive :: Fix ,
300
- _ => unreachable ! ( ) ,
301
- } ;
302
- prims. push ( ( prim. into ( ) , & sub_name[ i..i + 1 ] ) )
303
- }
304
- start += len;
305
- continue ' outer;
306
- }
307
288
// Aliases
308
289
if let Some ( ps) = Primitive :: get_multi_alias ( sub_name) {
309
290
prims. extend ( ps. iter ( ) . map ( |( p, s) | ( * p, * s) ) ) ;
You can’t perform that action at this time.
0 commit comments