aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-01-25 15:23:54 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-01-25 15:23:54 +0100
commit3f1e9da333ca4d31f6d38efa0ac992bd04473489 (patch)
treecf31d6442dc9f992358d7aa17070def4ea999300
parent2e30eaccb106d806ccb64514bf6317af78c56c10 (diff)
Improve comment parsing
-rw-r--r--src/PGN.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/PGN.cpp b/src/PGN.cpp
index 018473b..0e7e023 100644
--- a/src/PGN.cpp
+++ b/src/PGN.cpp
@@ -151,6 +151,9 @@ int PGN::ParseHalfMove(int loc, HalfMove *hm) {
hm->isBlack = true;
}
+ // Parse comment entries (various comment could appear during HalfMove parsing)
+ loc=ParseComment(loc,hm);
+
// Parse the HalfMove
loc = NextNonBlank(loc);
EOF_CHECK(loc);
@@ -164,6 +167,9 @@ int PGN::ParseHalfMove(int loc, HalfMove *hm) {
}
hm->move = move;
+ // Parse comment
+ loc=ParseComment(loc,hm);
+
// Skip end of variation
if (c == ')') {
loc++;
@@ -183,6 +189,9 @@ int PGN::ParseHalfMove(int loc, HalfMove *hm) {
loc++; // Skip ')'
}
+ // Parse comment
+ loc=ParseComment(loc,hm);
+
// Parse next HalfMove
loc = NextNonBlank(loc);
if (!IS_EOF(loc)) {