Mercurial > urweb
comparison src/elab_print.sml @ 5:258261a53842
Elaborating files
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 26 Jan 2008 16:02:47 -0500 |
parents | daa4f1d7a663 |
children | 38bf996e1c2e |
comparison
equal
deleted
inserted
replaced
4:5c3cc348e9e6 | 5:258261a53842 |
---|---|
126 | 126 |
127 and p_con env = p_con' false env | 127 and p_con env = p_con' false env |
128 | 128 |
129 fun p_decl env ((d, _) : decl) = | 129 fun p_decl env ((d, _) : decl) = |
130 case d of | 130 case d of |
131 DCon (x, k, c) => box [string "con", | 131 DCon (x, n, k, c) => box [string "con", |
132 space, | 132 space, |
133 string x, | 133 string x, |
134 space, | 134 string "__", |
135 string "::", | 135 string (Int.toString n), |
136 space, | 136 space, |
137 p_kind k, | 137 string "::", |
138 space, | 138 space, |
139 string "=", | 139 p_kind k, |
140 space, | 140 space, |
141 p_con env c] | 141 string "=", |
142 space, | |
143 p_con env c] | |
142 | 144 |
143 fun p_file env file = | 145 fun p_file env file = |
144 let | 146 let |
145 val (_, pds) = foldr (fn (d, (env, pds)) => | 147 val (_, pds) = ListUtil.mapfoldl (fn (d, env) => |
146 (ElabUtil.declBinds env d, | 148 (ElabUtil.declBinds env d, |
147 p_decl env d :: pds)) | 149 p_decl env d)) |
148 (env, []) file | 150 env file |
149 in | 151 in |
150 p_list_sep newline (fn x => x) pds | 152 p_list_sep newline (fn x => x) pds |
151 end | 153 end |
152 | 154 |
153 end | 155 end |