-
Notifications
You must be signed in to change notification settings - Fork 18
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
Parsing fails on PGN with multiple comments after final move #17
Comments
Hello and thank you for your thoughts. I am not sure if the PGN specification allows multiple comments after a move. It's not only about parsing, but about the data model of cm-pgn, which only expects one comment after a move. |
@shaack FWIW, the PGN grammar definitely allows for multiple comments on a move. See Lines 135-151: REST_OF_LINE_COMMENT
: ';' ~[\r\n]* -> skip
;
BRACE_COMMENT
: '{' ~'}'* '}' -> skip
; Because of the You can verify by going to http://lab.antlr.org/ and pasting the PGN grammar into the "Parser" tab. Just make sure to click on the "Lexer" tab and clear its contents first. |
Okay, in that case, if you have the time to create a PR, feel free to do so. I will merge it, if it works. |
Thank you again for this stellar package. It seems PGNs with multiple comments after the final move cannot be parsed. The following PGN throws a syntax error on parse:
As far as I can tell, the PGN is according to the specification. The following parses properly:
If you're interested, I'd be happy to look into the grammar and write a PR.
The text was updated successfully, but these errors were encountered: