ClearUnusedIDs removes IDs not used in the AST or macro calls from SourceInfo.
()
| 174 | |
| 175 | // ClearUnusedIDs removes IDs not used in the AST or macro calls from SourceInfo. |
| 176 | func (a *AST) ClearUnusedIDs() { |
| 177 | ids := a.IDs() |
| 178 | for id := range a.SourceInfo().OffsetRanges() { |
| 179 | if !ids[id] { |
| 180 | a.SourceInfo().ClearOffsetRange(id) |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | // Heights computes the heights of all AST expressions and returns a map from expression id to height. |
| 186 | func Heights(a *AST) map[int64]int { |
no test coverage detected