Follow-up Comment #3, bug #27799 (project xboard):

All good points, and you understand the syntax correctly.

Looking at the next pattern, besides the fact that the patterns are wrongly
looking for "Mateed" we actually are trying to recognize "White mated" as both
a win and a loss by white!  I guess it could mean "White mated his opponent",
but "White is mated here" seems more likely.

Also, "White mate" seems meaningless to me, so maybe we should ignore that
one.  (If we don't match it here, the "skip everything else" pattern will skip
"White " and the "([Cc]heck)?[Mm]ate" pattern will match at that point and
consider it a loss for the player who is on move.)

Actually, much of this stuff is probably unnecessary now that PGN is a fairly
accepted standard -- it dates from when xboard was often used to parse out
games people had typed into email messages by hand, before PGN even had been
proposed.  But we could keep it and fix it this way:

(([Ww](hite)?)|([Bb](lack)?))" "[Mm]ates {
    return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins);
}

(([Ww](hite)?)|([Bb](lack)?))" "([Mm]ated)|([Ll]os[tes]+.*) {
    return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
}



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27799>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-xboard

Reply via email to