X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.c;h=b2dfe88ca6b3b7e0c4f67a2e97241ebf46b00bd4;hb=7235b5dac65cd2aef7dfffdb7b34337080d44335;hp=d2bae37adbc5c013fc0ab6ad3efb8a269fa9774a;hpb=ab5cae2d93784e7f5aea0ec871eaf6386b9296eb;p=xboard.git diff --git a/parser.c b/parser.c index d2bae37..b2dfe88 100644 --- a/parser.c +++ b/parser.c @@ -195,6 +195,7 @@ int NextUnit(char **p) piece = separator = promoted = slash = n = 0; for(i=0; i<4; i++) coord[i] = -1, type[i] = NOTHING; if(**p == '+') (*p)++, promoted++; + if(**p >= 'a' && **p <= 'z' && (*p)[1]== '@') piece =*(*p)++ + 'A' - 'a'; else if(**p >= 'A' && **p <= 'Z') { piece = *(*p)++; // Note we could test for 2-byte non-ascii names here if(**p == '/') slash = *(*p)++; @@ -488,6 +489,10 @@ badMove:// we failed to find algebraic move *p = oldp; // we might need to re-match the skipped stuff } + if(Match("@@@@", p) || Match("--", p) || Match("Z0", p) || Match("pass", p) || Match("null", p)) { + strncpy(currentMoveString, "@@@@", 5); + return yyboardindex & F_WHITE_ON_MOVE ? WhiteDrop : BlackDrop; + } // ********* Efficient skipping of (mostly) alphabetic chatter ********** while(isdigit(**p) || isalpha(**p) || **p == '-') (*p)++; @@ -579,3 +584,4 @@ ChessMove yylexstr(int boardIndex, char *s, char *buf, int buflen) fromString = 0; return ret; } +