Skip to content

Commit 0543c4b

Browse files
committed
wip
1 parent 454d493 commit 0543c4b

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

main.ml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,16 @@ and command = function
12251225
Array.iter gen_sed_file files;
12261226
(* generate [b^"_type_abbrevs.lp"] *)
12271227
let decl_type_abbrevs oc =
1228-
MapStr.iter (Xlp.decl_type_abbrev int oc) map
1228+
let abbrev s (k,(_,n)) =
1229+
string oc "symbol type"; int oc k;
1230+
if n > 0 then begin
1231+
string oc " (a0";
1232+
for i=1 to n-1 do string oc " a"; int oc i done;
1233+
string oc " : Set)"
1234+
end;
1235+
string oc ""; string oc s; string oc ";\n"
1236+
in
1237+
MapStr.iter abbrev map
12291238
in
12301239
Xlp.export (b^"_type_abbrevs") [b^"_types"] decl_type_abbrevs
12311240

xlp.ml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,15 @@ let abbrev_typ oc b =
115115

116116
let typ = abbrev_typ;;
117117

118-
let decl_type_abbrev f oc s (idx,(_d,n)) =
119-
string oc "symbol type"; f oc idx;
120-
if n > 0 then begin
121-
string oc " (a0";
122-
for i=1 to n-1 do string oc " a"; int oc i done;
123-
string oc " : Set)"
124-
end;
125-
string oc ""; string oc s; string oc ";\n"
126-
;;
127-
128118
(* [decl_type_abbrevs oc] outputs on [oc] the type abbreviations. *)
129119
let decl_type_abbrevs oc =
130120
let abbrev s (k,n) =
131121
string oc "symbol type"; digest oc k;
132-
for i=0 to n-1 do string oc " a"; int oc i done;
133-
(* We can use [raw_typ] here since [b] is canonical. *)
122+
if n > 0 then begin
123+
string oc " (a0";
124+
for i=1 to n-1 do string oc " a"; int oc i done;
125+
string oc " : Set)"
126+
end;
134127
string oc ""; string oc s; string oc ";\n"
135128
in
136129
MapStr.iter abbrev !map_typ_abbrev

0 commit comments

Comments
 (0)