summaryrefslogtreecommitdiffstats
path: root/camlp4/examples/global_handler.ml
diff options
context:
space:
mode:
Diffstat (limited to 'camlp4/examples/global_handler.ml')
-rw-r--r--camlp4/examples/global_handler.ml33
1 files changed, 0 insertions, 33 deletions
diff --git a/camlp4/examples/global_handler.ml b/camlp4/examples/global_handler.ml
deleted file mode 100644
index 08957fb80..000000000
--- a/camlp4/examples/global_handler.ml
+++ /dev/null
@@ -1,33 +0,0 @@
-(****************************************************************************)
-(* *)
-(* OCaml *)
-(* *)
-(* INRIA Rocquencourt *)
-(* *)
-(* Copyright 2006 Institut National de Recherche en Informatique et *)
-(* en Automatique. All rights reserved. This file is distributed under *)
-(* the terms of the GNU Library General Public License, with the special *)
-(* exception on linking described in LICENSE at the top of the OCaml *)
-(* source tree. *)
-(* *)
-(****************************************************************************)
-
-open Camlp4.PreCast;
-
-value ghost = Loc.ghost;
-
-value global_handler_ref = ref <:expr@ghost<>>;
-
-value find_global_handler =
- Ast.map_str_item begin
- fun
- [ <:str_item@_loc< value global_handler = $f$ >> ->
- (global_handler_ref.val := f; <:str_item<>>)
- | st -> st ]
- end;
-
-AstFilters.register_str_item_filter begin fun st ->
- let _ = find_global_handler#str_item st in
- <:str_item@ghost< try let module Main = struct $st$ end in ()
- with e -> $global_handler_ref.val$ e >>
-end;