-
Notifications
You must be signed in to change notification settings - Fork 14
Fix pgn disambiguation squares #75
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
==========================================
+ Coverage 68.51% 69.42% +0.90%
==========================================
Files 27 27
Lines 4872 4889 +17
==========================================
+ Hits 3338 3394 +56
+ Misses 1410 1371 -39
Partials 124 124 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request fixes PGN disambiguation parsing by adding support for full square disambiguation in chess moves like "Qe8f7" (queen from e8 to f7). Currently, such moves fail to parse because the parser doesn't handle complete square disambiguation properly.
Key changes:
- Adds a new
DeambiguationSquaretoken type for lexical analysis - Implements parsing logic for full square disambiguation in moves
- Includes comprehensive test coverage for various disambiguation scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pgn_disambiguation_test.go | Adds test cases for PGN disambiguation parsing and tokenizer functionality |
| pgn.go | Updates move parser to handle DeambiguationSquare tokens with origin file and rank extraction |
| lexer.go | Adds DeambiguationSquare token type and lexing logic for full square disambiguation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pgn_disambiguation_test.go
Outdated
| { | ||
| name: "queen_with_full_square_disambiguation", | ||
| input: "Qe8f7", | ||
| expected: []TokenType{PIECE, DeambiguationSquare, SQUARE}, // This is likely wrong - should be PIECE, SQUARE (source), SQUARE (dest) |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment indicates uncertainty about the expected token sequence. Either remove this comment if the expectation is correct, or fix the expected tokens if they are indeed wrong as the comment suggests.
| expected: []TokenType{PIECE, DeambiguationSquare, SQUARE}, // This is likely wrong - should be PIECE, SQUARE (source), SQUARE (dest) | |
| expected: []TokenType{PIECE, SQUARE, SQUARE}, |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
WIP for #73