浏览代码

check that regexp neko library can be loaded

Nicolas Cannasse 13 年之前
父节点
当前提交
c7a85f09c8
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      interp.ml

+ 6 - 0
interp.ml

@@ -1828,6 +1828,12 @@ let reg_lib =
 	let error() =
 		raise Builtin_error
 	in
+	(* try to load regexp first : we might fail if pcre is not installed *)
+	let neko = (match neko with 
+		| None -> None 
+		| Some neko ->
+			(try ignore(neko.load "regexp@regexp_new_options" 2); Some neko with _ -> None)
+	) in
 	match neko with
 	| None ->
 	make_library [