Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
go/printer: consider using last position for nodes with no position #28988
Reminder issue to experiment with using the last known (end) position for nodes where we don't have a position (and where NoPos is not used to indicate absence of a token).
From e-mail conversation with @aclements:
I was discussing this a bit with @rsc and the thought we had was that since NoPos indicates (usually) that you don't know the position of the token, then the printer should also think of that token as consuming no space. Hence, the printer simply shouldn't update its notion of where it is in the output file.