]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/yacc.c
cc: use 7 octal digits for 21 bit runes
[plan9front.git] / sys / src / cmd / yacc.c
index 7aef1a281de7fd7bce5386c3131c4b74a547edbf..482823ea092d04b0c40d87ef397ea47ce3396da4 100644 (file)
@@ -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 */
 
@@ -474,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')
@@ -2100,11 +2101,12 @@ swt:
                                c = Bgetrune(finput);
                                if(c == '\n')
                                        lineno++;
-                       } else
+                       } else {
                                if(c == match)
                                        goto lcopy;
                                if(c == '\n')
                                        error("newline in string or char. const.");
+                       }
                        Bputrune(faction, c);
                }
                error("EOF in string or character constant");