@@ -183,9 +183,7 @@ module AST = struct
183183
184184 let is_file f =
185185 let fname = (get_func f).method_name in
186- if Str. string_match (Str. regexp " java\\ .io\\ .File\\ .<init>" ) fname 0 then
187- true
188- else false
186+ if Str. string_match Regexp. java_file fname 0 then true else false
189187
190188 (* ************************************** *
191189 Checking for Synthesis Rules
@@ -532,12 +530,11 @@ module AST = struct
532530 * ************************************** *)
533531
534532 let get_method_name m =
535- Regexp. first_rm ( Str. regexp " (.*) " ) m
533+ Regexp. first_rm Regexp. method_params m
536534 |> Str. split Regexp. dot |> List. rev |> List. hd
537535
538536 let get_short_class_name c =
539- Regexp. first_rm (Str. regexp " \\ .<init>(.*)" ) c
540- |> Str. split Regexp. dot |> List. rev |> List. hd
537+ Regexp. first_rm Regexp. init c |> Str. split Regexp. dot |> List. rev |> List. hd
541538
542539 let array_code dim content =
543540 let rec code d = if d = 0 then " " else " [" ^ content ^ " ]" ^ code (d - 1 ) in
@@ -578,7 +575,7 @@ module AST = struct
578575 if is_array_init func then
579576 Utils. rm_object_array_import f.typ
580577 |> Str. split Regexp. dot |> List. rev |> List. hd
581- |> Regexp. first_rm ( Str. regexp " Array[0-9]* " )
578+ |> Regexp. first_rm Regexp. modeling_array
582579 |> Utils. get_array_class_name |> String. cat " new "
583580 else if is_array_set func then " "
584581 else if Utils. is_init_method f.method_name then
@@ -661,9 +658,9 @@ module AST = struct
661658 | C c -> " \' " ^ String. make 1 c ^ " \' "
662659 | S s ->
663660 let replace s =
664- Str. global_replace ( Str. regexp " \\ " ) " \\\\\\\\ " s
665- |> Str. global_replace ( Str. regexp " \" " ) " \\\" "
666- |> Str. global_replace ( Str. regexp " \' " ) " \\\' "
661+ Str. global_replace Regexp. backslash " \\\\\\\\ " s
662+ |> Str. global_replace Regexp. double_quote " \\\" "
663+ |> Str. global_replace Regexp. single_quote " \\\' "
667664 in
668665 " \" " ^ replace s ^ " \" "
669666
0 commit comments