type lineRange … type xposmap … // newXposmap constructs an xposmap valid for inputs which have a file index in the keys of x, // and line numbers in the range x[file index]. // The resulting xposmap will panic if a caller attempts to set or add an XPos not in that range. func newXposmap(x map[int]lineRange) *xposmap { … } // clear removes data from the map but leaves the sparse skeleton. func (m *xposmap) clear() { … } // mapFor returns the line range map for a given file index. func (m *xposmap) mapFor(index int32) *biasedSparseMap { … } // set inserts p->v into the map. // If p does not fall within the set of fileindex->lineRange used to construct m, this will panic. func (m *xposmap) set(p src.XPos, v int32) { … } // get returns the int32 associated with the file index and line of p. func (m *xposmap) get(p src.XPos) int32 { … } // add adds p to m, treating m as a set instead of as a map. // If p does not fall within the set of fileindex->lineRange used to construct m, this will panic. // Use clear() in between set/map interpretations of m. func (m *xposmap) add(p src.XPos) { … } // contains returns whether the file index and line of p are in m, // treating m as a set instead of as a map. func (m *xposmap) contains(p src.XPos) bool { … } // remove removes the file index and line for p from m, // whether m is currently treated as a map or set. func (m *xposmap) remove(p src.XPos) { … } // foreachEntry applies f to each (fileindex, line, value) triple in m. func (m *xposmap) foreachEntry(f func(j int32, l uint, v int32)) { … }