Some GUIs (in particular Arena) do not have the decency to keep the
result comment on a single line. In this case the parser rules would not
recognize it, and treat it as a normal comment, plus an undetailed PGN
result. The rules are now fixed to allow linefeeds in the comment, and
between comment and PGN result. To correctly process the comment further
(e.g. in game-list lines) the linefeeds are replaced by spaces in the
back-end routines that do use the result comment.
if (q != NULL) *q = NULLCHAR;
p++;
}
+ while(q = strchr(p, '\n')) *q = ' '; // [HGM] crush linefeeds in result message
gameInfo.resultDetails = StrSave(p);
continue;
}
if (q != NULL) *q = NULLCHAR;
p++;
}
+ while(q = strchr(p, '\n')) *q = ' '; // [HGM] crush linefeeds in result message
GameEnds(moveType, p, GE_FILE);
done = TRUE;
if (cmailMsgLoaded) {
return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
}
-("{"[^\}\n]*"} ")?(1-0|"1 - 0"|"1/0"|"1 / 0"|"1:0"|"1 : 0")(" (".*")"|" {".*"}")? {
+("{"[^\}]*"}"[ \n])?(1-0|"1 - 0"|"1/0"|"1 / 0"|"1:0"|"1 : 0")(" (".*")"|" {".*"}")? {
return (int) WhiteWins;
}
-("{"[^\}\n]*"} ")?(0-1|"0 - 1"|"0/1"|"0 / 1"|"0:1"|"0 : 1")(" (".*")"|" {".*"}")? {
+("{"[^\}]*"}"[ \n])?(0-1|"0 - 1"|"0/1"|"0 / 1"|"0:1"|"0 : 1")(" (".*")"|" {".*"}")? {
return (int) BlackWins;
}
-("{"[^\}\n]*"} ")?("1/2"|"1 / 2")(" "?[-:]" "?("1/2"|"1 / 2"))?(" (".*")"|" {".*"}")? {
+("{"[^\}]*"}"[ \n])?("1/2"|"1 / 2")(" "?[-:]" "?("1/2"|"1 / 2"))?(" (".*")"|" {".*"}")? {
return (int) GameIsDrawn;
}
-("{"[^\}\n]*"} ")?"*"(" (".*")"|" {".*"}")? {
+("{"[^\}]*"}"[ \n])?"*"(" (".*")"|" {".*"}")? {
return (int) GameUnfinished;
}