From 72b9a7df489ea47b3e5470741fd39f6100d31676 Mon Sep 17 00:00:00 2001 From: Samuel Mimram Date: Sat, 18 Aug 2007 20:34:57 +0000 Subject: Imported Upstream version 8.1.pl1+dfsg --- interp/notation.ml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'interp/notation.ml') diff --git a/interp/notation.ml b/interp/notation.ml index 7d70b296..08c6f31f 100644 --- a/interp/notation.ml +++ b/interp/notation.ml @@ -6,7 +6,7 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -(* $Id: notation.ml 9481 2007-01-11 19:17:56Z herbelin $ *) +(* $Id: notation.ml 9694 2007-03-09 18:09:53Z herbelin $ *) (*i*) open Util @@ -393,8 +393,14 @@ let uninterp_prim_token_cases_pattern c = | Some n -> (na,sc,n) with Not_found -> raise No_match -let availability_of_prim_token printer_scope local_scopes = - let f scope = Hashtbl.mem prim_token_interpreter_tab scope in +let availability_of_prim_token printer_scope local_scopes t = + let f scope = + try + (* raise Not_found if no primitive interpreter for scope *) + let interp = Hashtbl.find prim_token_interpreter_tab scope in + (* raise Not_found if no primitive interpreter for this token in scope *) + let _ = interp dummy_loc t in true + with Not_found -> false in let scopes = make_current_scopes local_scopes in option_map snd (find_without_delimiters f (Some printer_scope,None) scopes) -- cgit v1.2.3