Pops off the most recent state.

        :param idx: If provided, specifies the index at which the next
                    string begins.

def pop_state(self, idx=None):
        """
        Pops off the most recent state.

        :param idx: If provided, specifies the index at which the next
                    string begins.
        """

        self.state.pop()

        if idx is not None:
            self.str_begin = idx