comparison src/mono_print.sml @ 185:19ee24bffbc0

FFI datatypes
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 17:57:47 -0400
parents c0ea24dcb86f
children 88d46972de53
comparison
equal deleted inserted replaced
184:98c29e3986d3 185:19ee24bffbc0
78 handle E.UnboundNamed _ => string ("CONSTRUCTOR_" ^ Int.toString n) 78 handle E.UnboundNamed _ => string ("CONSTRUCTOR_" ^ Int.toString n)
79 79
80 fun p_patCon env pc = 80 fun p_patCon env pc =
81 case pc of 81 case pc of
82 PConVar n => p_con_named env n 82 PConVar n => p_con_named env n
83 | PConFfi (m, x) => box [string "FFI(", 83 | PConFfi {mod = m, con, ...} => box [string "FFI(",
84 string m, 84 string m,
85 string ".", 85 string ".",
86 string x, 86 string con,
87 string ")"] 87 string ")"]
88 88
89 fun p_pat' par env (p, _) = 89 fun p_pat' par env (p, _) =
90 case p of 90 case p of
91 PWild => string "_" 91 PWild => string "_"
92 | PVar (s, _) => string s 92 | PVar (s, _) => string s
115 string (#1 (E.lookupERel env n) ^ "_" ^ Int.toString n) 115 string (#1 (E.lookupERel env n) ^ "_" ^ Int.toString n)
116 else 116 else
117 string (#1 (E.lookupERel env n))) 117 string (#1 (E.lookupERel env n)))
118 handle E.UnboundRel _ => string ("UNBOUND_" ^ Int.toString n)) 118 handle E.UnboundRel _ => string ("UNBOUND_" ^ Int.toString n))
119 | ENamed n => p_enamed env n 119 | ENamed n => p_enamed env n
120 | ECon (n, NONE) => p_con_named env n 120 | ECon (pc, NONE) => p_patCon env pc
121 | ECon (n, SOME e) => parenIf par (box [p_con_named env n, 121 | ECon (pc, SOME e) => parenIf par (box [p_patCon env pc,
122 space, 122 space,
123 p_exp' true env e]) 123 p_exp' true env e])
124 124
125 | EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"] 125 | EFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
126 | EFfiApp (m, x, es) => box [string "FFI(", 126 | EFfiApp (m, x, es) => box [string "FFI(",
127 string m, 127 string m,
128 string ".", 128 string ".",