summaryrefslogtreecommitdiffstats
path: root/toplevel/toploop.ml
diff options
context:
space:
mode:
Diffstat (limited to 'toplevel/toploop.ml')
-rw-r--r--toplevel/toploop.ml12
1 files changed, 7 insertions, 5 deletions
diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
index 503a11e5e..2dea9cf02 100644
--- a/toplevel/toploop.ml
+++ b/toplevel/toploop.ml
@@ -28,6 +28,7 @@ type directive_fun =
| Directive_int of (int -> unit)
| Directive_ident of (Longident.t -> unit)
| Directive_bool of (bool -> unit)
+ | Directive_generic of (Parsetree.directive_argument list -> unit)
(* The table of toplevel value bindings and its accessors *)
@@ -282,11 +283,12 @@ let execute_phrase print_outcome ppf phr =
| Ptop_dir(dir_name, dir_arg) ->
try
match (Hashtbl.find directive_table dir_name, dir_arg) with
- | (Directive_none f, Pdir_none) -> f (); true
- | (Directive_string f, Pdir_string s) -> f s; true
- | (Directive_int f, Pdir_int n) -> f n; true
- | (Directive_ident f, Pdir_ident lid) -> f lid; true
- | (Directive_bool f, Pdir_bool b) -> f b; true
+ | (Directive_none f, []) -> f (); true
+ | (Directive_string f, [Pdir_string s]) -> f s; true
+ | (Directive_int f, [Pdir_int n]) -> f n; true
+ | (Directive_ident f, [Pdir_ident lid]) -> f lid; true
+ | (Directive_bool f, [Pdir_bool b]) -> f b; true
+ | (Directive_generic f, l) -> f l; true
| (_, _) ->
fprintf ppf "Wrong type of argument for directive `%s'.@." dir_name;
false