A Location represents a span of byte offsets in the source text.
type Location struct { Pos, End int // End is exclusive }
A Map represents a mapping between token locations in an input source text and locations in the correspnding output text.
type Map map[Location]Location
func Compute(input, output []byte) (Map, error)
Compute constructs a location mapping from input to output. An error is reported if any of the tokens of output cannot be mapped.
func (m Map) Find(pos, end int) (Location, bool)
Find reports whether the specified span is recorded by m, and if so returns the new location it was mapped to. If the input span was not found, the returned location is the same as the input.