Fix compilation with recent 're' Re.Str
This commit is contained in:
parent
ad330db7e1
commit
b50d96ec2b
@ -158,18 +158,18 @@ let print_highlight highlight_strings formatter str =
|
|||||||
let rec print_string = function
|
let rec print_string = function
|
||||||
| [] -> Format.fprintf formatter "%s" str
|
| [] -> Format.fprintf formatter "%s" str
|
||||||
| regex :: tl ->
|
| 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 ->
|
||||||
List.iter
|
List.iter
|
||||||
(function
|
(function
|
||||||
| Re_str.Text text -> Format.fprintf formatter "%s" text
|
| Re.Str.Text text -> Format.fprintf formatter "%s" text
|
||||||
| Re_str.Delim delimiter ->
|
| Re.Str.Delim delimiter ->
|
||||||
Format.fprintf formatter "@{<hilight>%s@}" delimiter)
|
Format.fprintf formatter "@{<hilight>%s@}" delimiter)
|
||||||
list
|
list
|
||||||
end
|
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 print_commandline ppf (highlights, options, args) =
|
||||||
let rec print
|
let rec print
|
||||||
@ -746,7 +746,7 @@ let string ~name ~desc next =
|
|||||||
|
|
||||||
let string_contains ~needle ~haystack =
|
let string_contains ~needle ~haystack =
|
||||||
try
|
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 ->
|
with Not_found ->
|
||||||
None
|
None
|
||||||
|
|
||||||
@ -1093,7 +1093,7 @@ let autocompletion ~script ~cur_arg ~prev_arg ~args ~global_options commands cct
|
|||||||
end
|
end
|
||||||
end >>|? fun completions ->
|
end >>|? fun completions ->
|
||||||
List.filter
|
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
|
completions
|
||||||
|
|
||||||
let parse_global_options global_options ctx args =
|
let parse_global_options global_options ctx args =
|
||||||
|
@ -19,6 +19,7 @@ depends: [
|
|||||||
"ezjsonm" { >= "0.5.0" }
|
"ezjsonm" { >= "0.5.0" }
|
||||||
"ipaddr"
|
"ipaddr"
|
||||||
"mtime" { >= "1.0.0" }
|
"mtime" { >= "1.0.0" }
|
||||||
|
"re" { >= "1.7.2" }
|
||||||
]
|
]
|
||||||
build: [
|
build: [
|
||||||
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
[ "jbuilder" "build" "-p" name "-j" jobs ]
|
||||||
|
@ -202,8 +202,8 @@ let gen_keys_containing ?(prefix=false) ?(force=false) ~containing ~name (cctxt
|
|||||||
String.sub key 0 (String.length containing) = containing)
|
String.sub key 0 (String.length containing) = containing)
|
||||||
containing_tz1)
|
containing_tz1)
|
||||||
else
|
else
|
||||||
let re = Re_str.regexp (String.concat "\\|" containing) in
|
let re = Re.Str.regexp (String.concat "\\|" containing) in
|
||||||
(fun key -> try ignore (Re_str.search_forward re key 0); true
|
(fun key -> try ignore (Re.Str.search_forward re key 0); true
|
||||||
with Not_found -> false) in
|
with Not_found -> false) in
|
||||||
let rec loop attempts =
|
let rec loop attempts =
|
||||||
let seed = Ed25519.Seed.generate () in
|
let seed = Ed25519.Seed.generate () in
|
||||||
|
@ -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 test ctxt ?tc (file_name: string) (storage: string) (input: string) =
|
||||||
let full_path = contract_path // file_name ^ ".tz" in
|
let full_path = contract_path // file_name ^ ".tz" in
|
||||||
let file = Helpers_misc.read_file full_path 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
|
let program = "{" ^ spaced_file ^ "}" in
|
||||||
parse_execute ctxt ?tc program input storage
|
parse_execute ctxt ?tc program input storage
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user