aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cprint.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2017-02-06 16:53:12 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2017-02-06 16:53:12 +0100
commit8ace28abf0c70ebdc423baea9ae0e8c68e0b60ed (patch)
tree43e89a45ed321081cbcaaac06165a7e62b84a34b /cparser/Cprint.ml
parent9d4bb7ec914566b3920cca3c6823515448fb65c1 (diff)
parent4afaf8c23274752c8a6067bd785e114578068702 (diff)
downloadcompcert-8ace28abf0c70ebdc423baea9ae0e8c68e0b60ed.tar.gz
compcert-8ace28abf0c70ebdc423baea9ae0e8c68e0b60ed.zip
Merge branch 'elaboration-of-attributes'
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