Browse Source

String.index_opt is in future

Aleksandr Kuzmenko 6 years ago
parent
commit
9fcd8a2023
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/syntax/semver.ml

+ 2 - 1
src/syntax/semver.ml

@@ -60,7 +60,8 @@ let parse_version s =
 			| [SVNum _ as major] -> (major, SVNum 0, SVNum 0)
 			| _ -> error()
 	in
-	match String.index_opt s '-' with
+	let index = try Some (String.index s '-') with Not_found -> None in
+	match index with
 		(* 1.2.3 *)
 		| None -> (parse_release s), None
 		(* 1.2.3- *)