Browse Source

check that regexp neko library can be loaded

Nicolas Cannasse 13 years ago
parent
commit
c7a85f09c8
1 changed files with 6 additions and 0 deletions
  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 [