jan_flanders

Untitled

Dec 12th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.51 KB | None | 0 0
  1.     let make_constant_value r c t =
  2.         let v = (match classify ctx t, c with
  3.         | _, None -> HVNone
  4.         | (KInt | KFloat | KUInt | KBool) as kind, Some c ->
  5.             (match c with
  6.             | TInt i -> if kind = KUInt then HVUInt i else HVInt i
  7.             | TFloat s -> HVFloat (float_of_string s)
  8.             | TBool b -> HVBool b
  9.             | TNull -> error ("In Flash9, null can't be used as basic type " ^ s_type (print_context()) t) p
  10.             | KType(HMPath([],"String")), (Some (TString s)) -> HVString s
  11.             | _ -> assert false)
  12.         | _, Some TNull -> HVNone
Advertisement
Add Comment
Please, Sign In to add comment