File tree 4 files changed +7
-47
lines changed
4 files changed +7
-47
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ type t = J.statement
34
34
let return_stmt ?comment e : t =
35
35
{statement_desc = Return {return_value = e; } ; comment}
36
36
37
- (* let return_unit : t list =
38
- [{ statement_desc = Return {return_value = E.unit; } ;
39
- comment = None}] *)
40
37
41
38
let empty_stmt : t =
42
39
{ statement_desc = Block [] ; comment = None }
@@ -301,21 +298,7 @@ let assign ?comment id e : t =
301
298
statement_desc = J. Exp ( E. assign (E. var id) e ) ;
302
299
comment
303
300
}
304
- (* let assign_unit ?comment id : t =
305
- {
306
- statement_desc = J.Exp( E.assign (E.var id) E.unit);
307
- comment
308
- }
309
- let declare_unit ?comment id : t =
310
- {
311
- statement_desc =
312
- J.Variable { ident = id;
313
- value = Some E.unit;
314
- property = Variable;
315
- ident_info = {used_stats = NA}
316
- };
317
- comment
318
- } *)
301
+
319
302
320
303
let while_ ?comment ?label ?env (e : E.t ) (st : J.block ) : t =
321
304
let env =
Original file line number Diff line number Diff line change @@ -563,35 +563,7 @@ let translate loc (prim_name : string)
563
563
| " caml_blit_bytes"
564
564
->
565
565
call Js_runtime_modules. bytes
566
-
567
- | "caml_register_named_value" ->
568
- (* *
569
- callback.ml
570
- {[ external register_named_value : string -> Obj.t -> unit
571
- = "caml_register_named_value" ]}
572
-
573
- See the manual chap19, Interfacing C with OCaml
574
-
575
- {[
576
- let f x = print_string "f is applied to "; print_int x; print_newline()
577
- let _ = Callback.register "test function" f
578
- ]}
579
-
580
- On the C side
581
- {[
582
- let f x = print_string "f is applied to "; print_int x; print_newline()
583
- let _ = Callback.register "test function" f
584
- ]}
585
-
586
- [caml_named_value] is a c primitive but not belong to OCaml/runtimedef.ml,
587
- so we don't needs
588
- handle it
589
- *)
590
- E. unit
591
-
592
566
| " caml_backtrace_status"
593
-
594
-
595
567
| " caml_get_exception_backtrace"
596
568
| " caml_get_exception_raw_backtrace"
597
569
| " caml_record_backtrace"
Original file line number Diff line number Diff line change 15
15
[@@@ bs.config { flags = [|" -bs-no-cross-module-opt" |]}]
16
16
(* Registering OCaml values with the C runtime for later callbacks *)
17
17
18
+ #if BS then
19
+ let register _ _ = ()
20
+ let register_exception _ _ = ()
21
+ #else
18
22
external register_named_value : string -> Obj .t -> unit
19
23
= " caml_register_named_value"
20
24
@@ -25,3 +29,4 @@ let register_exception name (exn : exn) =
25
29
let exn = Obj. repr exn in
26
30
let slot = if Obj. tag exn = Obj. object_tag then exn else Obj. field exn 0 in
27
31
register_named_value name slot
32
+ #end
Original file line number Diff line number Diff line change 12
12
(* special exception on linking described in the file LICENSE. *)
13
13
(* *)
14
14
(* *************************************************************************)
15
-
15
+ [ @@@ bs.config { flags = [| " -bs-no-cross-module-opt " |]}]
16
16
open Printf
17
17
18
18
let printers = ref []
You can’t perform that action at this time.
0 commit comments