comparison src/core_print.sml @ 48:0a5c312de09a

Start of FFI
author Adam Chlipala <adamc@hcoop.net>
date Sun, 22 Jun 2008 09:27:29 -0400
parents 02f42e9a1825
children 8e9920db39f2
comparison
equal deleted inserted replaced
47:ac4c0b4111ba 48:0a5c312de09a
88 ((if !debug then 88 ((if !debug then
89 string (#1 (E.lookupCNamed env n) ^ "__" ^ Int.toString n) 89 string (#1 (E.lookupCNamed env n) ^ "__" ^ Int.toString n)
90 else 90 else
91 string (#1 (E.lookupCNamed env n))) 91 string (#1 (E.lookupCNamed env n)))
92 handle E.UnboundNamed _ => string ("UNBOUNDN_" ^ Int.toString n)) 92 handle E.UnboundNamed _ => string ("UNBOUNDN_" ^ Int.toString n))
93 | CFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
93 94
94 | CApp (c1, c2) => parenIf par (box [p_con env c1, 95 | CApp (c1, c2) => parenIf par (box [p_con env c1,
95 space, 96 space,
96 p_con' true env c2]) 97 p_con' true env c2])
97 | CAbs (x, k, c) => parenIf par (box [string "fn", 98 | CAbs (x, k, c) => parenIf par (box [string "fn",
154 ((if !debug then 155 ((if !debug then
155 string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n) 156 string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n)
156 else 157 else
157 string (#1 (E.lookupENamed env n))) 158 string (#1 (E.lookupENamed env n)))
158 handle E.UnboundNamed _ => string ("UNBOUNDN_" ^ Int.toString n)) 159 handle E.UnboundNamed _ => string ("UNBOUNDN_" ^ Int.toString n))
160 | EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
161 | EFfiApp (m, x, es) => box [string "FFI(",
162 string m,
163 string ".",
164 string x,
165 string "(",
166 p_list (p_exp env) es,
167 string "))"]
159 | EApp (e1, e2) => parenIf par (box [p_exp env e1, 168 | EApp (e1, e2) => parenIf par (box [p_exp env e1,
160 space, 169 space,
161 p_exp' true env e2]) 170 p_exp' true env e2])
162 | EAbs (x, t, _, e) => parenIf par (box [string "fn", 171 | EAbs (x, t, _, e) => parenIf par (box [string "fn",
163 space, 172 space,