aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cprint.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Cprint.ml')
-rw-r--r--cparser/Cprint.ml15
1 files changed, 7 insertions, 8 deletions
diff --git a/cparser/Cprint.ml b/cparser/Cprint.ml
index 2a110104..0a927873 100644
--- a/cparser/Cprint.ml
+++ b/cparser/Cprint.ml
@@ -142,13 +142,14 @@ let rec dcl ?(pp_indication=true) pp ty n =
dcl pp t n'
| TArray(t, sz, a) ->
let n' pp =
+ n pp;
begin match a with
- | [] -> n pp
- | _ -> fprintf pp " (%a%t)" attributes a n
+ | [] -> fprintf pp "["
+ | _ -> fprintf pp "[%a " attributes a
end;
begin match sz with
- | None -> fprintf pp "[]"
- | Some i -> fprintf pp "[%Ld]" i
+ | None -> fprintf pp "]"
+ | Some i -> fprintf pp "%Ld]" i
end in
dcl pp t n'
| TFun(tres, args, vararg, a) ->
@@ -156,10 +157,8 @@ let rec dcl ?(pp_indication=true) pp ty n =
dcl pp ty
(fun pp -> fprintf pp " %a" ident id) in
let n' pp =
- begin match a with
- | [] -> n pp
- | _ -> fprintf pp " (%a%t)" attributes a n
- end;
+ attributes pp a;
+ n pp;
fprintf pp "(";
if pp_indication then fprintf pp "@[<hov 0>";
begin match args with