Closed cznic closed 9 years ago
$ cat bug.y %union{ val int vals []int } %token I %type <vals> L %% S: L L: { $$ = []int(nil) } | L I { $$ = append($$, $2) } $ goyacc -o /dev/stdout bug.y | grep yypt-0 Parse table entries: 5 of 24, x 8 bits == 5 bytes yyVAL.vals = append(yyVAL.vals, yyS[yypt-0].) $
Token I should have been declared as %token <val> I, but the missing type of $2 gets undetected by the y package. Goyacc then renders invalid Go code.
I
%token <val> I
$2
y
Closed by https://github.com/cznic/y/commit/d8d6b6e21858a5f10f716272e7d014190a589dd8
Token
I
should have been declared as%token <val> I
, but the missing type of$2
gets undetected by they
package. Goyacc then renders invalid Go code.