ClearUnusedIDs removes IDs not used in the AST or macro calls from SourceInfo.
()
| 182 | |
| 183 | // ClearUnusedIDs removes IDs not used in the AST or macro calls from SourceInfo. |
| 184 | func (a *AST) ClearUnusedIDs() { |
| 185 | ids := a.IDs() |
| 186 | for id := range a.SourceInfo().OffsetRanges() { |
| 187 | if !ids[id] { |
| 188 | a.SourceInfo().ClearOffsetRange(id) |
| 189 | } |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | // Heights computes the heights of all AST expressions and returns a map from expression id to height. |
| 194 | func Heights(a *AST) map[int64]int { |
no test coverage detected