Mercurial > urweb
comparison src/mono_print.sml @ 808:d8f58d488cfb
Mutual datatypes through Pathcheck
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 May 2009 15:55:15 -0400 |
parents | fa2019a63ea4 |
children | 493f44759879 |
comparison
equal
deleted
inserted
replaced
807:61a1f5c5ae2c | 808:d8f58d488cfb |
---|---|
375 | 375 |
376 fun p_datatype env (x, n, cons) = | 376 fun p_datatype env (x, n, cons) = |
377 let | 377 let |
378 val env = E.pushDatatype env x n cons | 378 val env = E.pushDatatype env x n cons |
379 in | 379 in |
380 box [string "datatype", | 380 box [string x, |
381 space, | |
382 string x, | |
383 space, | 381 space, |
384 string "=", | 382 string "=", |
385 space, | 383 space, |
386 p_list_sep (box [space, string "|", space]) | 384 p_list_sep (box [space, string "|", space]) |
387 (fn (x, n, NONE) => if !debug then (string (x ^ "__" ^ Int.toString n)) | 385 (fn (x, n, NONE) => if !debug then (string (x ^ "__" ^ Int.toString n)) |
391 cons] | 389 cons] |
392 end | 390 end |
393 | 391 |
394 fun p_decl env (dAll as (d, _) : decl) = | 392 fun p_decl env (dAll as (d, _) : decl) = |
395 case d of | 393 case d of |
396 DDatatype x => p_datatype env x | 394 DDatatype x => box [string "datatype", |
395 space, | |
396 p_list_sep (box [space, string "and", space]) (p_datatype (E.declBinds env dAll)) x] | |
397 | DVal vi => box [string "val", | 397 | DVal vi => box [string "val", |
398 space, | 398 space, |
399 p_vali env vi] | 399 p_vali env vi] |
400 | DValRec vis => | 400 | DValRec vis => |
401 let | 401 let |