Lines Matching defs:offset
79 s.v.Start.Offset, err = offset(f, r.Start)
84 s.v.End.Offset, err = offset(f, r.End)
96 // offset is a copy of the Offset function in go/token, but with the adjustment
98 func offset(f *token.File, pos token.Pos) (int, error) {
112 // go/token will panic if the offset is larger than the file's size,
115 return Range{}, fmt.Errorf("start offset %v is past the end of the file %v", s.Start(), converter.file.Size())
118 return Range{}, fmt.Errorf("end offset %v is past the end of the file %v", s.End(), converter.file.Size())
127 func (l *TokenConverter) ToPosition(offset int) (int, int, error) {
128 if offset > l.file.Size() {
129 return 0, 0, fmt.Errorf("offset %v is past the end of the file %v", offset, l.file.Size())
131 pos := l.file.Pos(offset)
133 if offset == l.file.Size() {
160 return offset(l.file, pos)