sgf: fix issues with pandanet files#148
Conversation
|
I don't think the |
In code review, it was pointed out that this was already working as expected. Confirmed by updating the test.
|
Good catch! I think it threw me off because it's not one of the fields described at https://www.red-bean.com/sgf/. But, to your point, it conforms to the grammar, and the gameTree parser was already working. I reverted the changes to gameTree and updated the test to remove the junk, but still test for the trailing |
|
|
||
| Parser<String> propIdent() => (uppercase() & uppercase().star()).flatten(); | ||
| Parser<String> propIdent() => (letter() & letter().star()).flatten().map((s) { | ||
| // Extract only uppercase letters (e.g., "CoPyright" -> "CP", "GM" -> "GM") |
There was a problem hiding this comment.
what's the rationale for this? 🤔 should we not just extract the whole property identifier? (i.e. CoPyright) wdyt?
There was a problem hiding this comment.
I think we can choose what we do here, but rationale is threefold:
- lowercase is technically illegal
CPis an official documented field for SGF- this is what Sabaki does
There was a problem hiding this comment.
technically illegal
That ship has sailed, hasn't it? 😆
But OK, I think that's fair enough.
There was a problem hiding this comment.
haha, right 😆 I guess what I'm trying to say is that we can kind of do whatever we want because Panda is wrong, and CP seems like the more useful field to extract (if at some point headers are shown in some user-friendly way)
From discussion on #112
CoPyrightinstead ofCP(;OS[]field after the game treeFix: allow arbitrary characters after the game tree, and ignore them