Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/yacc: In 1.5 yacc generate wrong code for '"' token #12086

Closed
mlitvin opened this issue Aug 9, 2015 · 4 comments
Closed

cmd/yacc: In 1.5 yacc generate wrong code for '"' token #12086

mlitvin opened this issue Aug 9, 2015 · 4 comments
Milestone

Comments

@mlitvin
Copy link

mlitvin commented Aug 9, 2015

For the following input:

%{
package parser
%}
%%
input: '"'

yacc 1.5rc1 generate a code containing

var yyToknames = [...]string{
        "$end",
        "error",
        "$unk",
        "'"'",
}

The last line doesn't compile.

The 1.4 yacc doesn't generate a token name for '"' so there are no problems.

@ianlancetaylor ianlancetaylor changed the title In 1.5 yacc generate wrong code for '"' token cmd/yacc: In 1.5 yacc generate wrong code for '"' token Aug 9, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Aug 9, 2015
@mlitvin
Copy link
Author

mlitvin commented Aug 10, 2015

Why 1.6? This is quite ugly (the tool generate code that doesn't compile, and it seems like a save one liner to fix it).

It seems quite a big degradation in a feature that the release notes doesn't even mention as changed.

@robpike
Copy link
Contributor

robpike commented Aug 10, 2015

The fix is trivial. I agree it belongs in 1.5 as it was a recent breaking change. CL coming.

@gopherbot
Copy link

CL https://golang.org/cl/13462 mentions this issue.

@mlitvin
Copy link
Author

mlitvin commented Aug 10, 2015

Thanks! (and sorry for not testing it earlier than rc1)

@mikioh mikioh modified the milestones: Go1.5, Go1.6 Aug 11, 2015
@golang golang locked and limited conversation to collaborators Aug 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants