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

Closed
josharian opened this issue May 31, 2016 · 2 comments
Closed

cmd/compile: add and use yyerrorn #15913

josharian opened this issue May 31, 2016 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@josharian
Copy link
Contributor

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
Copy link
Contributor Author

And maybe we can drop the yy prefix. :)

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 6, 2016
@rsc rsc modified the milestones: Unplanned, Go1.8Early Oct 17, 2016
@mdempsky
Copy link
Member

We have WarnfAt, ErrorfAt, and FatalfAt now. So this is fixed.

@golang golang locked and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants