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

Bug in PGN parser #38

Open
kuruhuru opened this issue Apr 7, 2024 · 1 comment
Open

Bug in PGN parser #38

kuruhuru opened this issue Apr 7, 2024 · 1 comment

Comments

@kuruhuru
Copy link

kuruhuru commented Apr 7, 2024

Hello!
I found a problem when loading pgn with '{\nsome comments' pattern. May be even inside '(' variation
I added example modified file wcc_2023_1.pgn
wcc_2023_1.txt

I modified it here...
image

And when I run the following code the application hangs

void main(List<String> args) {
  final String data = File('bin/pgn/wcc_2023_1.pgn').readAsStringSync();
  final List<PgnGame<PgnNodeData>> games = PgnGame.parseMultiGamePgn(data);
  print('Games: ${games.length}');
  print('Game 1: ${games[0].makePgn()}');
}
@veloce
Copy link
Collaborator

veloce commented Apr 8, 2024

The cause of the bug is {?

Feel free to make a PR with a fix and and new test case. Thanks!

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

No branches or pull requests

2 participants