Debug node parsing

This commit is contained in:
Loic Guegan 2022-02-24 18:53:43 +01:00
parent 5d1796920e
commit bebbc79824

View file

@ -70,18 +70,9 @@ void PGN::ParseNextGame() {
if (!IS_BLANK(c)) { if (!IS_BLANK(c)) {
if (c == '[') { if (c == '[') {
loc = ParseNextTag(loc); loc = ParseNextTag(loc);
} else if (IS_DIGIT(c)) { } else {
LastGameEndLoc = ParseHalfMove(loc, moves); LastGameEndLoc = ParseHalfMove(loc, moves);
break; break;
} else if (c == '*') {
result = "*";
LastGameEndLoc = loc + 1;
break;
} else if (c == '{') {
loc = ParseComment(loc, moves);
continue; // No need loc++
} else if (c == '%' || c == ';') {
loc = GotoEOL(loc);
} }
} }
loc++; loc++;
@ -161,6 +152,13 @@ loctype PGN::ParseHalfMove(loctype loc, HalfMove *hm) {
return (loc + 1); return (loc + 1);
} }
// Parse comment
if (c == '{') {
loc = ParseComment(loc, hm);
EOF_CHECK(loc);
c = pgn_content[loc];
}
// Parse move number and check if end of game // Parse move number and check if end of game
if (IS_DIGIT(c)) { if (IS_DIGIT(c)) {
std::string move_nb; std::string move_nb;