pgn_read/core/game.py
def append_end_rav(self, match):
        """Append end recursive annotation variation token to game score and
        update board state.

        Put game in error state if a variation cannot be finished at current
        place in game score.

        """
        # Return True if ')' is valid: for benefit of subclass caller to decide
        # on it's action.
        # The formal syntax for PGN, section 18 in specification, allows text
        # such as, for example:
        # '( e4 12 )'
        # '( e4 . )'
        # '( e4 ...... )'
        # '( e4 ...12... 13 )'
        # This program ignores numbers and dots for state and storage of games.
        if self._state is not None or self._movetext_offset is None:
            self.append_token_and_set_error(match)
            return

        if self._movetext_offset is None:
            self.append_token_and_set_error(match)
            return
        if len(self._ravstack) == 1:
            self.append_token_and_set_error(match)
            return
        del self._ravstack[-1]
        del self._state_stack[-1]
        self._state = self._state_stack[-1]

        # The formal syntax for PGN, section 18 in specification, allows '()'
        # as a recursive annotation variation.
        # The commented code bans this sequence.
        #if (self._active_color == self._ravstack[-1][3][1] and
        #    self._fullmove_number == self._ravstack[-1][3][5]):
        #    self.append_token_and_set_error(match)
        #    return

        if self._ravstack[-1][2] is None:
            self.set_position_to_play_prior_right_nested_rav_at_move()
        else:
            self.set_position_to_play_main_line_at_move()
        self._text.append(match.group())
        return True
Append end recursive annotation variation token to game score and
        update board state.

        Put game in error state if a variation cannot be finished at current
        place in game score.

        
Append end recursive annotation variation token to game score and
update board state.

Put game in error state if a variation cannot be finished at current
place in game score.
Append end recursive annotation variation token to game score and update board state . Put game in error state if a variation cannot be finished at current place in game score .
def append_end_rav(self, match):
        if self._state is not None or self._movetext_offset is None:
            self.append_token_and_set_error(match)
            return
        if self._movetext_offset is None:
            self.append_token_and_set_error(match)
            return
        if len(self._ravstack) == 1:
            self.append_token_and_set_error(match)
            return
        del self._ravstack[-1]
        del self._state_stack[-1]
        self._state = self._state_stack[-1]
        if self._ravstack[-1][2] is None:
            self.set_position_to_play_prior_right_nested_rav_at_move()
        else:
            self.set_position_to_play_main_line_at_move()
        self._text.append(match.group())
        return True
def append_end_rav ( self , match ) : if self . _state is not None or self . _movetext_offset is None : self . append_token_and_set_error ( match ) return if self . _movetext_offset is None : self . append_token_and_set_error ( match ) return if len ( self . _ravstack ) == 1 : self . append_token_and_set_error ( match ) return del self . _ravstack [ - 1 ] del self . _state_stack [ - 1 ] self . _state = self . _state_stack [ - 1 ] if self . _ravstack [ - 1 ] [ 2 ] is None : self . set_position_to_play_prior_right_nested_rav_at_move ( ) else : self . set_position_to_play_main_line_at_move ( ) self . _text . append ( match . group ( ) ) return True
Append end recursive annotation variation token to game score and
update board state.
Append end recursive annotation variation token to game score and update board state .
"""Append end recursive annotation variation token to game score and
        update board state.

        Put game in error state if a variation cannot be finished at current
        place in game score.

        """ # Return True if ')' is valid: for benefit of subclass caller to decide # on it's action. # The formal syntax for PGN, section 18 in specification, allows text # such as, for example: # '( e4 12 )' # '( e4 . )' # '( e4 ...... )' # '( e4 ...12... 13 )' # This program ignores numbers and dots for state and storage of games. # The formal syntax for PGN, section 18 in specification, allows '()' # as a recursive annotation variation. # The commented code bans this sequence. #if (self._active_color == self._ravstack[-1][3][1] and #    self._fullmove_number == self._ravstack[-1][3][5]): #    self.append_token_and_set_error(match) #    return
self
match