X-Git-Url: https://git.hcoop.net/bpt/coccinelle.git/blobdiff_plain/97111a47d707638a835d7498276ac6768a052ee8..17ba07880e1838028b4516ba7a2db2147b3aa1c9:/python/pycocci_aux.ml diff --git a/python/pycocci_aux.ml b/python/pycocci_aux.ml index 5900641..6bc09b9 100644 --- a/python/pycocci_aux.ml +++ b/python/pycocci_aux.ml @@ -1,5 +1,7 @@ (* - * Copyright 2010, INRIA, University of Copenhagen + * Copyright 2012, INRIA + * Julia Lawall, Gilles Muller + * Copyright 2010-2011, INRIA, University of Copenhagen * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix @@ -34,6 +36,29 @@ let call_pretty f a = let exprrep = call_pretty Pretty_print_c.pp_expression_gen +let commalistrep list_printer elem_printer comma_printer x = + (call_pretty list_printer x, + List.map + (function x -> + call_pretty elem_printer (comma_printer x) (* drop commas *)) + x) + +let exprlistrep = + commalistrep Pretty_print_c.pp_arg_list_gen Pretty_print_c.pp_arg_gen + Ast_c.unwrap + +let paramlistrep = + commalistrep Pretty_print_c.pp_param_list_gen Pretty_print_c.pp_param_gen + Ast_c.unwrap + +let initlistrep = + commalistrep Pretty_print_c.pp_init_list_gen Pretty_print_c.pp_init_gen + Ast_c.unwrap + +let fieldlistrep = + commalistrep Pretty_print_c.pp_field_list_gen Pretty_print_c.pp_field_gen + (function x -> x) + let stringrep = function Ast_c.MetaIdVal (s,_) -> s | Ast_c.MetaFuncVal s -> s