mirror of
https://gitlab.com/manzerbredes/chess-move-interface.git
synced 2025-05-03 02:07:47 +00:00
Improve NAG parsing
This commit is contained in:
parent
2ac42558f2
commit
da88575493
5 changed files with 30 additions and 27 deletions
src
|
@ -260,16 +260,19 @@ loctype PGN::ParseHalfMove(loctype loc, HalfMove *hm) {
|
|||
EOF_CHECK(loc);
|
||||
c = pgn_content[loc];
|
||||
if (c == '$') {
|
||||
hm->NAG += c;
|
||||
//hm->NAG += c;
|
||||
std::string NAG;
|
||||
loc++;
|
||||
EOF_CHECK(loc);
|
||||
c = pgn_content[loc];
|
||||
while (IS_DIGIT(c)) {
|
||||
hm->NAG += c;
|
||||
NAG += c;
|
||||
loc++;
|
||||
EOF_CHECK(loc);
|
||||
c = pgn_content[loc];
|
||||
}
|
||||
if(NAG.size()>0)
|
||||
hm->NAG=std::stoi(NAG);
|
||||
}
|
||||
} else if (c == '(') {
|
||||
// Check for variations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue