- let rec find_symbol idref = function
- | A.AttributedTerm (`Loc _, t) -> find_symbol None t
- | A.AttributedTerm (`IdRef id, t) -> find_symbol (Some id) t
- | A.Symbol (name, _) ->
- (match idref with
- | None -> assert false
- | Some idref -> `Symbol (name, idref))
- | _ -> `None
- in