gameNumber = 0;
lastStart = (ChessMove) 0;
- yyskipmoves = TRUE;
+ yyskipmoves = FALSE;
do {
- yyboardindex = 1;
+ yyboardindex = 0;
offset = yyoffset();
cm = (ChessMove) yylex();
switch (cm) {
}
} while (cm == PGNTag || cm == Comment);
break;
+ case NormalMove:
+ /* Allow the first game to start with an unnumbered move */
+ yyskipmoves = TRUE;
+ if (lastStart == (ChessMove) 0) {
+ if ((error = GameListNewGame(¤tListGame))) {
+ rewind(f);
+ yyskipmoves = FALSE;
+ return(error);
+ }
+ currentListGame->number = ++gameNumber;
+ currentListGame->offset = offset;
+ lastStart = MoveNumberOne;
+ }
+ break;
default:
break;
}