Skip to content
Browse files

push2 -> push

  • Loading branch information...
1 parent ddeeeb3 commit a663ce99b915414b3f91523acbc5ff548576aa40 @aryx aryx committed Feb 19, 2014
Showing with 160 additions and 158 deletions.
  1. +3 −3 code_graph/view_matrix.ml
  2. +2 −2 code_graph/view_overlays3.ml
  3. +2 −2 code_map/draw_microlevel.ml
  4. +1 −1 code_map/model2.ml
  5. +1 −1 code_map/ui_navigation.ml
  6. +1 −1 code_map/view2.ml
  7. +2 −2 commons/common.ml
  8. +1 −1 commons/common.mli
  9. +10 −8 commons/common2.ml
  10. +2 −2 commons/common2.mli
  11. +1 −1 commons/graph.ml
  12. +1 −1 commons/ocollection/oassocbdb.ml
  13. +1 −1 commons/ocollection/oassocbdb_string.ml
  14. +1 −1 commons/ocollection/oassocdbm.ml
  15. +1 −1 commons/regexp.ml
  16. +1 −1 demos/php_transducer.ml
  17. +3 −3 graph_code/dependencies_matrix_code.ml
  18. +2 −2 graph_code/graph_code.ml
  19. +1 −1 graph_code/graph_code_class_analysis.ml
  20. +1 −1 graph_code/graph_code_database.ml
  21. +1 −1 graph_code/graph_code_prolog.ml
  22. +1 −1 h_files-format/source_tree.ml
  23. +1 −1 h_program-lang/ast_fuzzy.ml
  24. +1 −1 h_program-lang/parse_info.ml
  25. +8 −8 h_visualization/treemap.ml
  26. +1 −1 lang_c/parsing/test_parsing_c.ml
  27. +2 −2 lang_cpp/analyze/error_cpp.ml
  28. +1 −1 lang_cpp/parsing/lib_parsing_cpp.ml
  29. +1 −1 lang_cpp/parsing/test_parsing_cpp.ml
  30. +8 −8 lang_cpp/parsing/token_views_cpp.ml
  31. +1 −1 lang_csharp/parsing/test_parsing_csharp.ml
  32. +1 −1 lang_erlang/parsing/test_parsing_erlang.ml
  33. +1 −1 lang_haskell/parsing/test_parsing_hs.ml
  34. +1 −1 lang_html/parsing/lib_parsing_html.ml
  35. +1 −1 lang_html/parsing/parse_html.ml
  36. +1 −1 lang_java/parsing/test_parsing_java.ml
  37. +1 −1 lang_js/parsing/lib_parsing_js.ml
  38. +19 −19 lang_js/parsing/parsing_hacks_js.ml
  39. +1 −1 lang_js/parsing/test_parsing_js.ml
  40. +1 −1 lang_lisp/parsing/test_parsing_lisp.ml
  41. +3 −3 lang_ml/analyze/graph_code_cmt.ml
  42. +2 −2 lang_ml/analyze/tags_ml.ml
  43. +1 −1 lang_ml/parsing/lib_parsing_ml.ml
  44. +1 −1 lang_ml/parsing/test_parsing_ml.ml
  45. +2 −2 lang_php/analyze/checker/error_php.ml
  46. +1 −1 lang_php/analyze/foundation/class_php.ml
  47. +1 −1 lang_php/analyze/foundation/database_prolog_php.ml
  48. +11 −11 lang_php/analyze/foundation/defs_uses_php.ml
  49. +20 −20 lang_php/analyze/foundation/graph_code_php.ml
  50. +1 −1 lang_php/analyze/foundation/include_require_php.ml
  51. +5 −5 lang_php/analyze/qa_test/coverage_tests_php.ml
  52. +1 −1 lang_php/analyze/tools/xdebug.ml
  53. +10 −10 lang_php/parsing/lib_parsing_php.ml
  54. +1 −1 lang_php/parsing/test_parsing_php.ml
  55. +3 −3 lang_php/parsing/unparse_php.ml
  56. +1 −1 lang_python/parsing/test_parsing_python.ml
  57. +2 −2 lang_web/parsing/parse_web.ml
  58. +1 −1 main_codegraph.ml
  59. +1 −1 main_sgrep.ml
  60. +1 −1 main_spatch.ml
View
6 code_graph/view_matrix.ml
@@ -148,7 +148,7 @@ let draw_cells cr w ~interactive_regions =
for i = 0 to l.nb_elts -.. 1 do
for j = 0 to l.nb_elts -.. 1 do
let rect = rect_of_cell i j l in
- Common.push2 (Cell (i, j), rect) interactive_regions;
+ Common.push (Cell (i, j), rect) interactive_regions;
(* less: could also display intra dependencies *)
if i = j then
@@ -209,7 +209,7 @@ let draw_left_tree cr w ~interactive_regions =
let color = line_color_of_depth depth in
CairoH.draw_rectangle ~cr ~line_width ~color rect;
- Common.push2 (Row !i, rect) interactive_regions;
+ Common.push (Row !i, rect) interactive_regions;
(* draw horizontal lines around cells *)
let rect2 = {
@@ -323,7 +323,7 @@ let draw_up_columns cr w ~interactive_regions =
p = { x = x; y = 0. };
q = { x = x + l.width_cell; y = l.y_start_matrix_up };
} in
- Common.push2 (Column j, rect) interactive_regions;
+ Common.push (Column j, rect) interactive_regions;
CairoH.set_source_color ~cr ~color:"wheat" ();
Cairo.move_to cr x y;
View
4 code_graph/view_overlays3.ml
@@ -83,12 +83,12 @@ let draw_green_yellow_dependent_rows ~cr w i =
for j = 0 to l.nb_elts -.. 1 do
if w.m.DM.matrix.(i).(j) > 0
- then Common.push2 j i_uses;
+ then Common.push j i_uses;
done;
for i2 = 0 to l.nb_elts -.. 1 do
if w.m.DM.matrix.(i2).(i) > 0
- then Common.push2 i2 i_used_by;
+ then Common.push i2 i_used_by;
done;
!i_uses +> List.iter (fun i ->
View
4 code_map/draw_microlevel.ml
@@ -204,7 +204,7 @@ let glyphs_of_file ~context ~font_size ~font_size_real file
let xs = Common2.lines_with_nl_either s in
xs +> List.iter (function
| Common2.Left str ->
- Common.push2 { M. str; font_size=final_font_size; color; categ } acc;
+ Common.push { M. str; font_size=final_font_size; color; categ } acc;
| Common2.Right () ->
arr.(!line) <- List.rev !acc;
acc := [];
@@ -232,7 +232,7 @@ let defs_of_glyphs glyphs =
glyph.categ +> Common.do_option (fun categ ->
Database_code.entity_kind_of_highlight_category_def categ
+> Common.do_option (fun kind ->
- Common.push2 (Line line_0_indexed, (glyph.str, kind)) res
+ Common.push (Line line_0_indexed, (glyph.str, kind)) res
))));
!res
View
2 code_map/model2.ml
@@ -441,7 +441,7 @@ let lines_where_used_node node startl microlevel =
glyph.str =$= s &&
Database_code.matching_use_categ_kind categ (snd node)
)
- then Common.push2 (Line line) res
+ then Common.push (Line line) res
done;
!res
View
2 code_map/ui_navigation.ml
@@ -63,7 +63,7 @@ let go_dirs_or_file ?(current_entity=None) ?(current_grep_query=None)
let dw = !dw_ref in
!Controller._set_title (Controller.title_of_path root);
- Common.push2 !dw_ref Controller.dw_stack;
+ Common.push !dw_ref Controller.dw_stack;
let root = (Async.async_get dw.dw_model).root in
dw_ref :=
View
2 code_map/view2.ml
@@ -188,7 +188,7 @@ let expose_legend da dw_ref _ev =
let mk_gui ~screen_size ~legend test_mode (root, model, dw, _dbfile_opt) =
let dw = ref dw in
- Common.push2 !dw Controller.dw_stack;
+ Common.push !dw Controller.dw_stack;
let width, height, minimap_hpos, minimap_vpos =
Style.windows_params screen_size in
View
4 commons/common.ml
@@ -61,7 +61,7 @@ let enum x n =
in
List.rev (enum_aux [] x n)
-let push2 v l =
+let push v l =
l := v :: !l
@@ -956,7 +956,7 @@ let _temp_files_created = ref ([] : filename list)
let new_temp_file prefix suffix =
let processid = i_to_s (Unix.getpid ()) in
let tmp_file = Filename.temp_file (prefix ^ "-" ^ processid ^ "-") suffix in
- push2 tmp_file _temp_files_created;
+ push tmp_file _temp_files_created;
tmp_file
let save_tmp_files = ref false
View
2 commons/common.mli
@@ -95,7 +95,7 @@ val group_assoc_bykey_eff : ('a * 'b) list -> ('a * 'b list) list
val group_by_mapped_key: ('a -> 'b) -> 'a list -> ('b * 'a list) list
type 'a stack = 'a list
-val push2 : 'a -> 'a stack ref -> unit
+val push : 'a -> 'a stack ref -> unit
val hash_of_list : ('a * 'b) list -> ('a, 'b) Hashtbl.t
val hash_to_list : ('a, 'b) Hashtbl.t -> ('a * 'b) list
View
18 commons/common2.ml
@@ -105,7 +105,7 @@ let (lines: string -> string list) = fun s ->
Str.split_delim (Str.regexp "\n") s +> lines_aux
-let push2 v l =
+let push v l =
l := v :: !l
let null xs = match xs with [] -> true | _ -> false
@@ -1043,7 +1043,7 @@ let (add_hook: ('a -> ('a -> 'b) -> 'b) ref -> ('a -> ('a -> 'b) -> 'b) -> unit
let (add_hook_action: ('a -> unit) -> ('a -> unit) list ref -> unit) =
fun f hooks ->
- push2 f hooks
+ push f hooks
let (run_hooks_action: 'a -> ('a -> unit) list ref -> unit) =
fun obj hooks ->
@@ -1813,7 +1813,7 @@ let all_match re s =
let substr = Str.matched_string s in
assert(substr ==~ regexp); (* @Effect: also use it's side effect *)
let paren_matched = matched1 substr in
- push2 paren_matched res;
+ push paren_matched res;
"" (* @Dummy *)
) s in
List.rev !res
@@ -3437,8 +3437,10 @@ let uncons l = (List.hd l, List.tl l)
(* pixel *)
let safe_tl l = try List.tl l with _ -> []
+(* in prelude
let push l v =
l := v :: !l
+*)
let rec zip xs ys =
match (xs,ys) with
@@ -4854,7 +4856,7 @@ type 'a stack = 'a list
(* with sexp *)
let (empty_stack: 'a stack) = []
-let (push: 'a -> 'a stack -> 'a stack) = fun x xs -> x::xs
+(*let (push: 'a -> 'a stack -> 'a stack) = fun x xs -> x::xs *)
let (top: 'a stack -> 'a) = List.hd
let (pop: 'a stack -> 'a stack) = List.tl
@@ -4983,7 +4985,7 @@ let find_treeref f tree =
tree +> treeref_node_iter (fun (n, xs) ->
if f (n,xs)
- then push2 (n, xs) res;
+ then push (n, xs) res;
);
match !res with
| [n,xs] -> NodeRef (n, xs)
@@ -5038,7 +5040,7 @@ let find_treeref2 f tree =
tree +> treeref_node_iter2 (fun (n, xs) ->
if f (n,xs)
- then push2 (n, xs) res;
+ then push (n, xs) res;
);
match !res with
| [n,xs] -> NodeRef2 (n, xs)
@@ -5078,7 +5080,7 @@ let find_treeref_with_parents_some f tree =
tree +> treeref_node_iter_with_parents (fun (n, xs) parents ->
match f (n,xs) parents with
- | Some v -> push2 v res;
+ | Some v -> push v res;
| None -> ()
);
match !res with
@@ -5091,7 +5093,7 @@ let find_multi_treeref_with_parents_some f tree =
tree +> treeref_node_iter_with_parents (fun (n, xs) parents ->
match f (n,xs) parents with
- | Some v -> push2 v res;
+ | Some v -> push v res;
| None -> ()
);
match !res with
View
4 commons/common2.mli
@@ -1710,13 +1710,13 @@ val hash_with_default: (unit -> 'b) ->
type 'a stack = 'a list
val empty_stack : 'a stack
-val push : 'a -> 'a stack -> 'a stack
+(*val push : 'a -> 'a stack -> 'a stack*)
val top : 'a stack -> 'a
val pop : 'a stack -> 'a stack
val top_option: 'a stack -> 'a option
-val push2 : 'a -> 'a stack ref -> unit
+val push : 'a -> 'a stack ref -> unit
val pop2: 'a stack ref -> 'a
(*x: common.mli for collection types *)
(*****************************************************************************)
View
2 commons/graph.ml
@@ -364,7 +364,7 @@ let entry_nodes2 g =
else begin
let xs = OG.succ g.og v in
xs +> List.iter (fun n -> Hashtbl.replace hdone n true);
- Common.push2 v res;
+ Common.push v res;
end
);
!res +> List.map (fun i -> key_of_vertex i g) +> List.rev
View
2 commons/ocollection/oassocbdb.ml
@@ -141,7 +141,7 @@ object(o)
let valu = unv (Common.marshal__from_string (snd a) 0) in
f (key, valu);
*)
- Common.push2 key res;
+ Common.push key res;
true
with Failure "ending" -> false
)
View
2 commons/ocollection/oassocbdb_string.ml
@@ -125,7 +125,7 @@ object(o)
let valu = unv (Common.marshal__from_string (snd a) 0) in
f (key, valu);
*)
- Common.push2 key res;
+ Common.push key res;
true
with Failure "ending" -> false
)
View
2 commons/ocollection/oassocdbm.ml
@@ -91,7 +91,7 @@ object(o)
let v' = unv (Common.marshal__from_string data 0) in
f (k', v')
*)
- Common.push2 k' res;
+ Common.push k' res;
);
!res
View
2 commons/regexp.ml
@@ -13,7 +13,7 @@ let find_offset_all_matches ~regexp str =
let n = Pcre.num_of_subs substrings in
for i = 1 to n -1 do
let (pos1, pos2) = Pcre.get_substring_ofs substrings i in
- Common.push2 (pos1,pos2) res;
+ Common.push (pos1,pos2) res;
done;
(try
let subs2 = Pcre.next_match ~rex:regexp substrings in
View
2 demos/php_transducer.ml
@@ -38,7 +38,7 @@ let visit asts =
match top with
| FuncDef (def) ->
let name = Ast.str_of_ident def.f_name in
- Common.push2 ("function:" ^name) props;
+ Common.push ("function:" ^name) props;
| _ ->
()
);
View
6 graph_code/dependencies_matrix_code.ml
@@ -180,7 +180,7 @@ let explain_cell_list_use_edges (i, j) dm gopti =
let parent_j2 = projected_parent_of_igopti.(j2) in
if parent_i2 = i && parent_j2 = j
then
- Common.push2 (
+ Common.push (
gopti.G2.i_to_name.(i2),
gopti.G2.i_to_name.(j2)
) res;
@@ -263,7 +263,7 @@ let focus_on_node n deps_style tree dm =
* right order
*)
if to_include || i = j
- then Common.push2 j deps
+ then Common.push j deps
done;
(* old: this was not keeping the hierarchy (which can be a feature)
* Node (G.root, !deps +> List.rev +> List.map (fun i ->
@@ -422,7 +422,7 @@ let score_upper_triangle_cells dm =
let res = ref [] in
for i = 0 to Array.length dm.matrix -1 do
for j = i + 1 to Array.length dm.matrix -1 do
- Common.push2 ((i, j), dm.matrix.(i).(j)) res
+ Common.push ((i, j), dm.matrix.(i).(j)) res
done
done;
!res
View
4 graph_code/graph_code.ml
@@ -270,12 +270,12 @@ let iter_nodes f g =
let all_use_edges g =
let res = ref [] in
- G.iter_edges (fun n1 n2 -> Common.push2 (n1, n2) res) g.use;
+ G.iter_edges (fun n1 n2 -> Common.push (n1, n2) res) g.use;
!res
let all_nodes g =
let res = ref [] in
- G.iter_nodes (fun n -> Common.push2 n res) g.has;
+ G.iter_nodes (fun n -> Common.push n res) g.has;
!res
(*****************************************************************************)
View
2 graph_code/graph_code_class_analysis.ml
@@ -187,7 +187,7 @@ let dispatched_methods2 g dag node =
let node = (string_of_class_method (current_class, m), kind) in
(* todo? need get public and protected there too *)
(if G.has_node node g
- then Common.push2 node res
+ then Common.push node res
);
let children = Graph.succ (current_class, class_kind) dag in
children +> List.iter aux
View
2 graph_code/graph_code_database.ml
@@ -99,7 +99,7 @@ let db_of_graph_code root g =
e_properties = [];
}
in
- Common.push2 e res
+ Common.push e res
end
| E.TopStmts
View
2 graph_code/graph_code_prolog.ml
@@ -160,7 +160,7 @@ let entity_of_str s =
let build g =
let res = ref [] in
- let add x = Common.push2 x res in
+ let add x = Common.push x res in
add (Misc "% -*- prolog -*-");
add (Misc ":- discontiguous kind/2, at/3");
View
2 h_files-format/source_tree.ml
@@ -27,7 +27,7 @@ let reverse_index reorg =
let res = ref [] in
reorg +> List.iter (fun (SubSystem s1, dirs) ->
dirs +> List.iter (fun (Dir s2) ->
- push2 (Dir s2, SubSystem s1) res;
+ push (Dir s2, SubSystem s1) res;
);
);
List.rev !res
View
2 h_program-lang/ast_fuzzy.ml
@@ -232,7 +232,7 @@ let (mk_mapper: map_visitor -> (trees -> trees)) = fun hook ->
let (ii_of_trees: trees -> Parse_info.info list) = fun trees ->
let globals = ref [] in
let hooks = { default_visitor with
- ktok = (fun (_k, _) i -> Common.push2 i globals)
+ ktok = (fun (_k, _) i -> Common.push i globals)
} in
begin
let vout = mk_visitor hooks in
View
2 h_program-lang/parse_info.ml
@@ -973,7 +973,7 @@ let lines_around_error_line ~context (file, line) =
let res = ref [] in
for i = startl to endl -1 do
- Common.push2 arr.(i) res
+ Common.push arr.(i) res
done;
List.rev !res
View
16 h_visualization/treemap.ml
@@ -401,7 +401,7 @@ let layout row rect =
q = { x = q.(0); y = q.(1); }
}
in
- Common.push2 (size_child, info, rect_here) res;
+ Common.push (size_child, info, rect_here) res;
p.(axis_split) <- q.(axis_split);
);
!res
@@ -674,7 +674,7 @@ let balayer_right xs =
let n = List.length xs in
let res = ref [] in
for i = 0 to n do
- Common.push2 (take i xs, drop i xs) res;
+ Common.push (take i xs, drop i xs) res;
done;
List.rev !res
let _ = assert (balayer_right [1;2;3;2] =
@@ -801,7 +801,7 @@ let render_treemap_algo2 = fun ?(algo=Classic) ?(big_borders=false) treemap ->
| Leaf (tnode, _fileinfo) ->
let color = color_of_treemap_node root in
- Common.push2 {
+ Common.push {
tr_rect = rect;
tr_color = color;
tr_label = tnode.label;
@@ -813,7 +813,7 @@ let render_treemap_algo2 = fun ?(algo=Classic) ?(big_borders=false) treemap ->
| Node (mode, children) ->
(* let's draw some borders. Far better to see the structure. *)
- Common.push2 {
+ Common.push {
tr_rect = rect;
tr_color = Color.black;
tr_label = (fst mode).label;
@@ -982,20 +982,20 @@ let tree_of_dir3
match stat.Unix.st_kind with
| Unix.S_REG ->
if filter_file full
- then Common.push2 (Leaf (full, file_hook full)) res
+ then Common.push (Leaf (full, file_hook full)) res
| Unix.S_DIR ->
if filter_dir full
- then Common.push2 (aux full) res
+ then Common.push (aux full) res
| Unix.S_LNK ->
if !follow_symlinks then
(try
(match (Unix.stat full).Unix.st_kind with
| Unix.S_REG ->
if filter_file full
- then Common.push2 (Leaf (full, file_hook full)) res
+ then Common.push (Leaf (full, file_hook full)) res
| Unix.S_DIR ->
if filter_dir full
- then Common.push2 (aux full) res
+ then Common.push (aux full) res
| _ -> ()
)
with Unix.Unix_error _ ->
View
2 lang_c/parsing/test_parsing_c.ml
@@ -14,7 +14,7 @@ let test_parse_c xs =
let (_xs, stat) =
Parse_c.parse file
in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
));
Stat.print_recurring_problematic_tokens !stat_list;
Stat.print_parsing_stat_list !stat_list;
View
4 lang_cpp/analyze/error_cpp.ml
@@ -70,9 +70,9 @@ let string_of_error_kind error_kind =
let _errors = ref []
let fatal loc err =
- Common.push2 { loc = loc; typ = err; sev = Fatal } _errors
+ Common.push { loc = loc; typ = err; sev = Fatal } _errors
let warning loc err =
- Common.push2 { loc = loc; typ = err; sev = Warning } _errors
+ Common.push { loc = loc; typ = err; sev = Warning } _errors
(*****************************************************************************)
(* Ranking *)
View
2 lang_cpp/parsing/lib_parsing_cpp.ml
@@ -47,7 +47,7 @@ let find_source_files_of_dir_or_files xs =
let ii_of_any any =
let globals = ref [] in
let visitor = V.mk_visitor { V.default_visitor with
- V.kinfo = (fun (_k,_) i -> Common.push2 i globals)
+ V.kinfo = (fun (_k,_) i -> Common.push i globals)
}
in
visitor any;
View
2 lang_cpp/parsing/test_parsing_cpp.ml
@@ -34,7 +34,7 @@ let test_parse_cpp ?lang xs =
| None -> Parse_cpp.parse file
| Some lang -> Parse_cpp.parse_with_lang ~lang file
in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
let s = spf "bad = %d" stat.Stat.bad in
if stat.Stat.bad = 0
View
16 lang_cpp/parsing/token_views_cpp.ml
@@ -153,8 +153,8 @@ let mk_token_fake x =
let rebuild_tokens_extented toks_ext =
let _tokens = ref [] in
toks_ext +> List.iter (fun tok ->
- tok.new_tokens_before +> List.iter (fun x -> push2 x _tokens);
- push2 tok.t _tokens
+ tok.new_tokens_before +> List.iter (fun x -> push x _tokens);
+ push tok.t _tokens
);
let tokens = List.rev !_tokens in
(tokens +> Common2.acc_map mk_token_extended)
@@ -558,15 +558,15 @@ let rec iter_token_multi f xs =
let tokens_of_paren xs =
let g = ref [] in
- xs +> iter_token_paren (fun tok -> push2 tok g);
+ xs +> iter_token_paren (fun tok -> push tok g);
List.rev !g
let tokens_of_paren_ordered xs =
let g = ref [] in
let rec aux_tokens_ordered = function
- | PToken tok -> push2 tok g;
+ | PToken tok -> push tok g;
| Parenthised (xxs, info_parens) ->
let (opar, cpar, commas) =
match info_parens with
@@ -578,17 +578,17 @@ let tokens_of_paren_ordered xs =
)
| _ -> raise Impossible
in
- push2 opar g;
+ push opar g;
aux_args (xxs,commas);
- push2 cpar g;
+ push cpar g;
and aux_args (xxs, commas) =
match xxs, commas with
| [], [] -> ()
| [xs], [] -> xs +> List.iter aux_tokens_ordered
| xs::ys::xxs, comma::commas ->
xs +> List.iter aux_tokens_ordered;
- push2 comma g;
+ push comma g;
aux_args (ys::xxs, commas)
| _ -> raise Impossible
@@ -600,7 +600,7 @@ let tokens_of_paren_ordered xs =
let tokens_of_multi_grouped xs =
let res = ref [] in
- let add x = Common.push2 x res in
+ let add x = Common.push x res in
let rec aux xs =
xs +> List.iter (function
View
2 lang_csharp/parsing/test_parsing_csharp.ml
@@ -27,7 +27,7 @@ let test_parse_csharp xs =
pr2 ("PARSING: " ^ file);
let (_xs, stat) = Parse_csharp.parse file in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
);
Parse_info.print_parsing_stat_list !stat_list;
()
View
2 lang_erlang/parsing/test_parsing_erlang.ml
@@ -27,7 +27,7 @@ let test_parse_erlang xs =
pr2 ("PARSING: " ^ file);
let (_xs, stat) = Parse_erlang.parse file in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
);
Parse_info.print_parsing_stat_list !stat_list;
()
View
2 lang_haskell/parsing/test_parsing_hs.ml
@@ -29,7 +29,7 @@ let test_parse_hs xs =
pr2 ("PARSING: " ^ file);
let (_xs, stat) = Parse_hs.parse file in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
);
Parse_info.print_parsing_stat_list !stat_list;
()
View
2 lang_html/parsing/lib_parsing_html.ml
@@ -47,7 +47,7 @@ let get_data_any any =
V.do_visit_with_ref (fun aref -> { V.default_visitor with
V.khtml_tree = (fun (k, _) x ->
match x with
- | Data (s, _info) -> Common.push2 s aref
+ | Data (s, _info) -> Common.push s aref
| _ -> k x
)
}) any
View
2 lang_html/parsing/parse_html.ml
@@ -327,7 +327,7 @@ let parse2 file =
-> raise Impossible
})
in
- Common.push2 tok toks;
+ Common.push tok toks;
tok
in
View
2 lang_java/parsing/test_parsing_java.ml
@@ -35,7 +35,7 @@ let test_parse xs =
Parse_java.parse file
)
in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
let s = spf "bad = %d" stat.PI.bad in
if stat.PI.bad = 0
then Hashtbl.add newscore file (Common2.Ok)
View
2 lang_js/parsing/lib_parsing_js.ml
@@ -51,7 +51,7 @@ let find_source_files_of_dir_or_files ?(include_scripts=true)xs =
let extract_info_visitor recursor =
let globals = ref [] in
let hooks = { V.default_visitor with
- V.kinfo = (fun (_k, _) i -> Common.push2 i globals)
+ V.kinfo = (fun (_k, _) i -> Common.push i globals)
} in
begin
let vout = V.mk_visitor hooks in
View
38 lang_js/parsing/parsing_hacks_js.ml
@@ -32,13 +32,13 @@ let rparens_of_if toks =
toks +> Common2.iter_with_previous_opt (fun prev x ->
(match x with
| T.T_LPAREN _ ->
- Common.push2 prev stack;
+ Common.push prev stack;
| T.T_RPAREN info ->
if !stack <> [] then begin
let top = Common2.pop2 stack in
(match top with
| Some (T.T_IF _) ->
- Common.push2 info rparens_if
+ Common.push info rparens_if
| _ ->
()
)
@@ -59,14 +59,14 @@ let fix_tokens xs =
| [] -> []
| y::ys ->
let res = ref [] in
- Common.push2 y res;
+ Common.push y res;
let rec aux prev f xs =
match xs with
| [] -> ()
| e::l ->
if TH.is_comment e
then begin
- Common.push2 e res;
+ Common.push e res;
aux prev f l
end else begin
f prev e;
@@ -77,24 +77,24 @@ let fix_tokens xs =
match prev, x with
| (T.T_LCURLY _ | T.T_SEMICOLON _ | T.T_VIRTUAL_SEMICOLON _),
T.T_RCURLY _ ->
- Common.push2 x res;
+ Common.push x res;
(* also one after ? *)
(* Common.push2 (T.T_VIRTUAL_SEMICOLON (Ast.fakeInfo ())) res; *)
| _, T.T_RCURLY _ ->
let fake = Ast.fakeInfoAttach (TH.info_of_tok x) in
- Common.push2 (T.T_VIRTUAL_SEMICOLON fake) res;
- Common.push2 x res;
+ Common.push (T.T_VIRTUAL_SEMICOLON fake) res;
+ Common.push x res;
(* also one after ? *)
(* Common.push2 (T.T_VIRTUAL_SEMICOLON (Ast.fakeInfo ())) res; *)
| (T.T_SEMICOLON _ | T.T_VIRTUAL_SEMICOLON _),
T.EOF _ ->
- Common.push2 x res;
+ Common.push x res;
| _, T.EOF _ ->
let fake = Ast.fakeInfoAttach (TH.info_of_tok x) in
- Common.push2 (T.T_VIRTUAL_SEMICOLON fake) res;
- Common.push2 x res;
+ Common.push (T.T_VIRTUAL_SEMICOLON fake) res;
+ Common.push x res;
| T.T_RCURLY _,
@@ -112,9 +112,9 @@ let fix_tokens xs =
if line2 <> line1
then begin
let fake = Ast.fakeInfoAttach (TH.info_of_tok x) in
- Common.push2 (T.T_VIRTUAL_SEMICOLON fake) res;
+ Common.push (T.T_VIRTUAL_SEMICOLON fake) res;
end;
- Common.push2 x res;
+ Common.push x res;
(* this is valid only if the RPAREN is not the closing paren
* of a if
@@ -129,9 +129,9 @@ let fix_tokens xs =
if line2 <> line1
then begin
let fake = Ast.fakeInfoAttach (TH.info_of_tok x) in
- Common.push2 (T.T_VIRTUAL_SEMICOLON fake) res;
+ Common.push (T.T_VIRTUAL_SEMICOLON fake) res;
end;
- Common.push2 x res;
+ Common.push x res;
| T.T_RBRACKET _,
@@ -142,9 +142,9 @@ let fix_tokens xs =
if line2 <> line1
then begin
let fake = Ast.fakeInfoAttach (TH.info_of_tok x) in
- Common.push2 (T.T_VIRTUAL_SEMICOLON fake) res;
+ Common.push (T.T_VIRTUAL_SEMICOLON fake) res;
end;
- Common.push2 x res;
+ Common.push x res;
| (T.T_IDENTIFIER _ | T.T_NULL _ | T.T_STRING _ | T.T_REGEX _
@@ -159,12 +159,12 @@ let fix_tokens xs =
if line2 <> line1
then begin
let fake = Ast.fakeInfoAttach (TH.info_of_tok x) in
- Common.push2 (T.T_VIRTUAL_SEMICOLON fake) res;
+ Common.push (T.T_VIRTUAL_SEMICOLON fake) res;
end;
- Common.push2 x res;
+ Common.push x res;
| _, _ ->
- Common.push2 x res;
+ Common.push x res;
)
in
aux y f ys;
View
2 lang_js/parsing/test_parsing_js.ml
@@ -36,7 +36,7 @@ let test_parse_js xs =
Parse_js.parse file
))
in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
end
));
Parse_info.print_parsing_stat_list !stat_list;
View
2 lang_lisp/parsing/test_parsing_lisp.ml
@@ -29,7 +29,7 @@ let test_parse_lisp xs =
pr2 ("PARSING: " ^ file);
let (_xs, stat) = Parse_lisp.parse file in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
);
Parse_info.print_parsing_stat_list !stat_list;
()
View
6 lang_ml/analyze/graph_code_cmt.ml
@@ -198,7 +198,7 @@ let full_path_local_of_kind env kind =
| _ -> raise Impossible
let add_full_path_local env (s, name) kind =
- Common.push2 (s, name) (full_path_local_of_kind env kind)
+ Common.push (s, name) (full_path_local_of_kind env kind)
let add_node_and_edge_if_defs_mode ?(dupe_ok=false) env name_node loc =
let (name, kind) = name_node in
@@ -622,7 +622,7 @@ and structure_item_desc env loc = function
| Ttype_abstract, Some ({ctyp_desc=Ttyp_constr (path, _lid, _xs); _}) ->
if env.phase = Defs then
let name = name_of_path path in
- Common.push2 (full_ident, path_resolve_locals env name E.Type)
+ Common.push (full_ident, path_resolve_locals env name E.Type)
env.type_aliases
| _ -> ()
);
@@ -647,7 +647,7 @@ and structure_item_desc env loc = function
(* do not add nodes for module aliases in the graph, just *)
if env.phase = Defs then begin
let name = name_of_path path in
- Common.push2 (full_ident, path_resolve_locals env name E.Module)
+ Common.push (full_ident, path_resolve_locals env name E.Module)
env.module_aliases
end;
add_full_path_local env (Ident.name id, full_ident) E.Module
View
4 lang_ml/analyze/tags_ml.ml
@@ -93,7 +93,7 @@ let defs_of_files_or_dirs ?(verbose=false) xs =
categ +> Common.do_option (fun x ->
entity_of_highlight_category_opt x +> Common.do_option (fun kind ->
- Common.push2 (Tags.tag_of_info filelines info kind) defs;
+ Common.push (Tags.tag_of_info filelines info kind) defs;
let (d,b,e) = Common2.dbe_of_filename file in
let module_name = String.capitalize b in
@@ -109,7 +109,7 @@ let defs_of_files_or_dirs ?(verbose=false) xs =
(e = "mli" && not (Sys.file_exists
(Common2.filename_of_dbe (d,b, "ml"))))
then
- Common.push2 (Tags.tag_of_info filelines info' kind) defs;
+ Common.push (Tags.tag_of_info filelines info' kind) defs;
)
)
);
View
2 lang_ml/parsing/lib_parsing_ml.ml
@@ -85,7 +85,7 @@ let find_cmt_files_of_dir_or_files xs =
let extract_info_visitor recursor =
let globals = ref [] in
let hooks = { V.default_visitor with
- V.kinfo = (fun (_k, _) i -> Common.push2 i globals)
+ V.kinfo = (fun (_k, _) i -> Common.push i globals)
} in
begin
let vout = V.mk_visitor hooks in
View
2 lang_ml/parsing/test_parsing_ml.ml
@@ -32,7 +32,7 @@ let test_parse_ml_or_mli xs =
Parse_ml.parse file
)
in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
));
Parse_info.print_parsing_stat_list !stat_list;
()
View
4 lang_php/analyze/checker/error_php.ml
@@ -276,9 +276,9 @@ let _errors = ref []
(* todo? let exn_when_error *)
let fatal loc err =
- Common.push2 { loc = loc; typ = err; sev = Fatal } _errors
+ Common.push { loc = loc; typ = err; sev = Fatal } _errors
let warning loc err =
- Common.push2 { loc = loc; typ = err; sev = Warning } _errors
+ Common.push { loc = loc; typ = err; sev = Warning } _errors
let report_all_errors () =
!_errors +> List.rev +> List.iter report_error
View
2 lang_php/analyze/foundation/class_php.ml
@@ -290,7 +290,7 @@ let collect_members aclass find_entity =
let _ = lookup_gen aclass find_entity (function
| ClassVariables (_, _, class_vars, _) ->
class_vars +> Ast.uncomma +> List.iter (fun (dname, _affect) ->
- Common.push2 dname res;
+ Common.push dname res;
);
None
| _ -> None;
View
2 lang_php/analyze/foundation/database_prolog_php.ml
@@ -516,7 +516,7 @@ let build2 ?(show_progress=true) root files =
ignore(show_progress);
let res = ref [] in
- let add x = Common.push2 x res in
+ let add x = Common.push x res in
add (P.Misc "% -*- prolog -*-");
add (P.Misc ":- discontiguous kind/2, at/3");
View
22 lang_php/analyze/foundation/defs_uses_php.ml
@@ -75,7 +75,7 @@ let defs_of_any any =
V.kfunc_def = (fun (k, _) def ->
(match def.f_type with
| FunctionRegular ->
- Common.push2 (def.f_name, None, E.Function) aref
+ Common.push (def.f_name, None, E.Function) aref
| MethodRegular | MethodAbstract ->
let classname =
match !current_class with
@@ -87,7 +87,7 @@ let defs_of_any any =
then E.StaticMethod
else E.RegularMethod
in
- Common.push2 (def.f_name, Some classname, E.Method kind) aref
+ Common.push (def.f_name, Some classname, E.Method kind) aref
| FunctionLambda ->
(* the f_name is meaningless *)
()
@@ -104,7 +104,7 @@ let defs_of_any any =
| Interface _ -> E.Interface
| Trait _ -> E.Trait
in
- Common.push2 (def.c_name, None, E.Class kind) aref;
+ Common.push (def.c_name, None, E.Class kind) aref;
Common.save_excursion current_class (Some def.c_name) (fun () ->
k def;
);
@@ -113,10 +113,10 @@ let defs_of_any any =
match x with
(* const of php 5.3 *)
| ConstantDef def ->
- Common.push2 (def.cst_name, None, E.Constant) aref;
+ Common.push (def.cst_name, None, E.Constant) aref;
k x
| TypeDef def ->
- Common.push2 (def.t_name, None, E.Type) aref;
+ Common.push (def.t_name, None, E.Type) aref;
k x
| _ -> k x
);
@@ -135,7 +135,7 @@ let defs_of_any any =
* which is not the case for s. See ast_php.ml
*)
let info' = Parse_info.rewrap_str (s) info in
- Common.push2 ((Name (s, info')), None, E.Constant) aref;
+ Common.push ((Name (s, info')), None, E.Constant) aref;
k x
| _ -> k x
)
@@ -177,7 +177,7 @@ let uses_of_any ?(verbose=false) any =
(match x with
(* todo: what about functions passed as strings? *)
| Call (Id name, _args) ->
- Common.push2 (name, E.Function) aref;
+ Common.push (name, E.Function) aref;
(* This covers
* - new X, instanceof X
@@ -190,7 +190,7 @@ let uses_of_any ?(verbose=false) any =
| AssignNew(_, _, _, _, Id name, _)
| ClassGet (Id name, _, _) ->
let kind = E.RegularClass in
- Common.push2 (name, E.Class kind) aref;
+ Common.push (name, E.Class kind) aref;
| _ -> ()
);
k x
@@ -209,7 +209,7 @@ let uses_of_any ?(verbose=false) any =
let kind = E.RegularClass in
(match classname with
| Hint (classname, _targsTODO) ->
- Common.push2 (classname, E.Class kind) aref;
+ Common.push (classname, E.Class kind) aref;
| _ -> ()
);
k classname
@@ -219,10 +219,10 @@ let uses_of_any ?(verbose=false) any =
V.kxhp_html = (fun (k, _) x ->
match x with
| Xhp (xhp_tag, _attrs, _tok, _body, _end) ->
- Common.push2 (XName[QI(XhpName xhp_tag)], E.Class E.RegularClass) aref;
+ Common.push (XName[QI(XhpName xhp_tag)], E.Class E.RegularClass) aref;
k x
| XhpSingleton (xhp_tag, _attrs, _tok) ->
- Common.push2 (XName[QI(XhpName xhp_tag)], E.Class E.RegularClass) aref;
+ Common.push (XName[QI(XhpName xhp_tag)], E.Class E.RegularClass) aref;
k x
(* todo: do it also for xhp attributes ? kxhp_tag then ?
* (but take care to not include doublon because have
View
40 lang_php/analyze/foundation/graph_code_php.ml
@@ -156,7 +156,7 @@ let parse env file =
with
| Timeout -> raise Timeout
| exn ->
- env.stats.G.parse_errors +> Common.push2 file;
+ env.stats.G.parse_errors +> Common.push file;
env.pr2_and_log (spf "PARSE ERROR with %s, exn = %s" (env.path file)
(Common.exn_to_s exn));
[]
@@ -392,7 +392,7 @@ let lookup_fail env tokopt dst =
| _ -> env.log
)
in
- env.stats.G.lookup_fail +> Common.push2 (info, dst);
+ env.stats.G.lookup_fail +> Common.push (info, dst);
fprinter (spf "PB: lookup fail on %s (at %s:%d)" (G.string_of_node dst)
(env.path file) line)
@@ -476,16 +476,16 @@ let add_use_edge_bis a b =
let add_use_edge ?(phase=Uses) env n =
match phase with
| Defs -> raise Impossible
- | Inheritance -> env.phase_inheritance +> Common.push2 (env.cur, n)
- | Uses -> env.phase_use +> Common.push2 (env.cur, n)
+ | Inheritance -> env.phase_inheritance +> Common.push (env.cur, n)
+ | Uses -> env.phase_use +> Common.push (env.cur, n)
(* why not call add_use_edge() and benefit from the error reporting
* there? because instanceOf check are less important so
* we special case them?
*)
let add_use_edge_instanceof env (name, kind) =
let env = { env with phase = Uses } in
- env.phase_use_other +> Common.push2 (fun () ->
+ env.phase_use_other +> Common.push (fun () ->
let (R x) = str_of_name env name kind in
let node = (x, kind) in
if not (G.has_node node env.g)
@@ -495,7 +495,7 @@ let add_use_edge_instanceof env (name, kind) =
(* todo: add unit test for that *)
let add_use_edge_maybe_class env entity tokopt =
let env = { env with phase = Uses } in
- env.phase_use_other +> Common.push2 (fun () ->
+ env.phase_use_other +> Common.push (fun () ->
(* less: do case insensitive? handle conflicts? *)
if G.has_node (entity, E.Class E.RegularClass) env.g
then
@@ -570,9 +570,9 @@ let add_use_edge_lookup2 xhp env (name, ident) kind =
let tok = Ast.tok_of_ident ident in
(match kind2 with
| E.Method _ ->
- env.stats.G.method_calls +> Common.push2 (tok, true)
+ env.stats.G.method_calls +> Common.push (tok, true)
| E.Field ->
- env.stats.G.field_access +> Common.push2 (tok, true)
+ env.stats.G.field_access +> Common.push (tok, true)
| E.ClassConstant -> ()
| _ -> raise Impossible
);
@@ -615,7 +615,7 @@ let add_use_edge_lookup2 xhp env (name, ident) kind =
then add_use_edge_bis env (name, E.Class E.RegularClass)
let add_use_edge_lookup ?(xhp=false) env a b =
- env.phase_use_lookup +> Common.push2 (env.cur, (xhp, a, b))
+ env.phase_use_lookup +> Common.push (env.cur, (xhp, a, b))
(* todo: add unit test for this
* todo: this is buggy, you can't use lookup_inheritance in the
@@ -946,16 +946,16 @@ and expr env x =
| This ((_x, tokopt)) ->
expr env
(Call (Class_get (Id[ (env.cur.self, tokopt)], Id name2), es));
- env.phase_dispatch +> Common.push2 (env.cur, name2);
+ env.phase_dispatch +> Common.push (env.cur, name2);
(* need class analysis ... *)
| _ ->
- env.phase_class_analysis +> Common.push2 (env.cur, name2);
+ env.phase_class_analysis +> Common.push (env.cur, name2);
expr env e1;
exprl env es
)
| _ ->
let tok = Meta_ast_php_simple.toks_of_any (Expr2 e) +> List.hd in
- env.stats.G.unresolved_calls +> Common.push2 tok;
+ env.stats.G.unresolved_calls +> Common.push tok;
expr env e;
exprl env es
)
@@ -986,15 +986,15 @@ and expr env x =
| Id name1, e2 ->
add_use_edge env (name1, E.Class E.RegularClass);
let tok = Ast.tok_of_name name1 in
- env.stats.G.unresolved_class_access +> Common.push2 tok;
+ env.stats.G.unresolved_class_access +> Common.push tok;
expr env e2;
| e1, Id name2 ->
let tok = Ast.tok_of_name name2 in
- env.stats.G.unresolved_class_access +> Common.push2 tok;
+ env.stats.G.unresolved_class_access +> Common.push tok;
expr env e1;
| _ ->
let tok = Meta_ast_php_simple.toks_of_any (Expr2 e1) +> List.hd in
- env.stats.G.unresolved_class_access +> Common.push2 tok;
+ env.stats.G.unresolved_class_access +> Common.push tok;
exprl env [e1; e2]
)
@@ -1007,11 +1007,11 @@ and expr env x =
expr env (Class_get (Id[ (env.cur.self, tokopt)], Var("$"^s2, tok2)))
| _, Id name2 ->
let tok = Ast.tok_of_name name2 in
- env.stats.G.field_access +> Common.push2 (tok, false);
+ env.stats.G.field_access +> Common.push (tok, false);
expr env e1;
| _ ->
let tok = Meta_ast_php_simple.toks_of_any (Expr2 e1) +> List.hd in
- env.stats.G.unresolved_class_access +> Common.push2 tok;
+ env.stats.G.unresolved_class_access +> Common.push tok;
exprl env [e1; e2]
)
@@ -1027,7 +1027,7 @@ and expr env x =
| Id name -> add_use_edge_instanceof env (name, E.Class E.RegularClass)
| _ ->
let tok = Meta_ast_php_simple.toks_of_any (Expr2 e1) +> List.hd in
- env.stats.G.unresolved_class_access +> Common.push2 tok;
+ env.stats.G.unresolved_class_access +> Common.push tok;
expr env e2
)
@@ -1259,9 +1259,9 @@ let build
xs +> List.iter (fun m ->
G.add_edge (cur.node, m) G.Use envold.g;
);
- envold.stats.G.method_calls +> Common.push2 (tok, true);
+ envold.stats.G.method_calls +> Common.push (tok, true);
| _ ->
- envold.stats.G.method_calls +> Common.push2 (tok, false);
+ envold.stats.G.method_calls +> Common.push (tok, false);
)
);
!(envold.phase_dispatch) +> List.iter (fun (cur, name) ->
View
2 lang_php/analyze/foundation/include_require_php.ml
@@ -248,7 +248,7 @@ let all_increq_of_any =
V.do_visit_with_ref (fun aref -> { V.default_visitor with
V.kexpr = (fun (k, _) x ->
match increq_of_include_stmt x with
- | Some require -> Common.push2 require aref;
+ | Some require -> Common.push require aref;
| None ->
(* do we need to recurse ? *)
k x
View
10 lang_php/analyze/qa_test/coverage_tests_php.ml
@@ -99,7 +99,7 @@ let get_all_calls ?(is_directive_to_filter= (fun _ -> false)) =
match x with
| New (tok, _class_name_ref, _args_opt) ->
(* can not use ')' here, so use the token for new *)
- Common.push2 (None, tok) aref;
+ Common.push (None, tok) aref;
k x;
@@ -111,15 +111,15 @@ let get_all_calls ?(is_directive_to_filter= (fun _ -> false)) =
*)
if is_directive_to_filter str then ()
else
- Common.push2 (Some str, rp) aref;
+ Common.push (Some str, rp) aref;
k x
| Call (ClassGet(_var, _t1, Id methname), (_lp, _args, rp))
| Call (ObjGet(_var, _t1, Id methname), (_lp, _args, rp))
->
let str = Ast_php.str_of_name methname in
- Common.push2 (Some str, rp) aref;
+ Common.push (Some str, rp) aref;
k x
@@ -346,14 +346,14 @@ let coverage_tests
);
incr ok_test_files;
| Problem (test_file, msg) ->
- Common.push2 (test_file, msg) pb_test_files;
+ Common.push (test_file, msg) pb_test_files;
in
let _res, not_done =
Features.Distribution.map_reduce_lazy
~fmap:mapper ~freduce:reducer () test_files_fn
in
not_done +> List.iter (fun test_file ->
- Common.push2 (test_file, "MPI error, see the full log") pb_test_files;
+ Common.push (test_file, "MPI error, see the full log") pb_test_files;
);
pr2 "test dependencies";
View
2 lang_php/analyze/tools/xdebug.ml
@@ -450,7 +450,7 @@ let iter_dumpfile2
raise exn
)
else
- Common.push2 (String.length before_arrow, trace) stack;
+ Common.push (String.length before_arrow, trace) stack;
)
View
20 lang_php/parsing/lib_parsing_php.ml
@@ -106,7 +106,7 @@ let extract_info_visitor recursor =
*)
match i.Parse_info.token with
| Parse_info.OriginTok _ ->
- Common.push2 i globals
+ Common.push i globals
| _ ->
()
)
@@ -212,7 +212,7 @@ let get_static_vars_any any =
match x with
| StaticVars (_tok, xs, _tok2) ->
xs +> Ast.uncomma +> List.iter (fun (dname, _affect_opt) ->
- Common.push2 dname aref
+ Common.push dname aref
);
| _ ->
k x
@@ -225,7 +225,7 @@ let get_returns_any any =
V.kstmt = (fun (k,_vx) x ->
match x with
| Return (_tok1, Some e, _tok2) ->
- Common.push2 e aref
+ Common.push e aref
| _ -> k x
)}) any
@@ -234,14 +234,14 @@ let get_vars_any any =
V.kexpr = (fun (k, _vx) x ->
match x with
| IdVar (dname, _scope) ->
- Common.push2 dname aref
+ Common.push dname aref
(* todo? sure ?? *)
| Lambda (l_use, _def) ->
l_use +> Common.do_option (fun (_tok, xs) ->
xs +> Ast.unparen +> Ast.uncomma +> List.iter (function
| LexicalVar (_is_ref, dname) ->
- Common.push2 dname aref
+ Common.push dname aref
)
);
k x
@@ -278,14 +278,14 @@ let functions_methods_or_topstms_of_program prog =
let visitor = V.mk_visitor { V.default_visitor with
V.kfunc_def = (fun (_k, _) def ->
match def.f_type with
- | FunctionRegular -> Common.push2 def funcs
- | MethodRegular | MethodAbstract -> Common.push2 def methods
+ | FunctionRegular -> Common.push def funcs
+ | MethodRegular | MethodAbstract -> Common.push def methods
| FunctionLambda -> ()
);
V.ktop = (fun (k, _) top ->
match top with
| StmtList xs ->
- Common.push2 xs toplevels
+ Common.push xs toplevels
| _ ->
k top
);
@@ -311,7 +311,7 @@ let get_vars_assignements_any recursor =
xs +> Ast.uncomma +> List.iter (fun (dname, affect_opt) ->
let s = Ast.str_of_dname dname in
affect_opt +> Common.do_option (fun (_tok, scalar) ->
- Common.push2 (s, scalar) aref;
+ Common.push (s, scalar) aref;
);
);
| _ ->
@@ -330,7 +330,7 @@ let get_vars_assignements_any recursor =
(match lval with
| IdVar (dname, _scope) ->
let s = Ast.str_of_dname dname in
- Common.push2 (s, e) aref;
+ Common.push (s, e) aref;
| _ ->
()
)
View
2 lang_php/parsing/test_parsing_php.ml
@@ -50,7 +50,7 @@ let test_parse_php xs =
Parse_php.parse file
)
in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
(*s: add stat for regression testing in hash *)
let s = spf "bad = %d" stat.Parse_info.bad in
if stat.Parse_info.bad = 0
View
6 lang_php/parsing/unparse_php.ml
@@ -120,9 +120,9 @@ let string_of_any any =
match info.Parse_info.token with
| Parse_info.OriginTok p ->
let s = p.Parse_info.str in
- Common.push2 s toks
+ Common.push s toks
| Parse_info.FakeTokStr (s, _opt) ->
- Common.push2 s toks
+ Common.push s toks
| Parse_info.Ab -> ()
| Parse_info.ExpandedTok _ ->
failwith "unparse_php: should not have ExpandedTok"
@@ -140,7 +140,7 @@ let string_of_any any =
| true, true, _ -> pp x; pp " "
| _, _, (";" | "{" | "}") -> pp x; pp "\n"
| false, true, _ when x =~ "^<[a-zA-Z_]" -> pp x; pp " "
- | _ , _, _ -> pp x
+ | _, _, _ -> pp x
);
aux (y::xs)
in
View
2 lang_python/parsing/test_parsing_python.ml
@@ -27,7 +27,7 @@ let test_parse_python xs =
pr2 ("PARSING: " ^ file);
let (_xs, stat) = Parse_python.parse file in
- Common.push2 stat stat_list;
+ Common.push stat stat_list;
);
Parse_info.print_parsing_stat_list !stat_list;
()
View
4 lang_web/parsing/parse_web.ml
@@ -48,13 +48,13 @@ let parse2 filename =
let tmpfile = Common.new_temp_file "web" ".js" in
Common.write_file ~file:tmpfile s;
let ast = Parse_js.parse_program tmpfile in
- Common.push2 (tok, ast) js;
+ Common.push (tok, ast) js;
| "style", [Data (s, tok)] ->
let tmpfile = Common.new_temp_file "web" ".css" in
Common.write_file ~file:tmpfile s;
let (ast, _toks) = Parse_css.parse tmpfile in
- Common.push2 (tok, ast) css;
+ Common.push (tok, ast) css;
| ("script" | "style"), _ ->
failwith "wrong script/style tag"
View
2 main_codegraph.ml
@@ -467,7 +467,7 @@ let analyze_backward_deps graph_file =
if n > 0 then begin
let xs = DM.explain_cell_list_use_edges (i, j) dm gopti in
pr2 (spf " (%d, %d) = %d" i j (List.length xs));
- Common.push2 xs res;
+ Common.push xs res;
end
done
done;
View
2 main_sgrep.ml
@@ -88,7 +88,7 @@ let print_match mvars mvar_binding ii_of_any tokens_matched_code =
in
pr (spf "%s:%d: %s" file line (Common.join ":" strings_metavars));
);
- tokens_matched_code +> List.iter (fun x -> Common.push2 x _matching_tokens)
+ tokens_matched_code +> List.iter (fun x -> Common.push x _matching_tokens)
let print_simple_match tokens_matched_code =
print_match [] [] tokens_matched_code
View
2 main_spatch.ml
@@ -331,7 +331,7 @@ let apply_transfo transfo xs =
then Common.write_file ~file:file s;
end
) with exn ->
- Common.push2 (spf "PB with %s, exn = %s" file (Common.exn_to_s exn)) pbs;
+ Common.push (spf "PB with %s, exn = %s" file (Common.exn_to_s exn)) pbs;
));
!pbs +> List.iter Common.pr2

0 comments on commit a663ce9

Please sign in to comment.
Something went wrong with that request. Please try again.