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
Assignees

Comments

@alandonovan
Copy link
Contributor

@alandonovan alandonovan commented Dec 11, 2015

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

@gopherbot gopherbot commented Dec 12, 2015

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

@rsc
Copy link
Contributor

@rsc 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 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.