comparison src/mono_print.sml @ 51:92361a008a10

FFI through monoize
author Adam Chlipala <adamc@hcoop.net>
date Sun, 22 Jun 2008 10:12:23 -0400
parents 1c91c5e6840f
children 40d146f467c5
comparison
equal deleted inserted replaced
50:d37518b67bd2 51:92361a008a10
56 | TNamed n => 56 | TNamed n =>
57 if !debug then 57 if !debug then
58 string (#1 (E.lookupTNamed env n) ^ "__" ^ Int.toString n) 58 string (#1 (E.lookupTNamed env n) ^ "__" ^ Int.toString n)
59 else 59 else
60 string (#1 (E.lookupTNamed env n)) 60 string (#1 (E.lookupTNamed env n))
61 | TFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
61 62
62 and p_typ env = p_typ' false env 63 and p_typ env = p_typ' false env
63 64
64 fun p_exp' par env (e, _) = 65 fun p_exp' par env (e, _) =
65 case e of 66 case e of
72 | ENamed n => 73 | ENamed n =>
73 if !debug then 74 if !debug then
74 string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n) 75 string (#1 (E.lookupENamed env n) ^ "__" ^ Int.toString n)
75 else 76 else
76 string (#1 (E.lookupENamed env n)) 77 string (#1 (E.lookupENamed env n))
78 | EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
79 | EFfiApp (m, x, es) => box [string "FFI(",
80 string m,
81 string ".",
82 string x,
83 string "(",
84 p_list (p_exp env) es,
85 string "))"]
77 | EApp (e1, e2) => parenIf par (box [p_exp env e1, 86 | EApp (e1, e2) => parenIf par (box [p_exp env e1,
78 space, 87 space,
79 p_exp' true env e2]) 88 p_exp' true env e2])
80 | EAbs (x, t, _, e) => parenIf par (box [string "fn", 89 | EAbs (x, t, _, e) => parenIf par (box [string "fn",
81 space, 90 space,