File tree 11 files changed +14
-7
lines changed
11 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -721,6 +721,7 @@ let if_ (a : t) (b : t) (c : t) : t =
721
721
if x <> 0n then b else c
722
722
| Const_js_false
723
723
| Const_js_null
724
+ | Const_module_alias
724
725
| Const_js_undefined -> c
725
726
| Const_js_true
726
727
| Const_string _
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ and size_constant x =
324
324
| Const_nativeint _
325
325
| Const_immstring _
326
326
| Const_pointer _
327
- | Const_js_null | Const_js_undefined
327
+ | Const_js_null | Const_js_undefined | Const_module_alias
328
328
| Const_js_true | Const_js_false
329
329
-> 1
330
330
| Const_unicode _ (* TODO: this seems to be not good heurisitives*)
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module E = Js_exp_make
35
35
let rec is_some_none_aux (x : Lam_constant.t ) acc =
36
36
match x with
37
37
| Const_some v -> is_some_none_aux v (acc + 1 )
38
+ | Const_module_alias
38
39
| Const_js_undefined -> acc
39
40
| _ -> - 1
40
41
@@ -50,6 +51,7 @@ translate_some (x : Lam_constant.t) : J.expression =
50
51
else nested_some_none depth (E. optional_block (translate Const_js_undefined ))
51
52
and translate (x : Lam_constant.t ) : J.expression =
52
53
match x with
54
+ | Const_module_alias -> E. undefined (* TODO *)
53
55
| Const_some s -> translate_some s
54
56
| Const_js_true -> E. bool true
55
57
| Const_js_false -> E. bool false
Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ let comment_of_tag_info (x : Lam_tag_info.t) =
62
62
| Blk_extension_slot -> None
63
63
| Blk_na s -> if s = " " then None else Some s
64
64
65
- let module_alias = Some " alias"
65
+ (* let module_alias = Some "alias" *)
66
66
let comment_of_pointer_info (x : Lam_pointer_info.t )=
67
67
match x with
68
68
| Pt_constructor {name;_}
69
69
| Pt_variant {name} -> Some name
70
- | Pt_module_alias -> module_alias
70
+ (* | Pt_module_alias -> module_alias *)
71
71
| Pt_na -> None
Original file line number Diff line number Diff line change 40
40
| Const_float_array of string list
41
41
| Const_immstring of string
42
42
| Const_some of t
43
+ | Const_module_alias
43
44
(* eventually we can remove it, since we know
44
45
[constant] is [undefined] or not
45
46
*)
46
47
47
48
48
49
let rec eq_approx (x : t ) (y : t ) =
49
50
match x with
51
+ | Const_module_alias -> y = Const_module_alias
50
52
| Const_js_null -> y = Const_js_null
51
53
| Const_js_undefined -> y = Const_js_undefined
52
54
| Const_js_true -> y = Const_js_true
Original file line number Diff line number Diff line change @@ -43,5 +43,6 @@ type t =
43
43
(* eventually we can remove it, since we know
44
44
[constant] is [undefined] or not
45
45
*)
46
+ | Const_module_alias
46
47
val eq_approx : t -> t -> bool
47
48
val lam_none : t
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ let rec convert_constant ( const : Lambda.structured_constant) : Lam_constant.t
44
44
begin match p with
45
45
| Pt_constructor {name;cstrs} -> Const_pointer (i, Pt_constructor {name; cstrs})
46
46
| Pt_variant {name} -> Const_pointer (i,Pt_variant {name})
47
- | Pt_module_alias -> Const_pointer (i, Pt_module_alias )
47
+ | Pt_module_alias -> Const_module_alias
48
48
| Pt_builtin_boolean -> if i = 0 then Const_js_false else Const_js_true
49
49
| Pt_shape_none ->
50
50
Lam_constant. lam_none
Original file line number Diff line number Diff line change 26
26
type t =
27
27
| Pt_constructor of {name : string ; cstrs : int * int }
28
28
| Pt_variant of {name : string }
29
- | Pt_module_alias
29
+ (* | Pt_module_alias *)
30
30
| Pt_na
Original file line number Diff line number Diff line change 26
26
type t =
27
27
| Pt_constructor of {name : string ; cstrs : int * int }
28
28
| Pt_variant of { name : string }
29
- | Pt_module_alias
29
+ (* | Pt_module_alias *)
30
30
| Pt_na
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ let rec struct_const ppf (cst : Lam_constant.t) =
22
22
| Const_js_true -> fprintf ppf " #true"
23
23
| Const_js_false -> fprintf ppf " #false"
24
24
| Const_js_null -> fprintf ppf " #null"
25
+ | Const_module_alias -> fprintf ppf " #alias"
25
26
| Const_js_undefined -> fprintf ppf " #undefined"
26
27
| (Const_int n ) -> fprintf ppf " %i" n
27
28
| (Const_char c ) -> fprintf ppf " %C" c
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ let values_of_export
100
100
in
101
101
match arity, persistent_closed_lambda with
102
102
| Single Arity_na ,
103
- (None | Some (Lconst (Const_pointer ( _ , Pt_module_alias)) )) -> acc
103
+ (None | Some (Lconst Const_module_alias )) -> acc
104
104
| Submodule [||], None -> acc
105
105
| _ ->
106
106
let cmj_value : Js_cmj_format.cmj_value =
You can’t perform that action at this time.
0 commit comments