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

go/ast: the position of "range" keyword is lost during parsing #13590

Closed
alandonovan opened this issue Dec 11, 2015 · 2 comments
Closed

go/ast: the position of "range" keyword is lost during parsing #13590

alandonovan opened this issue Dec 11, 2015 · 2 comments

Comments

@alandonovan
Copy link
Contributor

Although the AST does not record the entire concrete syntax, it does record most of the important tokens. The position of the "range" token can't be reliably reconstructed from an ast.RangeStmt, and I need to use it to indicate the location of an implicit channel receive operation. I propose to add a 'Range token.Pos' field to ast.RangeStmt and set it in the parser.

@gopherbot
Copy link

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

@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

Closing per discussion on CL 17770. (Suggestion is to use RangeStmt.X.Pos() or if X==nil then RangeStmt.Body.Lbrace, and work backward from there.)

@rsc rsc closed this as completed Dec 28, 2015
@golang golang locked and limited conversation to collaborators Dec 29, 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

4 participants