let rec do_all
(env, pr, pr_celem, pr_cspace, pr_space, pr_arity, pr_barrier,
- indent, unindent)
+ indent, unindent, eatspace)
generating xxs before =
(* Just to be able to copy paste the code from pretty_print_cocci.ml. *)
mcode print_string_box lp; fullType ty; close_box();
mcode print_string rp
| Ast.TypeExp(ty) -> fullType ty
+ | Ast.Constructor(lp,ty,rp,init) ->
+ mcode print_string_box lp; fullType ty; close_box();
+ mcode print_string rp; initialiser true init
| Ast.MetaErr(name,_,_,_) ->
failwith "metaErr not handled"
| Ast.Logical(lop) -> logicalOp lop
and arithOp = function
- Ast.Plus -> print_string "+"
+ Ast.Plus -> print_string "+"
| Ast.Minus -> print_string "-"
| Ast.Mul -> print_string "*"
| Ast.Div -> print_string "/"
Ast.BaseType(ty,strings) ->
print_between pr_space (mcode print_string) strings
| Ast.SignedT(sgn,ty) -> mcode sign sgn; print_option_prespace typeC ty
- | Ast.Pointer(ty,star) -> fullType ty; ft_space ty; mcode print_string star
+ | Ast.Pointer(ty,star) ->
+ fullType ty; ft_space ty; mcode print_string star; eatspace()
| Ast.FunctionPointer(ty,lp1,star,rp1,lp2,params,rp2) ->
print_function_pointer (ty,lp1,star,rp1,lp2,params,rp2)
(function _ -> ())
Ast.VoidType -> print_string "void"
| Ast.CharType -> print_string "char"
| Ast.ShortType -> print_string "short"
+ | Ast.ShortIntType -> print_string "short int"
| Ast.IntType -> print_string "int"
| Ast.DoubleType -> print_string "double"
+ | Ast.LongDoubleType -> print_string "long double"
| Ast.FloatType -> print_string "float"
| Ast.LongType -> print_string "long"
+ | Ast.LongIntType -> print_string "long int"
| Ast.LongLongType -> print_string "long long"
+ | Ast.LongLongIntType -> print_string "long long int"
| Ast.SizeType -> print_string "size_t "
| Ast.SSizeType -> print_string "ssize_t "
| Ast.PtrDiffType -> print_string "ptrdiff_t "
newline_after()
let rec pp_list_list_any (envs, pr, pr_celem, pr_cspace, pr_space, pr_arity,
- pr_barrier, indent, unindent)
+ pr_barrier, indent, unindent, eatspace)
generating xxs before =
List.iter
(function env ->
do_all (env, pr, pr_celem, pr_cspace, pr_space, pr_arity, pr_barrier,
- indent, unindent)
+ indent, unindent, eatspace)
generating xxs before)
envs