correct allprint prototype for unicode input fix weird debug message in some cases (my case was negative input() return values) Notes: Sat Jan 7 11:32:45 EST 2006 rsc Allprint doesn't handle unicode input. You'll need to fix a lot more than the prototype to make it work. Lex in general doesn't work with UTF: the regular expression machinery it builds doesn't know about UTF. I don't understand the debug message fix -- what does negative input() return values mean? I looked at the definition of input() that lex uses and I don't see it returning negative numbers. Reference: /n/sources/patch/sorry/lex-debug Date: Wed Jan 4 20:44:58 CET 2006 Reviewed-by: rsc --- /sys/src/cmd/lex/ncform Wed Jan 4 20:44:55 2006 +++ /sys/src/cmd/lex/ncform Wed Jan 4 20:44:51 2006 @@ -9,7 +9,7 @@ extern struct yysvf *yyestate; int yyprevious = YYNEWLINE; # ifdef LEXDEBUG -extern void allprint(char); +extern void allprint(int); # endif yylook(void){ struct yysvf *yystate, **lsp; @@ -113,7 +113,7 @@ } # ifdef LEXDEBUG if(debug){ - fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1); + fprintf(yyout,"stopped at %d with ",lsp>yylstate?*(lsp-1)-yysvec-1:0); allprint(yych); putchar('\n'); }