From b0d9678f24255554e763da3e594868da72e858b6 Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 15 Jul 2010 09:26:00 +0000 Subject: Extraction: fix a bit the extraction under modules Extraction under modules is highly experimental, and just work a bit. Don't expect too much of it. With this commit, I simply avoid a few "assert false" to occur when we are under modules. But things are still quite wrong, for instance with: Definition foo. Module M. Definition bar := foo. Recursive Extraction bar. Extraction of bar is ok, but foo isn't displayed, since extraction can't get it: Lib.contents_after doesn't mention it, it is probably in some frozen summary. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13281 85f007b7-540e-0410-9357-904b9bb8a0f7 --- plugins/extraction/modutil.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/extraction/modutil.ml') diff --git a/plugins/extraction/modutil.ml b/plugins/extraction/modutil.ml index 4ed6e9a084..8bc98e4520 100644 --- a/plugins/extraction/modutil.ml +++ b/plugins/extraction/modutil.ml @@ -185,7 +185,7 @@ let signature_of_structure s = (*s Searching one [ml_decl] in a [ml_structure] by its [global_reference] *) let get_decl_in_structure r struc = - try + try let base_mp,ll = labels_of_ref r in if not (at_toplevel base_mp) then error_not_visible r; let sel = List.assoc base_mp struc in @@ -200,7 +200,8 @@ let get_decl_in_structure r struc = | MEstruct (_,sel) -> go ll sel | _ -> error_not_visible r in go ll sel - with Not_found -> assert false + with Not_found -> + anomaly "reference not found in extracted structure" (*s Optimization of a [ml_structure]. *) -- cgit v1.2.3