* Massachusetts.\r
*\r
* Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005,\r
- * 2006, 2007, 2008, 2009 Free Software Foundation, Inc.\r
+ * 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
*\r
* The following terms apply to Digital Equipment Corporation's copyright\r
* interest in XBoard:\r
if (currentMoveString[4] == NULLCHAR &&\r
(result == WhitePromotionKnight || result == BlackPromotionKnight ||\r
result == WhitePromotionQueen || result == BlackPromotionQueen)) {\r
- if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier)\r
+ if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)\r
currentMoveString[4] = PieceToChar(BlackFerz);\r
else if(gameInfo.variant == VariantGreat)\r
currentMoveString[4] = PieceToChar(BlackMan);\r
result == WhitePromotionKnight || result == BlackPromotionKnight)) {\r
currentMoveString[4] = PieceToChar(BlackQueen);\r
// [HGM] shatranj: take care of variants without Queen\r
- if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier)\r
+ if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)\r
currentMoveString[4] = PieceToChar(BlackFerz);\r
if(gameInfo.variant == VariantGreat)\r
currentMoveString[4] = PieceToChar(BlackMan);\r
ft = BOARD_LEFT+2;\r
}\r
}\r
- if(gameInfo.variant == VariantFischeRandom) {\r
+ if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
if (WhiteOnMove(yyboardindex)) {\r
ff = initialRights[2];\r
ft = initialRights[1];\r
ff = initialRights[5];\r
ft = initialRights[4];\r
}\r
- fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft);\r
+ if (appData.debugMode) \r
+ {\r
+ fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft);\r
+ };\r
if(ff < 0 || ft < 0) return 0;\r
}\r
sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE);\r
ft = BOARD_RGHT-2;\r
}\r
}\r
- if(gameInfo.variant == VariantFischeRandom) {\r
+ if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
if (WhiteOnMove(yyboardindex)) {\r
ff = initialRights[2];\r
ft = initialRights[0];\r
return (int) GameIsDrawn;\r
}\r
\r
-(([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ww][io]n(s)?.*) {\r
+(([Ww](hite)?)|([Bb](lack)?))" "(([Mm]ates)|([Ww][io]n(s)?)) { \r
return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins);\r
}\r
\r
-(([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ll]os[tes]+.*) {\r
+(([Ww](hite)?)|([Bb](lack)?))" "(([Mm]ated)|([Ll]os[tes]+)) { \r
return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);\r
}\r
\r
static void output(ch)\r
int ch;\r
{\r
- fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n",\r
+ if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unmatched character '%c' (0%o)\n",\r
ch, ch);\r
}\r
\r
StringToLex--;\r
} else {\r
if (unputCount >= UNPUT_BUF_SIZE)\r
- fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",\r
+ if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",\r
ch, ch);\r
unputBuffer[unputCount++] = ch;\r
}\r