comparison src/core_print.sml @ 185:19ee24bffbc0

FFI datatypes
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 17:57:47 -0400
parents d11754ffe252
children 88d46972de53
comparison
equal deleted inserted replaced
184:98c29e3986d3 185:19ee24bffbc0
160 handle E.UnboundNamed _ => string ("CONSTRUCTOR_" ^ Int.toString n) 160 handle E.UnboundNamed _ => string ("CONSTRUCTOR_" ^ Int.toString n)
161 161
162 fun p_patCon env pc = 162 fun p_patCon env pc =
163 case pc of 163 case pc of
164 PConVar n => p_con_named env n 164 PConVar n => p_con_named env n
165 | PConFfi (m, x) => box [string "FFI(", 165 | PConFfi {mod = m, con, ...} => box [string "FFI(",
166 string m, 166 string m,
167 string ".", 167 string ".",
168 string x, 168 string con,
169 string ")"] 169 string ")"]
170 170
171 fun p_pat' par env (p, _) = 171 fun p_pat' par env (p, _) =
172 case p of 172 case p of
173 PWild => string "_" 173 PWild => string "_"
174 | PVar (s, _) => string s 174 | PVar (s, _) => string s
197 string (#1 (E.lookupERel env n) ^ "_" ^ Int.toString n) 197 string (#1 (E.lookupERel env n) ^ "_" ^ Int.toString n)
198 else 198 else
199 string (#1 (E.lookupERel env n))) 199 string (#1 (E.lookupERel env n)))
200 handle E.UnboundRel _ => string ("UNBOUND_" ^ Int.toString n)) 200 handle E.UnboundRel _ => string ("UNBOUND_" ^ Int.toString n))
201 | ENamed n => p_enamed env n 201 | ENamed n => p_enamed env n
202 | ECon (n, NONE) => p_con_named env n 202 | ECon (pc, NONE) => p_patCon env pc
203 | ECon (n, SOME e) => parenIf par (box [p_con_named env n, 203 | ECon (pc, SOME e) => parenIf par (box [p_patCon env pc,
204 space, 204 space,
205 p_exp' true env e]) 205 p_exp' true env e])
206 | EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"] 206 | EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
207 | EFfiApp (m, x, es) => box [string "FFI(", 207 | EFfiApp (m, x, es) => box [string "FFI(",
208 string m, 208 string m,