From 7c793c80721ff0b0a1d2898ba93721aa03aa4a98 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 29 Jul 2010 15:09:38 +0000 Subject: [PATCH] interpret non ambiguous symbols ASAP --- .../components/disambiguation/disambiguate.ml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/helm/software/components/disambiguation/disambiguate.ml b/helm/software/components/disambiguation/disambiguate.ml index 5ac709f9b..d0d7460a6 100644 --- a/helm/software/components/disambiguation/disambiguate.ml +++ b/helm/software/components/disambiguation/disambiguate.ml @@ -447,6 +447,21 @@ let disambiguate_thing fix_instance item (Environment.find item e) with Not_found -> []) in + + (* items with 1 choice are interpreted ASAP *) + let aliases, todo_dom = + let rec aux (aliases,acc) = function + | [] -> aliases, acc + | (Node (_, item,extra) as node) :: tl -> + let tl = tl @ extra in + let choices = lookup_choices item in + if List.length choices <> 1 then aux (aliases, acc@[node]) tl + else if Environment.mem item aliases then aux (aliases, acc) tl + else aux (Environment.add item (List.hd choices) aliases, acc) tl + in + aux (aliases,[]) todo_dom + in + (* (* *) let _ = -- 2.39.5