func (f *SourceFile) find_line(offset int) source_line {
	beg, end := 0, len(f.lines)
	for {
		len := end - beg
		if len == 1 {
			return f.lines[beg]
		}
		mid := beg + len/2
		if f.lines[mid].offset > offset {
			end = mid
			continue
		} else {
			beg = mid
			continue
		}
	}
	panic("unreachable")
}
Find line for a given file offset.
package sexp
type SourceLoc uint32
type SourceLocEx struct {
	Filename   string
	Line       int  
	LineOffset int  
	Offset     int  
}
type source_line struct {
	offset int  
	num    int  
}
type SourceFile struct {
	name   string
	offset SourceLoc  
	length int
	lines  []source_line
}
func (f *SourceFile) last_line() source_line {
	return f.lines[len(f.lines)-1]
}