comparison src/elab_print.sml @ 32:0ff8c2728634

Matching values in signatures
author Adam Chlipala <adamc@hcoop.net>
date Thu, 12 Jun 2008 17:35:51 -0400
parents 1c91c5e6840f
children 44b5405e74c7
comparison
equal deleted inserted replaced
31:1c91c5e6840f 32:0ff8c2728634
273 273
274 and p_sgn env (sgn, _) = 274 and p_sgn env (sgn, _) =
275 case sgn of 275 case sgn of
276 SgnConst sgis => box [string "sig", 276 SgnConst sgis => box [string "sig",
277 newline, 277 newline,
278 p_list_sep newline (p_sgn_item env) sgis, 278 let
279 val (psgis, _) = ListUtil.foldlMap (fn (sgi, env) =>
280 (p_sgn_item env sgi,
281 E.sgiBinds env sgi))
282 env sgis
283 in
284 p_list_sep newline (fn x => x) psgis
285 end,
279 newline, 286 newline,
280 string "end"] 287 string "end"]
281 | SgnVar n => string (#1 (E.lookupSgnNamed env n)) 288 | SgnVar n => string (#1 (E.lookupSgnNamed env n))
282 | SgnError => string "<ERROR>" 289 | SgnError => string "<ERROR>"
283 290
327 334
328 and p_str env (str, _) = 335 and p_str env (str, _) =
329 case str of 336 case str of
330 StrConst ds => box [string "struct", 337 StrConst ds => box [string "struct",
331 newline, 338 newline,
332 p_list_sep newline (p_decl env) ds, 339 p_file env ds,
333 newline, 340 newline,
334 string "end"] 341 string "end"]
335 | StrVar n => string (#1 (E.lookupStrNamed env n)) 342 | StrVar n => string (#1 (E.lookupStrNamed env n))
336 | StrError => string "<ERROR>" 343 | StrError => string "<ERROR>"
337 344
338 fun p_file env file = 345 and p_file env file =
339 let 346 let
340 val (pds, _) = ListUtil.foldlMap (fn (d, env) => 347 val (pds, _) = ListUtil.foldlMap (fn (d, env) =>
341 (p_decl env d, 348 (p_decl env d,
342 E.declBinds env d)) 349 E.declBinds env d))
343 env file 350 env file