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/compile: add and use yyerrorn #15913

Open
josharian opened this Issue May 31, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@josharian
Contributor

josharian commented May 31, 2016

Lots of places in cmd/compile, we do:

setlineno(n)
Yyerror(...)

Sometimes we forget setlineno, and the error ends up on the wrong line, or it ends up on the right line but only because the global line number happens to be correct. Sometimes we do yyerrorl(n.Lineno instead, but that ignores the special handling found in setlineno; yyerrorl is really meant for use in the lexer, before we have a well-formed AST to work from. And the global line number will have to go away as part of #15756.

This issue is a reminder to myself to add yyerrorn that just wraps setlineno; Yyerror early in Go 1.8 and attempt to use it throughout the tree.

@josharian josharian added this to the Go1.8Early milestone May 31, 2016

@josharian josharian self-assigned this May 31, 2016

@josharian

This comment has been minimized.

Contributor

josharian commented May 31, 2016

And maybe we can drop the yy prefix. :)

@quentinmit quentinmit added the NeedsFix label Oct 6, 2016

@rsc rsc modified the milestones: Unplanned, Go1.8Early Oct 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment