From e24ebe013870ce447594768e4bd621420d809578 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 27 Jan 2022 08:20:32 +0100 Subject: [PATCH] Debug parser --- src/PGN.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/PGN.cpp b/src/PGN.cpp index 3f30c4e..e82179f 100644 --- a/src/PGN.cpp +++ b/src/PGN.cpp @@ -190,11 +190,11 @@ loctype PGN::ParseHalfMove(loctype loc, HalfMove *hm) { } hm->move = move; + // Parse Comments, Variations and NAG loc = GotoNextToken(loc); EOF_CHECK(loc); c = pgn_content[loc]; - - while (c == '{' || c == '$' || c == '(' || c == ';' || c == '%') { + while (c == '{' || c == '$' || c == '(') { if (c == '{') { // Parse comment loc = ParseComment(loc, hm); @@ -236,9 +236,6 @@ loctype PGN::ParseHalfMove(loctype loc, HalfMove *hm) { } // Skip end of variation - loc = GotoNextToken(loc); - EOF_CHECK(loc); - c = pgn_content[loc]; if (c == ')') { return (loc); } @@ -332,7 +329,7 @@ loctype PGN::GotoNextToken(loctype loc) { } c = pgn_content[loc]; if (c == '%' || c == ';') { - loc = GotoEOL(loc); + loc = GotoEOL(loc)+1; if (IS_EOF) { return (loc); }