| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
open Tac2val |
| 12 |
open Tac2ffi |
| 13 |
open Tac2types |
| 14 |
|
| 15 |
module Value = Tac2ffi |
| 16 |
|
| 17 |
|
| 18 |
let make_to_repr f = Tac2ffi.make_repr (fun _ -> assert false) f |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
let to_qhyp v = match Value.to_block v with |
| 23 |
| (0, [| i |]) -> AnonHyp (Value.to_int i) |
| 24 |
| (1, [| id |]) -> NamedHyp (CAst.make (Value.to_ident id)) |
| 25 |
| _ -> assert false |
| 26 |
|
| 27 |
let qhyp = make_to_repr to_qhyp |
| 28 |
|
| 29 |
let to_bindings = function |
| 30 |
| ValInt 0 -> NoBindings |
| 31 |
| ValBlk (0, [| vl |]) -> |
| 32 |
ImplicitBindings (Value.to_list Value.to_constr vl) |
| 33 |
| ValBlk (1, [| vl |]) -> |
| 34 |
ExplicitBindings ((Value.to_list (fun p -> to_pair to_qhyp Value.to_constr p) vl)) |
| 35 |
| _ -> assert false |
| 36 |
|
| 37 |
let bindings = make_to_repr to_bindings |
| 38 |
|
| 39 |
let to_constr_with_bindings v = match Value.to_tuple v with |
| 40 |
| [| c; bnd |] -> (Value.to_constr c, to_bindings bnd) |
| 41 |
| _ -> assert false |
| 42 |
|
| 43 |
let constr_with_bindings = make_to_repr to_constr_with_bindings |
| 44 |
|
| 45 |
let val_format = Tac2dyn.Val.create "format" |
| 46 |
|
| 47 |
let format = repr_ext val_format |