|
@@ -341,7 +341,15 @@ let setup get_api =
|
|
let api = get_api (fun() -> (get_ctx()).curapi.get_com()) (fun() -> (get_ctx()).curapi) in
|
|
let api = get_api (fun() -> (get_ctx()).curapi.get_com()) (fun() -> (get_ctx()).curapi) in
|
|
List.iter (fun (n,v) -> match v with
|
|
List.iter (fun (n,v) -> match v with
|
|
| VFunction(f,b) ->
|
|
| VFunction(f,b) ->
|
|
- let v = VFunction ((fun vl -> try f vl with Sys_error msg | Failure msg -> exc_string msg),b) in
|
|
|
|
|
|
+ let f vl = try
|
|
|
|
+ f vl
|
|
|
|
+ with
|
|
|
|
+ | Sys_error msg | Failure msg ->
|
|
|
|
+ exc_string msg
|
|
|
|
+ | MacroApi.Invalid_expr ->
|
|
|
|
+ exc_string "Invalid expression"
|
|
|
|
+ in
|
|
|
|
+ let v = VFunction (f,b) in
|
|
Hashtbl.replace EvalStdLib.macro_lib n v
|
|
Hashtbl.replace EvalStdLib.macro_lib n v
|
|
| _ -> assert false
|
|
| _ -> assert false
|
|
) api;
|
|
) api;
|