Skip to content

Commit

Permalink
Work w/ backported closure change from OCaml 5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahbeckford committed Sep 18, 2024
1 parent 4f950ec commit 02c3383
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
(name earlybird)
(synopsis "OCaml debug adapter")
(depends
(ocaml (and (>= 4.12.0)))
(ocaml (and (>= 4.14.2)))
(dkml-base-compiler (and (>= 4.14.2~) (< 5.0.0~)))
(ppx_deriving (>= 5.1))
(ppx_deriving_yojson (>= 3.6.1))
(menhir (and (>= 20201216) :build))
Expand Down
3 changes: 2 additions & 1 deletion earlybird.opam
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ homepage: "https://github.com/hackwaly/ocamlearlybird"
bug-reports: "https://github.com/hackwaly/ocamlearlybird/issues"
depends: [
"dune" {>= "2.8"}
"ocaml" {>= "4.12.0"}
"ocaml" {>= "4.14.2"}
"dkml-base-compiler" {>= "4.14.2~" & < "5.0.0~"}
"ppx_deriving" {>= "5.1"}
"ppx_deriving_yojson" {>= "3.6.1"}
"menhir" {>= "20201216" & build}
Expand Down
5 changes: 4 additions & 1 deletion src/debugger/inspect/eval.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
open Ground

[%%if ocaml_version >= (5, 2, 0)]
(* [A]
In DkML, OCaml 4.14.2 has backported the closure change from OCaml 5.2.0.
See https://github.com/diskuv/dkml-compiler/blob/321d4ac16c74507e1cc34aa14677e7434fe976e2/src/p/ocaml-common-4_14-a06-linearclosures.md. *)
[%%if ocaml_version >= (4, 14, 2)]
let ident_find_same_heap id (compenv: Instruct.compilation_env) =
match compenv.ce_closure with
| Not_in_closure -> raise Not_found
Expand Down
5 changes: 4 additions & 1 deletion src/debugger/inspect/value_scope.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ class virtual scope_value =
method! num_named = -1
end

[%%if ocaml_version >= (5, 2, 0)]
(* [A]
In DkML, OCaml 4.14.2 has backported the closure change from OCaml 5.2.0.
See https://github.com/diskuv/dkml-compiler/blob/321d4ac16c74507e1cc34aa14677e7434fe976e2/src/p/ocaml-common-4_14-a06-linearclosures.md. *)
[%%if ocaml_version >= (4, 14, 2)]
let iter_compenv_heap f (compenv: Instruct.compilation_env) =
match compenv.ce_closure with
| Not_in_closure -> ()
Expand Down

0 comments on commit 02c3383

Please sign in to comment.