Repository navigation
Conversation
An illegal move starts skipping to the end of the variation, but the closing bracket was handled as if begin_variation() had returned SKIP: the board stack was not popped after an error inside a variation, and an unmatched ')' after an error in the mainline ended a variation that was never started (IndexError in GameBuilder).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1217.
An illegal move makes read_game() skip to the end of the variation, but the closing ")" was handled the same way as a variation skipped by the visitor. read_game() now remembers why it started skipping:
Tests cover the three examples from the issue and check that deliberately skipped variations still work.
This builds on #1204 by @eeshsaxena, which found the IndexError. As you suggested there, the fix is in read_game() rather than GameBuilder.