type ScopeMarker … // checkPos validates the given position and returns the current scope. func (m *ScopeMarker) checkPos(pos src.XPos) ir.ScopeID { … } // Push records a transition to a new child scope of the current scope. func (m *ScopeMarker) Push(pos src.XPos) { … } // Pop records a transition back to the current scope's parent. func (m *ScopeMarker) Pop(pos src.XPos) { … } // Unpush removes the current scope, which must be empty. func (m *ScopeMarker) Unpush() { … } // WriteTo writes the recorded scope marks to the given function, // and resets the marker for reuse. func (m *ScopeMarker) WriteTo(fn *ir.Func) { … } func (m *ScopeMarker) compactMarks() { … }