Mercurial > urweb
comparison src/mono_print.sml @ 126:76a4d69719d8
Tagging (non-mutual) 'val rec'
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 17 Jul 2008 10:38:03 -0400 |
parents | 6230bdd122e7 |
children | 78d59cf0a0cc |
comparison
equal
deleted
inserted
replaced
125:fd98dd10dce7 | 126:76a4d69719d8 |
---|---|
136 p_exp env e]) es, | 136 p_exp env e]) es, |
137 string ")"] | 137 string ")"] |
138 | 138 |
139 and p_exp env = p_exp' false env | 139 and p_exp env = p_exp' false env |
140 | 140 |
141 fun p_decl env ((d, _) : decl) = | 141 fun p_vali env (x, n, t, e, s) = |
142 let | |
143 val xp = if !debug then | |
144 box [string x, | |
145 string "__", | |
146 string (Int.toString n)] | |
147 else | |
148 string x | |
149 in | |
150 box [xp, | |
151 space, | |
152 string "as", | |
153 space, | |
154 string s, | |
155 space, | |
156 string ":", | |
157 space, | |
158 p_typ env t, | |
159 space, | |
160 string "=", | |
161 space, | |
162 p_exp env e] | |
163 end | |
164 | |
165 fun p_decl env (dAll as (d, _) : decl) = | |
142 case d of | 166 case d of |
143 DVal (x, n, t, e, s) => | 167 DVal vi => box [string "val", |
168 space, | |
169 p_vali env vi] | |
170 | DValRec vis => | |
144 let | 171 let |
145 val xp = if !debug then | 172 val env = E.declBinds env dAll |
146 box [string x, | |
147 string "__", | |
148 string (Int.toString n)] | |
149 else | |
150 string x | |
151 in | 173 in |
152 box [string "val", | 174 box [string "val", |
153 space, | 175 space, |
154 xp, | 176 string "rec", |
155 space, | 177 space, |
156 string "as", | 178 p_list_sep (box [newline, string "and", space]) (p_vali env) vis] |
157 space, | |
158 string s, | |
159 space, | |
160 string ":", | |
161 space, | |
162 p_typ env t, | |
163 space, | |
164 string "=", | |
165 space, | |
166 p_exp env e] | |
167 end | 179 end |
168 | 180 |
169 | DExport (s, n, ts) => box [string "export", | 181 | DExport (s, n, ts) => box [string "export", |
170 space, | 182 space, |
171 p_enamed env n, | 183 p_enamed env n, |