File tree Expand file tree Collapse file tree 11 files changed +14
-7
lines changed
Expand file tree Collapse file tree 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 =
721721 if x <> 0n then b else c
722722 | Const_js_false
723723 | Const_js_null
724+ | Const_module_alias
724725 | Const_js_undefined -> c
725726 | Const_js_true
726727 | Const_string _
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ and size_constant x =
324324 | Const_nativeint _
325325 | Const_immstring _
326326 | Const_pointer _
327- | Const_js_null | Const_js_undefined
327+ | Const_js_null | Const_js_undefined | Const_module_alias
328328 | Const_js_true | Const_js_false
329329 -> 1
330330 | 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
3535let rec is_some_none_aux (x : Lam_constant.t ) acc =
3636 match x with
3737 | Const_some v -> is_some_none_aux v (acc + 1 )
38+ | Const_module_alias
3839 | Const_js_undefined -> acc
3940 | _ -> - 1
4041
@@ -50,6 +51,7 @@ translate_some (x : Lam_constant.t) : J.expression =
5051 else nested_some_none depth (E. optional_block (translate Const_js_undefined ))
5152and translate (x : Lam_constant.t ) : J.expression =
5253 match x with
54+ | Const_module_alias -> E. undefined (* TODO *)
5355 | Const_some s -> translate_some s
5456 | Const_js_true -> E. bool true
5557 | 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) =
6262 | Blk_extension_slot -> None
6363 | Blk_na s -> if s = " " then None else Some s
6464
65- let module_alias = Some " alias"
65+ (* let module_alias = Some "alias" *)
6666let comment_of_pointer_info (x : Lam_pointer_info.t )=
6767 match x with
6868 | Pt_constructor {name;_}
6969 | Pt_variant {name} -> Some name
70- | Pt_module_alias -> module_alias
70+ (* | Pt_module_alias -> module_alias *)
7171 | Pt_na -> None
Original file line number Diff line number Diff line change 4040 | Const_float_array of string list
4141 | Const_immstring of string
4242 | Const_some of t
43+ | Const_module_alias
4344 (* eventually we can remove it, since we know
4445 [constant] is [undefined] or not
4546 *)
4647
4748
4849let rec eq_approx (x : t ) (y : t ) =
4950 match x with
51+ | Const_module_alias -> y = Const_module_alias
5052 | Const_js_null -> y = Const_js_null
5153 | Const_js_undefined -> y = Const_js_undefined
5254 | Const_js_true -> y = Const_js_true
Original file line number Diff line number Diff line change @@ -43,5 +43,6 @@ type t =
4343 (* eventually we can remove it, since we know
4444 [constant] is [undefined] or not
4545 *)
46+ | Const_module_alias
4647val eq_approx : t -> t -> bool
4748val 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
4444 begin match p with
4545 | Pt_constructor {name;cstrs} -> Const_pointer (i, Pt_constructor {name; cstrs})
4646 | 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
4848 | Pt_builtin_boolean -> if i = 0 then Const_js_false else Const_js_true
4949 | Pt_shape_none ->
5050 Lam_constant. lam_none
Original file line number Diff line number Diff line change 2626type t =
2727 | Pt_constructor of {name : string ; cstrs : int * int }
2828 | Pt_variant of {name : string }
29- | Pt_module_alias
29+ (* | Pt_module_alias *)
3030 | Pt_na
Original file line number Diff line number Diff line change 2626type t =
2727 | Pt_constructor of {name : string ; cstrs : int * int }
2828 | Pt_variant of { name : string }
29- | Pt_module_alias
29+ (* | Pt_module_alias *)
3030 | 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) =
2222 | Const_js_true -> fprintf ppf " #true"
2323 | Const_js_false -> fprintf ppf " #false"
2424 | Const_js_null -> fprintf ppf " #null"
25+ | Const_module_alias -> fprintf ppf " #alias"
2526 | Const_js_undefined -> fprintf ppf " #undefined"
2627 | (Const_int n ) -> fprintf ppf " %i" n
2728 | (Const_char c ) -> fprintf ppf " %C" c
You can’t perform that action at this time.
0 commit comments