Closed sumnerevans closed 2 years ago
Converting to draft since this causes bugs with parsing things like: bf4
from rnbqkbnr/ppp1pppp/8/3p4/3P4/8/PPP1PPPP/RNBQKBNR w KQkq - 0 2
@notnil I cleaned up that PR and I think it's ready for review now. I added a test for the case that I described in the last comment.
On my computer this slows the parser down from:
BenchmarkPGN-12 523 2271381 ns/op
to
BenchmarkPGN-12 312 3853621 ns/op
likely due to regex. I think this is acceptable considering this is a bug that has come up multiple times and it makes the code easier to reason able. Thanks for creating the PR @sumnerevans .
Closes #82
This PR adds support for removing unnecessary move disambiguators when decoding a move.
It also makes some refactors to use
regexp
, and use the same decode logic for long algebraic notation and algebraic notation.