diff --git a/src/lib_base/cli_entries.ml b/src/lib_base/cli_entries.ml index 3d04fd6ae..63b17e982 100644 --- a/src/lib_base/cli_entries.ml +++ b/src/lib_base/cli_entries.ml @@ -299,7 +299,7 @@ let help_group = let string_contains ~needle ~haystack = try - Some (Str.search_forward (Str.regexp_string needle) haystack 0) + Some Re_str.(search_forward (regexp_string needle) haystack 0) with Not_found -> None @@ -615,18 +615,18 @@ let print_highlight highlight_strings formatter str = let rec print_string = function | [] -> Format.fprintf formatter "%s" str | regex :: tl -> - begin match Str.full_split regex str with + begin match Re_str.full_split regex str with | [] - | [ Str.Text _ ] -> print_string tl + | [ Re_str.Text _ ] -> print_string tl | list -> List.iter (function - | Str.Text text -> Format.fprintf formatter "%s" text - | Str.Delim delimiter -> + | Re_str.Text text -> Format.fprintf formatter "%s" text + | Re_str.Delim delimiter -> Format.fprintf formatter "@{%s@}" delimiter) list end - in print_string (List.map 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 @@ -1121,7 +1121,7 @@ let autocomplete ~script ~cur_arg ~prev_arg ~args ~tree ~global_options cctxt = end end >>|? fun completions -> List.filter - (fun completion -> Str.string_match (Str.regexp_string cur_arg) completion 0) + (fun completion -> Re_str.(string_match (regexp_string cur_arg) completion 0)) completions (* Try a list of commands on a list of arguments *) diff --git a/src/lib_base/jbuild b/src/lib_base/jbuild index 47dde2ada..c59b4c5a9 100644 --- a/src/lib_base/jbuild +++ b/src/lib_base/jbuild @@ -18,6 +18,7 @@ tezos-rpc tezos-micheline tezos-protocol-environment-sigs + re.str calendar ezjsonm lwt.unix diff --git a/src/lib_client_base/client_commands.ml b/src/lib_client_base/client_commands.ml index dc19c848e..3214e52d6 100644 --- a/src/lib_client_base/client_commands.ml +++ b/src/lib_client_base/client_commands.ml @@ -91,7 +91,7 @@ class file_wallet dir : wallet = object (self) method private filename alias_name = Filename.concat dir - (Str.(global_replace (regexp_string " ") "_" alias_name) ^ "s") + (Re_str.(global_replace (regexp_string " ") "_" alias_name) ^ "s") method load : type a. string -> default:a -> a Data_encoding.encoding -> a tzresult Lwt.t = fun alias_name ~default encoding -> diff --git a/src/lib_client_base/client_keys.ml b/src/lib_client_base/client_keys.ml index b58cf359a..e33bf035d 100644 --- a/src/lib_client_base/client_keys.ml +++ b/src/lib_client_base/client_keys.ml @@ -197,8 +197,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 = Str.regexp (String.concat "\\|" containing) in - (fun key -> try ignore (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 diff --git a/src/proto_alpha/lib_protocol/test/test_michelson.ml b/src/proto_alpha/lib_protocol/test/test_michelson.ml index 7d0fc1376..24bd2828a 100644 --- a/src/proto_alpha/lib_protocol/test/test_michelson.ml +++ b/src/proto_alpha/lib_protocol/test/test_michelson.ml @@ -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 = Str.global_replace (Str.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