File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -350,15 +350,17 @@ def follow(current, new_transition):
350350 next FSM if we reach the end of the current one
351351 TODO: improve all follow() implementations to allow for dead metastates?
352352 """
353- next_states = set ()
354- for (i , substate ) in current :
355- fsm = fsms [i ]
356- current_vertex : TransitionKey = new_to_old [i ][new_transition ]
357- if substate in fsm .map and current_vertex in fsm .map [substate ]:
358- next_states .update (connect_all (i , fsm .map [substate ][current_vertex ]))
353+ def next_states ():
354+ for (i , substate ) in current :
355+ fsm = fsms [i ]
356+ current_vertex : TransitionKey = new_to_old [i ][new_transition ]
357+ if substate in fsm .map and current_vertex in fsm .map [substate ]:
358+ yield connect_all (i , fsm .map [substate ][current_vertex ])
359+
360+ next_states_set = frozenset (chain .from_iterable (next_states ()))
359361 if not next_states :
360362 raise OblivionError
361- return frozenset ( next_states )
363+ return next_states_set
362364
363365 return crawl (alphabet , initial , final , follow )
364366
You can’t perform that action at this time.
0 commit comments