Commit 0f72e798 authored by Alan Donovan's avatar Alan Donovan
Browse files

go/token: add (*File).LineStart, which returns Pos for a given line

LineStart returns the position of the start of a given line.
Like MergeLine, it panics if the 1-based line number is invalid.

This function is especially useful in programs that occasionally
handle non-Go files such as assembly but wish to use the token.Pos
mechanism to identify file positions.

Change-Id: I5f774c0690074059553cdb38c0f681f5aafc8da1
Reviewed-on: https://go-review.googlesource.com/134075


Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent 12c5ca90
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment