Printf.sprintf "0x%x"
let open_out_with path f =
- open_out_bin path
- +> maybe f
- +> tee (fun _ -> close_out ch)
- +> function
- `Val v -> v
- | `Error e -> raise e
+ let ch =
+ open_out_bin path in
+ maybe f ch
+ +> tee (fun _ -> close_out ch)
+ +> function
+ `Val v -> v
+ | `Error e -> raise e
let open_in_with path f =
- open_in_bin path
- +> maybe f
- +> tee (fun _ -> close_in ch)
- +> function
- `Val v -> v
- | `Error e -> raise e
+ let ch =
+ open_in_bin path in
+ maybe f ch
+ +> tee (fun _ -> close_in ch)
+ +> function
+ `Val v -> v
+ | `Error e -> raise e
let undefined = Obj.magic 42
let undef = undefined
| ExplicitNamespace name ->
make "ExplicitNamespace" name
| StaticProtectedNamespace _ ->
- todo "this namespace is not support."
+ failwith "this namespace is not support."
| PrivateNamespace name ->
make "PrivateNamespace" name
let example name =
let ch =
open_in_bin @@ Printf.sprintf "example/%s.abc" name in
- Swflib.Abc.disasm @@ Swflib.BytesIn.of_channel ch
+ Swflib.Abc.read @@ Swflib.BytesIn.of_channel ch
let ok x y =
OUnit.assert_equal ~printer:Xml.to_string_fmt (normalize x) (normalize y)