tools/cmd/goyacc: goyacc generates a parser routine $$Tokname that doesn't work #44556
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/dswartz/.cache/go-build" GOENV="/home/dswartz/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/dswartz/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/dswartz/go" GOPRIVATE="" GOPROXY="direct" GOROOT="/usr/lib/golang" GOSUMDB="off" GOTMPDIR="" GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build943484181=/tmp/go-build -gno-record-gcc-switches"What did you do?
A trivial yacc grammar with the following tokens:
%token ABLE
%token BAKER
%token CHARLIE
The main function call fmt.Printf with the output of yyTokname (passing in the token const)
What did you expect to see?
ABLE => "ABLE"
BAKER => "BAKER"
CHARLIE => "CHARLIE"
What did you see instead?
ABLE => "tok-57346"
BAKER => "tok-57347"
CHARLIE => "tok-57348"
The text was updated successfully, but these errors were encountered: