Fix compilation with recent 're' Re.Str

This commit is contained in:
Grégoire Henry 2018-03-07 08:40:02 +01:00
parent ad330db7e1
commit b50d96ec2b
4 changed files with 11 additions and 10 deletions

View File

@ -158,18 +158,18 @@ let print_highlight highlight_strings formatter str =
let rec print_string = function
| [] -> Format.fprintf formatter "%s" str
| regex :: tl ->
begin match Re_str.full_split regex str with
begin match Re.Str.full_split regex str with
| []
| [ Re_str.Text _ ] -> print_string tl
| [ Re.Str.Text _ ] -> print_string tl
| list ->
List.iter
(function
| Re_str.Text text -> Format.fprintf formatter "%s" text
| Re_str.Delim delimiter ->
| Re.Str.Text text -> Format.fprintf formatter "%s" text
| Re.Str.Delim delimiter ->
Format.fprintf formatter "@{<hilight>%s@}" delimiter)
list
end
in print_string (List.map Re_str.regexp_string highlight_strings)
in print_string (List.map Re.Str.regexp_string highlight_strings)
let print_commandline ppf (highlights, options, args) =
let rec print
@ -746,7 +746,7 @@ let string ~name ~desc next =
let string_contains ~needle ~haystack =
try
Some (Re_str.search_forward (Re_str.regexp_string needle) haystack 0)
Some (Re.Str.search_forward (Re.Str.regexp_string needle) haystack 0)
with Not_found ->
None
@ -1093,7 +1093,7 @@ let autocompletion ~script ~cur_arg ~prev_arg ~args ~global_options commands cct
end
end >>|? fun completions ->
List.filter
(fun completion -> Re_str.(string_match (regexp_string cur_arg) completion 0))
(fun completion -> Re.Str.(string_match (regexp_string cur_arg) completion 0))
completions
let parse_global_options global_options ctx args =

View File

@ -19,6 +19,7 @@ depends: [
"ezjsonm" { >= "0.5.0" }
"ipaddr"
"mtime" { >= "1.0.0" }
"re" { >= "1.7.2" }
]
build: [
[ "jbuilder" "build" "-p" name "-j" jobs ]

View File

@ -202,8 +202,8 @@ let gen_keys_containing ?(prefix=false) ?(force=false) ~containing ~name (cctxt
String.sub key 0 (String.length containing) = containing)
containing_tz1)
else
let re = Re_str.regexp (String.concat "\\|" containing) in
(fun key -> try ignore (Re_str.search_forward re key 0); true
let re = Re.Str.regexp (String.concat "\\|" containing) in
(fun key -> try ignore (Re.Str.search_forward re key 0); true
with Not_found -> false) in
let rec loop attempts =
let seed = Ed25519.Seed.generate () in

View File

@ -55,7 +55,7 @@ let parse_execute sb ?tc code_str param_str storage_str =
let test ctxt ?tc (file_name: string) (storage: string) (input: string) =
let full_path = contract_path // file_name ^ ".tz" in
let file = Helpers_misc.read_file full_path in
let spaced_file = Re_str.(global_replace (regexp_string "\n") "\n " file) in
let spaced_file = Re.Str.(global_replace (regexp_string "\n") "\n " file) in
let program = "{" ^ spaced_file ^ "}" in
parse_execute ctxt ?tc program input storage