@@ -254,7 +254,14 @@ and stmt_alt_type =
254
254
{
255
255
alt_type_lval : lval ;
256
256
alt_type_arms : type_arm array ;
257
- alt_type_else : stmt option ;
257
+ alt_type_else : block option ;
258
+ }
259
+
260
+ and stmt_alt_port =
261
+ {
262
+ (* else lval is a timeout value. *)
263
+ alt_port_arms : (lval * lval ) array ;
264
+ alt_port_else : (lval * block ) option ;
258
265
}
259
266
260
267
and block' = stmt array
@@ -264,12 +271,6 @@ and stmt_decl =
264
271
DECL_mod_item of (ident * mod_item)
265
272
| DECL_slot of (slot_key * (slot identified))
266
273
267
- and stmt_alt_port =
268
- {
269
- (* else lval is a timeout value. *)
270
- alt_port_arms : (lval * lval ) array ;
271
- alt_port_else : (lval * stmt ) option ;
272
- }
273
274
274
275
and stmt_while =
275
276
{
@@ -1233,10 +1234,25 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit =
1233
1234
fmt ff " ) " ;
1234
1235
fmt_obr ff;
1235
1236
Array. iter (fmt_type_arm ff) at.alt_type_arms;
1237
+ begin
1238
+ match at.alt_type_else with
1239
+ None -> ()
1240
+ | Some block ->
1241
+ fmt ff " @\n " ;
1242
+ fmt_obox ff;
1243
+ fmt ff " case (_) " ;
1244
+ fmt_obr ff;
1245
+ fmt_stmts ff block.node;
1246
+ fmt_cbb ff;
1247
+ end ;
1236
1248
fmt_cbb ff;
1237
-
1238
1249
| STMT_alt_port _ -> fmt ff " ?stmt_alt_port?"
1239
- | STMT_note _ -> fmt ff " ?stmt_note?"
1250
+ | STMT_note at ->
1251
+ begin
1252
+ fmt ff " note " ;
1253
+ fmt_atom ff at;
1254
+ fmt ff " ;"
1255
+ end
1240
1256
| STMT_slice (dst , src , slice ) ->
1241
1257
fmt_lval ff dst;
1242
1258
fmt ff " = " ;
@@ -1245,7 +1261,7 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit =
1245
1261
fmt_slice ff slice;
1246
1262
fmt ff " ;" ;
1247
1263
end
1248
-
1264
+
1249
1265
and fmt_arm
1250
1266
(ff :Format.formatter )
1251
1267
(fmt_arm_case_expr : Format.formatter -> unit )
0 commit comments