comparison src/cjr_print.sml @ 897:2faf558b2d05

FFI manual section
author Adam Chlipala <adamc@hcoop.net>
date Sat, 18 Jul 2009 15:08:21 -0400
parents 8f2159040bbb
children 7a4b026e45dd
comparison
equal deleted inserted replaced
896:0ae8894d5c97 897:2faf558b2d05
83 handle CjrEnv.UnboundNamed _ => string ("__uwd_UNBOUND__" ^ Int.toString n)) 83 handle CjrEnv.UnboundNamed _ => string ("__uwd_UNBOUND__" ^ Int.toString n))
84 | TDatatype (Option, n, xncs) => 84 | TDatatype (Option, n, xncs) =>
85 (case ListUtil.search #3 (!xncs) of 85 (case ListUtil.search #3 (!xncs) of
86 NONE => raise Fail "CjrPrint: TDatatype marked Option has no constructor with an argument" 86 NONE => raise Fail "CjrPrint: TDatatype marked Option has no constructor with an argument"
87 | SOME t => 87 | SOME t =>
88 case #1 t of 88 if isUnboxable t then
89 TDatatype _ => p_typ' par env t 89 p_typ' par env t
90 | TFfi ("Basis", "string") => p_typ' par env t 90 else
91 | _ => box [p_typ' par env t, 91 box [p_typ' par env t,
92 string "*"]) 92 string "*"])
93 | TDatatype (Default, n, _) => 93 | TDatatype (Default, n, _) =>
94 (box [string "struct", 94 (box [string "struct",
95 space, 95 space,
96 string ("__uwd_" ^ #1 (E.lookupDatatype env n) ^ "_" ^ Int.toString n ^ "*")] 96 string ("__uwd_" ^ #1 (E.lookupDatatype env n) ^ "_" ^ Int.toString n ^ "*")]
97 handle CjrEnv.UnboundNamed _ => string ("__uwd_UNBOUND__" ^ Int.toString n)) 97 handle CjrEnv.UnboundNamed _ => string ("__uwd_UNBOUND__" ^ Int.toString n))