Permalink
Browse files

++ -> @

  • Loading branch information...
1 parent 2e3f693 commit 6804c2f9d4456b97a77d7b27e4119fbad108e446 @aryx aryx committed Feb 19, 2014
Showing with 365 additions and 376 deletions.
  1. +1 −1 code_graph/view_matrix.ml
  2. +4 −4 code_map/view_mainmap.ml
  3. +0 −5 commons/common.ml
  4. +0 −1 commons/common.mli
  5. +33 −33 commons/common2.ml
  6. +8 −8 graph_code/dependencies_matrix_build.ml
  7. +5 −5 graph_code/layer_graph_code.ml
  8. +3 −3 h_program-lang/database_code.ml
  9. +16 −16 h_program-lang/highlight_code.ml
  10. +1 −1 h_program-lang/layer_code.ml
  11. +2 −2 h_program-lang/layer_coverage.ml
  12. +1 −1 h_program-lang/skip_code.ml
  13. +8 −8 h_program-visual/main_program_visual.ml
  14. +1 −1 h_version-control/git.ml
  15. +7 −7 h_version-control/main_vcs.ml
  16. +2 −2 h_version-control/patch.ml
  17. +8 −8 h_visualization/graphics/main_treemap.ml
  18. +9 −9 h_visualization/treemap.ml
  19. +2 −2 lang_bytecode/analyze/graph_code_bytecode.ml
  20. +1 −1 lang_c/analyze/graph_code_c.ml
  21. +3 −3 lang_c/parsing/ast_c_simple_build.ml
  22. +9 −9 lang_cpp/parsing/parser_cpp_mly_helper.ml
  23. +1 −1 lang_cpp/parsing/parsing_hacks_cpp.ml
  24. +2 −2 lang_cpp/parsing/parsing_recovery_cpp.ml
  25. +1 −1 lang_cpp/parsing/unit_parsing_cpp.ml
  26. +8 −10 lang_css/parsing/parser_css.mly
  27. +1 −1 lang_html/parsing/export_html.ml
  28. +2 −3 lang_html/parsing/parser_html.mly
  29. +18 −18 lang_java/analyze/graph_code_java.ml
  30. +1 −1 lang_js/analyze/tags_js.ml
  31. +18 −18 lang_js/parsing/parser_js.mly
  32. +17 −17 lang_ml/analyze/graph_code_cmt.ml
  33. +28 −28 lang_ml/parsing/parser_ml.mly
  34. +1 −1 lang_objc/parsing/unit_parsing_objc.ml
  35. +3 −3 lang_php/analyze/checker/check_variables_php.ml
  36. +2 −2 lang_php/analyze/checker/unit_checker_php.ml
  37. +3 −3 lang_php/analyze/foundation/ast_php_simple_build.ml
  38. +26 −26 lang_php/analyze/foundation/builtins_php.ml
  39. +1 −1 lang_php/analyze/foundation/class_php.ml
  40. +2 −2 lang_php/analyze/foundation/comment_php.ml
  41. +3 −3 lang_php/analyze/foundation/graph_code_php.ml
  42. +1 −1 lang_php/analyze/foundation/include_require_php.ml
  43. +2 −2 lang_php/analyze/foundation/unit_foundation_php.ml
  44. +1 −1 lang_php/matcher/matching_php.ml
  45. +1 −1 lang_php/matcher/transforming_php.ml
  46. +1 −1 lang_php/parsing/pp_php.ml
  47. +3 −5 lang_sql/parsing/parser_sql.mly
  48. +30 −30 main.ml
  49. +6 −6 main_codegraph.ml
  50. +11 −11 main_codemap.ml
  51. +4 −4 main_codequery.ml
  52. +7 −7 main_db.ml
  53. +5 −5 main_scheck.ml
  54. +5 −5 main_sgrep.ml
  55. +4 −4 main_spatch.ml
  56. +4 −4 main_stags.ml
  57. +13 −13 main_test.ml
  58. +3 −3 matcher/lib_unparser.ml
  59. +1 −1 matcher/matching_fuzzy.ml
  60. +1 −1 matcher/transforming_fuzzy.ml
@@ -513,7 +513,7 @@ let recompute_matrix w =
paint w;
()
-let add_path x path = path ++ [x]
+let add_path x path = path @ [x]
let button_action _da w ev =
let (x, y) = GdkEvent.Button.x ev, GdkEvent.Button.y ev in
View
@@ -257,16 +257,16 @@ let button_action da dw_ref ev =
!Ctl._go_dirs_or_file dw_ref (paths_of_readables [readable]);));
`I ("deps inout", (fun () ->
!Ctl._go_dirs_or_file dw_ref (paths_of_readables
- (uses ++ users ++ [readable]))));
+ (uses @ users @ [readable]))));
`I ("deps in (users)", (fun () ->
!Ctl._go_dirs_or_file dw_ref (paths_of_readables
- (users ++ [readable]))));
+ (users @ [readable]))));
`I ("deps out (uses)", (fun () ->
!Ctl._go_dirs_or_file dw_ref (paths_of_readables
- (uses ++ [readable]))));
+ (uses @ [readable]))));
] in
let entries =
- entries ++
+ entries @
(match entity_opt, model.g with
| None, _ -> []
| Some e, Some g ->
View
@@ -595,11 +595,6 @@ let mk_action_4_arg f =
let mk_action_n_arg f = f
-(* ---------------------------------------------------------------------- *)
-
-let (++) a b =
- profile_code "++" (fun () -> a @ b)
-
(*****************************************************************************)
(* Equality *)
(*****************************************************************************)
View
@@ -65,7 +65,6 @@ val cmd_to_list : ?verbose:bool -> string -> string list (* alias *)
val cmd_to_list_and_status:
?verbose:bool -> string -> string list * Unix.process_status
-val ( ++ ) : 'a list -> 'a list -> 'a list
val null : 'a list -> bool
val exclude : ('a -> bool) -> 'a list -> 'a list
val sort : 'a list -> 'a list
View
@@ -593,7 +593,7 @@ let (test: string -> unit) = fun s ->
let (++) a b =
Common.profile_code "++" (fun () -> a @ b)
-let _ex = example3 "++" ([1;2]++[3;4;5] = [1;2;3;4;5])
+let _ex = example3 "++" ([1;2]@[3;4;5] = [1;2;3;4;5])
(*-------------------------------------------------------------------*)
(* Regression testing *)
@@ -2298,28 +2298,28 @@ let int_to_month i =
let month_info = [
- 1 , Jan, "Jan", "January", 31;
- 2 , Feb, "Feb", "February", 28;
- 3 , Mar, "Mar", "March", 31;
- 4 , Apr, "Apr", "April", 30;
- 5 , May, "May", "May", 31;
- 6 , Jun, "Jun", "June", 30;
- 7 , Jul, "Jul", "July", 31;
- 8 , Aug, "Aug", "August", 31;
- 9 , Sep, "Sep", "September", 30;
- 10 , Oct, "Oct", "October", 31;
- 11 , Nov, "Nov", "November", 30;
- 12 , Dec, "Dec", "December", 31;
+ 1, Jan, "Jan", "January", 31;
+ 2, Feb, "Feb", "February", 28;
+ 3, Mar, "Mar", "March", 31;
+ 4, Apr, "Apr", "April", 30;
+ 5, May, "May", "May", 31;
+ 6, Jun, "Jun", "June", 30;
+ 7, Jul, "Jul", "July", 31;
+ 8, Aug, "Aug", "August", 31;
+ 9, Sep, "Sep", "September", 30;
+ 10, Oct, "Oct", "October", 31;
+ 11, Nov, "Nov", "November", 30;
+ 12, Dec, "Dec", "December", 31;
]
let week_day_info = [
- 0 , Sunday , "Sun" , "Dim" , "Sunday";
- 1 , Monday , "Mon" , "Lun" , "Monday";
- 2 , Tuesday , "Tue" , "Mar" , "Tuesday";
- 3 , Wednesday , "Wed" , "Mer" , "Wednesday";
- 4 , Thursday , "Thu" ,"Jeu" ,"Thursday";
- 5 , Friday , "Fri" , "Ven" , "Friday";
- 6 , Saturday , "Sat" ,"Sam" , "Saturday";
+ 0, Sunday, "Sun", "Dim", "Sunday";
+ 1, Monday, "Mon", "Lun", "Monday";
+ 2, Tuesday, "Tue", "Mar", "Tuesday";
+ 3, Wednesday, "Wed", "Mer", "Wednesday";
+ 4, Thursday, "Thu","Jeu","Thursday";
+ 5, Friday, "Fri", "Ven", "Friday";
+ 6, Saturday, "Sat","Sam", "Saturday";
]
let i_to_month_h =
@@ -3889,7 +3889,7 @@ let rec all_assoc e = function
let prepare_want_all_assoc l =
List.map (fun n -> n, uniq (all_assoc n l)) (uniq (List.map fst l))
-let rotate list = List.tl list ++ [(List.hd list)]
+let rotate list = List.tl list @ [(List.hd list)]
let or_list = List.fold_left (||) false
let and_list = List.fold_left (&&) true
@@ -3909,11 +3909,11 @@ let rec splitAt n xs =
let pack n xs =
let rec pack_aux l i = function
| [] -> failwith "not on a boundary"
- | [x] -> if i =|= n then [l++[x]] else failwith "not on a boundary"
+ | [x] -> if i =|= n then [l@[x]] else failwith "not on a boundary"
| x::xs ->
if i =|= n
- then (l++[x])::(pack_aux [] 1 xs)
- else pack_aux (l++[x]) (i+1) xs
+ then (l@[x])::(pack_aux [] 1 xs)
+ else pack_aux (l@[x]) (i+1) xs
in
pack_aux [] 1 xs
@@ -4015,7 +4015,7 @@ let iter_with_before_after f xs =
(* kind of cartesian product of x*x *)
let rec (get_pair: ('a list) -> (('a * 'a) list)) = function
| [] -> []
- | x::xs -> (List.map (fun y -> (x,y)) xs) ++ (get_pair xs)
+ | x::xs -> (List.map (fun y -> (x,y)) xs) @ (get_pair xs)
(* retourne le rang dans une liste d'un element *)
@@ -4083,7 +4083,7 @@ let rec uncons_permut_lazy xs =
let rec map_flatten f l =
let rec map_flatten_aux accu = function
| [] -> accu
- | e :: l -> map_flatten_aux (List.rev (f e) ++ accu) l
+ | e :: l -> map_flatten_aux (List.rev (f e) @ accu) l
in List.rev (map_flatten_aux [] l)
(* now in prelude: let rec repeat e n *)
@@ -4200,15 +4200,15 @@ let rec realCombinaison = function
| a::l ->
let res = realCombinaison l in
let res2 = List.map (function x -> a::x) res in
- res2 ++ res ++ [[a]]
+ res2 @ res @ [[a]]
(* genere toutes les combinaisons possible de paire *)
(* par exemple combinaison [1;2;4] -> [1, 2; 1, 4; 2, 4] *)
let rec combinaison = function
| [] -> []
| [a] -> []
| [a;b] -> [(a, b)]
- | a::b::l -> (List.map (function elem -> (a, elem)) (b::l)) ++
+ | a::b::l -> (List.map (function elem -> (a, elem)) (b::l)) @
(combinaison (b::l))
(*----------------------------------*)
@@ -4570,11 +4570,11 @@ let (assoc_map: (('a * 'b) list) -> (('a * 'b) list) -> (('a * 'a) list)) =
let (l1bis, l2bis) = (assoc_reverse l1, assoc_reverse l2) in
List.map (fun (x,y) -> (y, List.assoc x l2bis )) l1bis
-let rec (lookup_list: 'a -> ('a , 'b) assoc list -> 'b) = fun el -> function
+let rec (lookup_list: 'a -> ('a, 'b) assoc list -> 'b) = fun el -> function
| [] -> raise Not_found
| (xs::xxs) -> try List.assoc el xs with Not_found -> lookup_list el xxs
-let (lookup_list2: 'a -> ('a , 'b) assoc list -> ('b * int)) = fun el xxs ->
+let (lookup_list2: 'a -> ('a, 'b) assoc list -> ('b * int)) = fun el xxs ->
let rec lookup_l_aux i = function
| [] -> raise Not_found
| (xs::xxs) ->
@@ -5332,7 +5332,7 @@ let (write_ppm: int -> int -> (pixel list) -> string -> unit) = fun
end
let test_ppm1 () = write_ppm 100 100
- ((generate (50*100) (1,45,100)) ++ (generate (50*100) (1,1,100)))
+ ((generate (50*100) (1,45,100)) @ (generate (50*100) (1,1,100)))
"img.ppm"
(*****************************************************************************)
@@ -5819,7 +5819,7 @@ let random_subset_of_list num xs =
*)
let cmdline_flags_devel () =
[
- "-debugger", Arg.Set Common.debugger ,
+ "-debugger", Arg.Set Common.debugger,
" option to set if launched inside ocamldebug";
"-profile", Arg.Unit (fun () -> Common.profile := Common.PALL),
" output profiling information";
@@ -6084,7 +6084,7 @@ let (tree_of_files: filename list -> (string, (string * filename)) tree) =
let leaves = files_here +> List.map (fun ((_dir, base), path) ->
Leaf (base, path)
) in
- nodes ++ leaves
+ nodes @ leaves
in
Node (join "/" root,
aux files)
@@ -338,7 +338,7 @@ let partition_matrix nodes dm =
let xs =
sort_by_count_rows_low_first elts_with_empty_columns dm.matrix dm in
xs +> List.iter (empty_all_cells_relevant_to_node m dm);
- right := xs ++ !right;
+ right := xs @ !right;
(* pr2 (spf "step1: %s" (Common2.dump xs)); *)
if null xs
then rest
@@ -362,23 +362,23 @@ let partition_matrix nodes dm =
let xs = sort_by_count_rows_low_first elts_with_empty_lines dm.matrix dm in
xs+> List.iter (empty_all_cells_relevant_to_node m dm);
(* pr2 (spf "step2: %s" (Common2.dump xs)); *)
- left := !left ++ xs;
+ left := !left @ xs;
if null xs
then step1 rest
else step2 rest
in
let rest = step2 nodes in
if null rest
- then !left ++ !right
+ then !left @ !right
else begin
(*
pr2 "CYCLE";
pr2_gen rest;
*)
let rest = sort_by_count_rows_low_columns_high_first rest m dm in
let rest = hill_climbing rest dm in
- !left ++ rest ++ !right
+ !left @ rest @ !right
end
(* to debug the heuristics *)
@@ -500,12 +500,12 @@ let adjust_gopti_if_needed_lazily tree gopti =
if n1 <> n2 then Some n2 else None
)
in
- aux (Node (n1, xs1)) (brothers ++ more_brothers)
+ aux (Node (n1, xs1)) (brothers @ more_brothers)
))
else begin
let children_nodes = xs +> List.map (fun (Node (n,_)) -> n) in
let config = (Node (n,
- (xs +> List.map (fun (Node (n, _)) -> Node (n, []))) ++
+ (xs +> List.map (fun (Node (n, _)) -> Node (n, []))) @
(brothers +> List.map (fun n -> Node (n, [])))))
in
let dm = build_with_tree config !gopti in
@@ -530,7 +530,7 @@ let adjust_gopti_if_needed_lazily tree gopti =
n to_pack !gopti in
gopti := new_gopti;
Node (n,
- (ok ++ [dotdotdot_entry]) +> List.map (fun n ->
+ (ok @ [dotdotdot_entry]) +> List.map (fun n ->
(* todo: grab the children of n in the original config? *)
Node (n, [])
)
@@ -624,7 +624,7 @@ let fix_path path g =
| x::xs ->
(match x with
| Focus _ ->
- aux (acc ++ [x]) xs
+ aux (acc @ [x]) xs
| Expand (n) ->
aux (put_expand_just_before_last_focus_if_not_children n acc g) xs
)
@@ -112,15 +112,15 @@ let gen_statistics_layer ~root stats ~output =
let infos =
(!(stats.G.unresolved_calls)
- +> List.map (fun x -> x, "unresolved calls")) ++
+ +> List.map (fun x -> x, "unresolved calls")) @
(!(stats.G.unresolved_class_access)
- +> List.map (fun x -> x, "unresolved class access")) ++
+ +> List.map (fun x -> x, "unresolved class access")) @
(!(stats.G.field_access)
- +> List.map (fun (x, b) -> x, pre b "field access")) ++
+ +> List.map (fun (x, b) -> x, pre b "field access")) @
(!(stats.G.method_calls)
- +> List.map (fun (x, b) -> x, pre b "method calls")) ++
+ +> List.map (fun (x, b) -> x, pre b "method calls")) @
(!(stats.G.lookup_fail)
- +> List.map (fun (x, (_str, _kind)) -> x, "lookup fail")) ++
+ +> List.map (fun (x, (_str, _kind)) -> x, "lookup fail")) @
[]
in
@@ -653,12 +653,12 @@ let merge_databases db1 db2 =
{
root = db1.root;
- dirs = (db1.dirs ++ db2.dirs)
+ dirs = (db1.dirs @ db2.dirs)
+> Common.group_assoc_bykey_eff
+> List.map (fun (file, xs) ->
file, Common2.sum xs
);
- files = db1.files ++ db2.files; (* should ensure exclusive ? *)
+ files = db1.files @ db2.files; (* should ensure exclusive ? *)
entities = Array.append db1.entities db2_entities_adjusted;
}
@@ -765,7 +765,7 @@ let files_and_dirs_and_sorted_entities_for_completion2
let multidirs = multi_dirs_entities_of_dirs dirs in
let xs =
- multidirs ++ dirs ++ files ++
+ multidirs @ dirs @ files @
(if nb_entities > threshold_too_many_entities
then begin
pr2 "Too many entities. Completion just for filenames";
Oops, something went wrong.

0 comments on commit 6804c2f

Please sign in to comment.