comparison src/core_print.sml @ 247:5c50b17f5e4a

Corify tables
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 09:00:28 -0400
parents 71bafe66dbe1
children 42dfb0d61cf0
comparison
equal deleted inserted replaced
246:3aa010e97db9 247:5c50b17f5e4a
329 p_exp env e]) es, 329 p_exp env e]) es,
330 string ")"] 330 string ")"]
331 331
332 and p_exp env = p_exp' false env 332 and p_exp env = p_exp' false env
333 333
334 fun p_named x n =
335 if !debug then
336 box [string x,
337 string "__",
338 string (Int.toString n)]
339 else
340 string x
341
334 fun p_vali env (x, n, t, e, s) = 342 fun p_vali env (x, n, t, e, s) =
335 let 343 let
336 val xp = if !debug then 344 val xp = p_named x n
337 box [string x,
338 string "__",
339 string (Int.toString n)]
340 else
341 string x
342 in 345 in
343 box [xp, 346 box [xp,
344 space, 347 space,
345 string "as", 348 string "as",
346 space, 349 space,
430 p_enamed env n, 433 p_enamed env n,
431 space, 434 space,
432 string "as", 435 string "as",
433 space, 436 space,
434 p_con env (#2 (E.lookupENamed env n))] 437 p_con env (#2 (E.lookupENamed env n))]
438 | DTable (x, n, c, s) => box [string "table",
439 space,
440 p_named x n,
441 space,
442 string "as",
443 space,
444 string s,
445 space,
446 string ":",
447 space,
448 p_con env c]
435 449
436 fun p_file env file = 450 fun p_file env file =
437 let 451 let
438 val (pds, _) = ListUtil.foldlMap (fn (d, env) => 452 val (pds, _) = ListUtil.foldlMap (fn (d, env) =>
439 (p_decl env d, 453 (p_decl env d,