X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.l;h=7e77c888285d2ad65fe083ed7a621fd1a351480e;hb=affb2d78e0cfaa22e62573dd4e65d2bb3062471c;hp=82957eb41b19cd497b761c42cebb4580bddd6baf;hpb=0db7cb3a6d76078255f3d19cb8364ce3dc536458;p=xboard.git diff --git a/parser.l b/parser.l index 82957eb..7e77c88 100755 --- a/parser.l +++ b/parser.l @@ -706,7 +706,10 @@ extern void CopyBoard P((Board to, Board from)); ff = initialRights[5]; ft = initialRights[4]; } - fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft); + if (appData.debugMode) + { + fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft); + }; if(ff < 0 || ft < 0) return 0; } sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); @@ -919,7 +922,7 @@ extern void CopyBoard P((Board to, Board from)); return (int) Comment; } -\([^()]*(\([^()]*\)[^()]*)+[^()]*\) { /* nested () */ +\([^()]*(\([^()]*(\([^()]*(\([^()]*\)[^()]*)*\)[^()]*)*\)[^()]*)+[^()]*\) { /* very nested () */ return (int) Comment; } @@ -985,7 +988,7 @@ int yyoffset() static void output(ch) int ch; { - fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n", + if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unmatched character '%c' (0%o)\n", ch, ch); } @@ -997,7 +1000,7 @@ static void unput(ch) StringToLex--; } else { if (unputCount >= UNPUT_BUF_SIZE) - fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", + if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", ch, ch); unputBuffer[unputCount++] = ch; }