pgn
pgn copied to clipboard
parser error
I downloaded some games from lichess, and got this error:
/home/frank/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/whittle-0.0.8/lib/whittle/parser.rb:282:in `error': Parse error: expected :game_termination but got :tag_name on line 277080. (Whittle::ParseError)
1. e4 Nc6 2. Nf3 Nf6 3. Nc3 d5 4. exd5 Nxd5 5. Bc4 e6 6. d3 Bb4 7. Bd2 Bxc3 8. bxc3 P@g4 9. P@h6 gxf3 10. hxg7 Rg8 11. Bxd5 exd5 12. Qxf3 Qe7+ 13. Be3 B@f6 14. P@d4 Rxg7 15. P@h6 Rg8 1
... ^ ... occurred here
from /home/frank/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/whittle-0.0.8/lib/whittle/parser.rb:231:in `block (2 levels) in parse'
from /home/frank/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/whittle-0.0.8/lib/whittle/parser.rb:207:in `loop'
The chess.pgn library from Python has no problems with it.
How does chess.pgn parse it? Does lichess have documentation for their PGN format?
I'm not sure what I'm looking at. Perhaps we should accept P (I assume it stands for "pawn", which I suppose is technically allowed in PGN, but not usually used in the SAN). The @ character is (to my knowledge) not a valid PGN/SAN character; what does it mean?
Maybe you could share the entire PGN file?