X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=sys%2Fsrc%2Fcmd%2Fyacc.c;h=4b809de9c1869e0a7387726ed79a241897c8f70f;hb=e73a9eb9e835d21bd44d2f0a26d144c49c504d07;hp=75e0d0161db75cb9d6c202c886eb20f3003c818a;hpb=e5888a1ffdae813d7575f5fb02275c6bb07e5199;p=plan9front.git diff --git a/sys/src/cmd/yacc.c b/sys/src/cmd/yacc.c old mode 100755 new mode 100644 index 75e0d0161..4b809de9c --- a/sys/src/cmd/yacc.c +++ b/sys/src/cmd/yacc.c @@ -141,7 +141,7 @@ Biobuf* foutput; /* y.output file */ char* infile; /* input file name */ int numbval; /* value of an input number */ -char tokname[NAMESIZE+4]; /* input token name, slop for runes and 0 */ +char tokname[NAMESIZE+UTFmax+1]; /* input token name, slop for runes and 0 */ /* structure declarations */ @@ -402,6 +402,7 @@ others(void) finput = Bopen(parser, OREAD); if(finput == 0) error("cannot find parser %s", parser); + Blethal(finput, nil); warray("yyr1", levprd, nprod); aryfil(temp1, nprod, 0); PLOOP(1, i) @@ -473,6 +474,7 @@ others(void) Bprint(ftable, "%4d\n};\n", 0); /* copy parser text */ + Bprint(ftable, "\n#line\t1\t\"%s\"\n", parser); while((c=Bgetrune(finput)) != Beof) { if(c == '$') { if((c = Bgetrune(finput)) != 'A') @@ -481,6 +483,7 @@ others(void) faction = Bopen(actname, OREAD); if(faction == 0) error("cannot reopen action tempfile"); + Blethal(faction, nil); while((c=Bgetrune(faction)) != Beof) Bputrune(ftable, c); Bterm(faction); @@ -1217,6 +1220,8 @@ setup(int argc, char *argv[]) faction = Bopen(actname = mktemp(tactname), OWRITE); if(ftemp == 0 || faction == 0) error("cannot open temp file"); + Blethal(ftemp, nil); + Blethal(faction, nil); if(argc < 1) error("no input file"); infile = argv[0]; @@ -1232,6 +1237,7 @@ setup(int argc, char *argv[]) finput = Bopen(infile, OREAD); if(finput == 0) error("cannot open '%s'", argv[0]); + Blethal(finput, nil); cnamp = cnames; defin(0, "$end"); @@ -2127,6 +2133,7 @@ openup(char *stem, int dflag, int vflag, int ytab, char *ytabc) foutput = Bopen(buf, OWRITE); if(foutput == 0) error("cannot open %s", buf); + Blethal(foutput, nil); } if(yydebug) { snprint(buf, sizeof buf, "%s.%s", stem, FILEDEBUG); @@ -2138,6 +2145,7 @@ openup(char *stem, int dflag, int vflag, int ytab, char *ytabc) fdefine = Bopen(buf, OWRITE); if(fdefine == 0) error("can't create %s", buf); + Blethal(fdefine, nil); } if(ytab == 0) snprint(buf, sizeof buf, "%s.%s", stem, OFILE); @@ -2146,6 +2154,7 @@ openup(char *stem, int dflag, int vflag, int ytab, char *ytabc) ftable = Bopen(buf, OWRITE); if(ftable == 0) error("cannot open table file %s", buf); + Blethal(ftable, nil); } /* @@ -2619,6 +2628,7 @@ callopt(void) finput = Bopen(tempname, OREAD); if(finput == 0) error("optimizer cannot open tempfile"); + Blethal(finput, nil); pgo[0] = 0; temp1[0] = 0;