def star_nfa(self, nfa: NFA) -> None: """ star_nfa Add a star from the last closed group to existing NFA. :param nfa: The existing NFA. """ # add star between last closed group and last state self.last_state = nfa.add_star(self.last_closed_group, self.last_state) # register this as a star self.last_star.append(self.last_closed_group) # null out the last closed group so it can't be operated on again self.last_closed_group = None