File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ module Label = struct
25
25
26
26
end
27
27
28
+ module Constant = struct
29
+ type t = Parsetree .constant =
30
+ Pconst_integer of string * char option
31
+ | Pconst_char of char
32
+ | Pconst_string of string * string option
33
+ | Pconst_float of string * char option
34
+
35
+ let of_constant x = x
36
+
37
+ let to_constant x = x
38
+
39
+ end
28
40
29
41
let may_tuple ?loc tup = function
30
42
| [] -> None
Original file line number Diff line number Diff line change 4
4
5
5
(* * {1 Convenience functions to help build and deconstruct AST fragments.} *)
6
6
7
- open Parsetree
8
7
open Asttypes
9
8
open Ast_helper
9
+ open Parsetree
10
10
11
11
(* * {2 Compatibility modules} *)
12
12
@@ -26,6 +26,23 @@ module Label : sig
26
26
27
27
end
28
28
29
+ (* * {2 Provides a unified abstraction over differences in Parsetree.constant and Asttypes.constant
30
+ * types defined in ocaml 4.03 and 4.02 respectively}*)
31
+ module Constant : sig
32
+ type t = Parsetree .constant =
33
+ Pconst_integer of string * char option
34
+ | Pconst_char of char
35
+ | Pconst_string of string * string option
36
+ | Pconst_float of string * char option
37
+
38
+ (* * Convert Asttypes.constant to Constant.t *)
39
+ val of_constant : Parsetree .constant -> t
40
+
41
+ (* * Convert Constant.t to Asttypes.constant *)
42
+ val to_constant : t -> Parsetree .constant
43
+
44
+ end
45
+
29
46
(* * {2 Misc} *)
30
47
31
48
val lid : ?loc : loc -> string -> lid
You can’t perform that action at this time.
0 commit comments