mirror of
https://gitlab.com/manzerbredes/pgnp.git
synced 2025-04-07 02:26:25 +02:00
Debug node parsing
This commit is contained in:
parent
5d1796920e
commit
bebbc79824
1 changed files with 9 additions and 11 deletions
18
src/PGN.cpp
18
src/PGN.cpp
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue