Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect PGN parsing of move number tokens like "11... c5??" (WIP) #45

Closed
wants to merge 1 commit into from

Conversation

calcitem
Copy link

@calcitem calcitem commented Feb 3, 2025

This commit adds a small patch to detect tokens that represent a move number,
such as "11." or "11...", and store them temporarily. The next real move token
(e.g. "c5??") is then combined with the pending move number to form "11...c5??",
ensuring the move is not treated as a separate root-level node. This prevents
parsing errors in PGN trees where moves like "11... c5??" were incorrectly
inserted alongside sibling moves, instead of as a child in the correct place.

(TODO: Test)

@calcitem calcitem force-pushed the patch-1 branch 4 times, most recently from 3e90a51 to 1c1fa0d Compare February 3, 2025 03:03
This commit adds a small patch to detect tokens that represent a move number,
such as "11." or "11...", and store them temporarily. The next real move token
(e.g. "c5??") is then combined with the pending move number to form "11...c5??",
ensuring the move is not treated as a separate root-level node. This prevents
parsing errors in PGN trees where moves like "11... c5??" were incorrectly
inserted alongside sibling moves, instead of as a child in the correct place.
@calcitem
Copy link
Author

calcitem commented Feb 3, 2025

Draft

@calcitem calcitem closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant