Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Apr 26, 2020
1 parent db5bb47 commit 88c97d1
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 45 deletions.
64 changes: 39 additions & 25 deletions src/.ppcache/API.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(*09dd92d029bc5129509dbb9e46c435ff8be4de41 *src/API.ml --cookie elpi_trace="false"*)
(*02b4f581e688efce20aa37de517a1147f85853f8 *src/API.ml --cookie elpi_trace="false"*)
#1 "src/API.ml"
module type Runtime = module type of Runtime_trace_off
let r = ref ((module Runtime_trace_off) : (module Runtime))
Expand Down Expand Up @@ -1338,35 +1338,49 @@ module PPX =
args)
let show_ty_ast = ED.Conversion.show_ty_ast
end
let readback_int ~depth _ c s x =
BuiltInData.int.Conversion.readback ~depth ((new Conversion.ctx) []) c
s x
let readback_float ~depth _ c s x =
BuiltInData.float.Conversion.readback ~depth ((new Conversion.ctx) [])
c s x
let readback_string ~depth _ c s x =
BuiltInData.string.Conversion.readback ~depth ((new Conversion.ctx) [])
let readback_int ~depth h c s x =
BuiltInData.int.Conversion.readback ~depth ((new Conversion.ctx) h#raw)
c s x
let readback_float ~depth h c s x =
BuiltInData.float.Conversion.readback ~depth
((new Conversion.ctx) h#raw) c s x
let readback_string ~depth h c s x =
BuiltInData.string.Conversion.readback ~depth
((new Conversion.ctx) h#raw) c s x
let readback_list = BuiltInData.readback_list
let readback_loc ~depth _ c s x =
BuiltInData.loc.Conversion.readback ~depth ((new Conversion.ctx) []) c
s x
let readback_nominal ~depth _ c s x =
let readback_loc ~depth h c s x =
BuiltInData.loc.Conversion.readback ~depth ((new Conversion.ctx) h#raw)
c s x
let readback_nominal ~depth h c s x =
BuiltInData.nominal.Conversion.readback ~depth
((new Conversion.ctx) []) c s x
let embed_int ~depth _ c s x =
BuiltInData.int.Conversion.embed ~depth ((new Conversion.ctx) []) c s x
let embed_float ~depth _ c s x =
BuiltInData.float.Conversion.embed ~depth ((new Conversion.ctx) []) c s
x
let embed_string ~depth _ c s x =
BuiltInData.string.Conversion.embed ~depth ((new Conversion.ctx) []) c
((new Conversion.ctx) h#raw) c s x
let readback_bool ~depth h c s x =
BuiltInData.bool.Conversion.readback ~depth
((new Conversion.ctx) h#raw) c s x
let readback_char ~depth h c s x =
BuiltInData.char.Conversion.readback ~depth
((new Conversion.ctx) h#raw) c s x
let embed_int ~depth h c s x =
BuiltInData.int.Conversion.embed ~depth ((new Conversion.ctx) h#raw) c
s x
let embed_float ~depth h c s x =
BuiltInData.float.Conversion.embed ~depth ((new Conversion.ctx) h#raw)
c s x
let embed_string ~depth h c s x =
BuiltInData.string.Conversion.embed ~depth ((new Conversion.ctx) h#raw)
c s x
let embed_list = BuiltInData.embed_list
let embed_loc ~depth _ c s x =
BuiltInData.loc.Conversion.embed ~depth ((new Conversion.ctx) []) c s x
let embed_nominal ~depth _ c s x =
BuiltInData.nominal.Conversion.embed ~depth ((new Conversion.ctx) []) c
let embed_loc ~depth h c s x =
BuiltInData.loc.Conversion.embed ~depth ((new Conversion.ctx) h#raw) c
s x
let embed_nominal ~depth h c s x =
BuiltInData.nominal.Conversion.embed ~depth
((new Conversion.ctx) h#raw) c s x
let embed_bool ~depth h c s x =
BuiltInData.bool.Conversion.embed ~depth ((new Conversion.ctx) h#raw) c
s x
let embed_char ~depth h c s x =
BuiltInData.char.Conversion.embed ~depth ((new Conversion.ctx) h#raw) c
s x
type context_description =
| C: ('a, 'k, 'c) Conversion.context -> context_description
Expand Down
6 changes: 5 additions & 1 deletion src/.ppcache/API.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(*262f7f42585df543898448e5ff436973e6f64995 *src/API.mli --cookie elpi_trace="false"*)
(*a0dedc3be4f51309a9b50b6fd946f6c63f474e0c *src/API.mli --cookie elpi_trace="false"*)
#1 "src/API.mli"
[@@@ocaml.text " This module is the API for clients of the Elpi library. "]
[@@@ocaml.text
Expand Down Expand Up @@ -685,13 +685,17 @@ sig
('a, 'c) Conversion.readback -> ('a list, 'c) Conversion.readback
val readback_loc : (Ast.Loc.t, 'c) Conversion.readback
val readback_nominal : (RawData.constant, 'c) Conversion.readback
val readback_bool : (bool, 'h) Conversion.readback
val readback_char : (char, 'h) Conversion.readback
val embed_int : (int, 'c) Conversion.embedding
val embed_float : (float, 'c) Conversion.embedding
val embed_string : (string, 'c) Conversion.embedding
val embed_list :
('a, 'c) Conversion.embedding -> ('a list, 'c) Conversion.embedding
val embed_loc : (Ast.Loc.t, 'c) Conversion.embedding
val embed_nominal : (RawData.constant, 'c) Conversion.embedding
val embed_bool : (bool, 'h) Conversion.embedding
val embed_char : (char, 'h) Conversion.embedding
type context_description =
| C: ('a, 'k, 'c) Conversion.context -> context_description
val readback_context :
Expand Down
26 changes: 15 additions & 11 deletions src/API.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1066,19 +1066,23 @@ module Doc = struct
let show_ty_ast = ED.Conversion.show_ty_ast
end

let readback_int ~depth _ c s x = BuiltInData.int.Conversion.readback ~depth (new Conversion.ctx []) c s x
let readback_float ~depth _ c s x = BuiltInData.float.Conversion.readback ~depth (new Conversion.ctx []) c s x
let readback_string ~depth _ c s x = BuiltInData.string.Conversion.readback ~depth (new Conversion.ctx []) c s x
let readback_int ~depth h c s x = BuiltInData.int.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x
let readback_float ~depth h c s x = BuiltInData.float.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x
let readback_string ~depth h c s x = BuiltInData.string.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x
let readback_list = BuiltInData.readback_list
let readback_loc ~depth _ c s x = BuiltInData.loc.Conversion.readback ~depth (new Conversion.ctx []) c s x
let readback_nominal ~depth _ c s x = BuiltInData.nominal.Conversion.readback ~depth (new Conversion.ctx []) c s x

let embed_int ~depth _ c s x = BuiltInData.int.Conversion.embed ~depth (new Conversion.ctx []) c s x
let embed_float ~depth _ c s x = BuiltInData.float.Conversion.embed ~depth (new Conversion.ctx []) c s x
let embed_string ~depth _ c s x = BuiltInData.string.Conversion.embed ~depth (new Conversion.ctx []) c s x
let readback_loc ~depth h c s x = BuiltInData.loc.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x
let readback_nominal ~depth h c s x = BuiltInData.nominal.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x
let readback_bool ~depth h c s x = BuiltInData.bool.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x
let readback_char ~depth h c s x = BuiltInData.char.Conversion.readback ~depth (new Conversion.ctx h#raw) c s x

let embed_int ~depth h c s x = BuiltInData.int.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
let embed_float ~depth h c s x = BuiltInData.float.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
let embed_string ~depth h c s x = BuiltInData.string.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
let embed_list = BuiltInData.embed_list
let embed_loc ~depth _ c s x = BuiltInData.loc.Conversion.embed ~depth (new Conversion.ctx []) c s x
let embed_nominal ~depth _ c s x = BuiltInData.nominal.Conversion.embed ~depth (new Conversion.ctx []) c s x
let embed_loc ~depth h c s x = BuiltInData.loc.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
let embed_nominal ~depth h c s x = BuiltInData.nominal.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
let embed_bool ~depth h c s x = BuiltInData.bool.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
let embed_char ~depth h c s x = BuiltInData.char.Conversion.embed ~depth (new Conversion.ctx h#raw) c s x
type context_description =
| C : ('a,'k,'c) Conversion.context -> context_description

Expand Down
4 changes: 4 additions & 0 deletions src/API.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1136,13 +1136,17 @@ module PPX : sig
val readback_list : ('a, 'c) Conversion.readback -> ('a list,'c) Conversion.readback
val readback_loc : (Ast.Loc.t, 'c) Conversion.readback
val readback_nominal : (RawData.constant, 'c) Conversion.readback
val readback_bool : (bool, 'h) Conversion.readback
val readback_char : (char, 'h) Conversion.readback

val embed_int : (int, 'c) Conversion.embedding
val embed_float : (float, 'c) Conversion.embedding
val embed_string : (string, 'c) Conversion.embedding
val embed_list : ('a, 'c) Conversion.embedding -> ('a list, 'c) Conversion.embedding
val embed_loc : (Ast.Loc.t, 'c) Conversion.embedding
val embed_nominal : (RawData.constant, 'c) Conversion.embedding
val embed_bool : (bool, 'h) Conversion.embedding
val embed_char : (char, 'h) Conversion.embedding

type context_description =
| C : ('a,'k,'c) Conversion.context -> context_description
Expand Down
4 changes: 0 additions & 4 deletions src/builtin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1379,17 +1379,13 @@ module PPX = struct

let readback_pair = readback_pair
let readback_option = readback_option
let readback_bool ~depth _ c s x = bool.API.Conversion.readback ~depth (new Conversion.ctx []) c s x
let readback_char ~depth _ c s x = char.API.Conversion.readback ~depth (new Conversion.ctx []) c s x

let readback_triple = readback_triple
let readback_quadruple = readback_quadruple
let readback_quintuple = readback_quintuple

let embed_pair = embed_pair
let embed_option = embed_option
let embed_bool ~depth _ c s x = bool.API.Conversion.embed ~depth (new Conversion.ctx []) c s x
let embed_char ~depth _ c s x = char.API.Conversion.embed ~depth (new Conversion.ctx []) c s x

let embed_triple = embed_triple
let embed_quadruple = embed_quadruple
Expand Down
4 changes: 0 additions & 4 deletions src/builtin.mli
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,13 @@ module PPX : sig

val readback_pair : ('a, 'h) API.Conversion.readback -> ('b, 'h) API.Conversion.readback -> ('a * 'b, 'h) API.Conversion.readback
val readback_option : ('a, 'h) API.Conversion.readback -> ('a option, 'h) API.Conversion.readback
val readback_bool : (bool, 'h) API.Conversion.readback
val readback_char : (char, 'h) API.Conversion.readback

val readback_triple : ('a, 'h) API.Conversion.readback -> ('b, 'h) API.Conversion.readback -> ('c, 'h) API.Conversion.readback -> ('a * 'b * 'c, 'h) API.Conversion.readback
val readback_quadruple : ('a, 'h) API.Conversion.readback -> ('b, 'h) API.Conversion.readback -> ('c, 'h) API.Conversion.readback -> ('d, 'h) API.Conversion.readback -> ('a * 'b * 'c * 'd, 'h) API.Conversion.readback
val readback_quintuple : ('a, 'h) API.Conversion.readback -> ('b, 'h) API.Conversion.readback -> ('c, 'h) API.Conversion.readback -> ('d, 'h) API.Conversion.readback -> ('e, 'h) API.Conversion.readback -> ('a * 'b * 'c * 'd * 'e, 'h) API.Conversion.readback

val embed_pair : ('a, 'h) API.Conversion.embedding -> ('b, 'h) API.Conversion.embedding -> ('a * 'b, 'h) API.Conversion.embedding
val embed_option : ('a, 'h) API.Conversion.embedding -> ('a option, 'h) API.Conversion.embedding
val embed_bool : (bool, 'h) API.Conversion.embedding
val embed_char : (char, 'h) API.Conversion.embedding

val embed_triple : ('a, 'h) API.Conversion.embedding -> ('b, 'h) API.Conversion.embedding -> ('c, 'h) API.Conversion.embedding -> ('a * 'b * 'c, 'h) API.Conversion.embedding
val embed_quadruple : ('a, 'h) API.Conversion.embedding -> ('b, 'h) API.Conversion.embedding -> ('c, 'h) API.Conversion.embedding -> ('d, 'h) API.Conversion.embedding -> ('a * 'b * 'c * 'd, 'h) API.Conversion.embedding
Expand Down

0 comments on commit 88c97d1

Please sign in to comment.