Skip to content

Commit

Permalink
Merge pull request #50 from hackwaly/ocaml-5.1
Browse files Browse the repository at this point in the history
Add OCaml 5.1 support
  • Loading branch information
sim642 authored Aug 18, 2023
2 parents 98eba78 + 3ec7ffb commit d9d3ff6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- ubuntu-latest
# - macos-latest
ocaml-compiler:
- ocaml-base-compiler.5.1.0~rc1
- 5.0.x
- 4.14.x
- 4.13.x
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

### Added

* Add OCaml 5.1 support.

## 1.2.0 - 2023-07-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
(name earlybird)
(synopsis "OCaml debug adapter")
(depends
(ocaml (and (>= 4.12.0) (< 5.1)))
(ocaml (and (>= 4.12.0)))
(ppx_deriving (>= 5.1))
(ppx_deriving_yojson (>= 3.6.1))
(menhir (and (>= 20201216) :build))
Expand Down
2 changes: 1 addition & 1 deletion earlybird.opam
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ homepage: "https://github.com/hackwaly/ocamlearlybird"
bug-reports: "https://github.com/hackwaly/ocamlearlybird/issues"
depends: [
"dune" {>= "2.8"}
"ocaml" {>= "4.12.0" & < "5.1"}
"ocaml" {>= "4.12.0"}
"ppx_deriving" {>= "5.1"}
"ppx_deriving_yojson" {>= "3.6.1"}
"menhir" {>= "20201216" & build}
Expand Down
4 changes: 4 additions & 0 deletions src/debugger/misc/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ module Path = struct
match path with
| Pident id -> Ident.name id
| Pdot (p, d) -> aux p ^ "." ^ d
| Pextra_ty (p, Pcstr_ty d) [@if ocaml_version >= (5, 1, 0)] -> aux p ^ "." ^ d
| Papply (p1, p2) -> aux p1 ^ " (" ^ aux p2 ^ ")"
| Pextra_ty (p, Pext_ty) [@if ocaml_version >= (5, 1, 0)] -> aux p
in
aux path

let rec to_longident path =
match path with
| Pident id -> Longident.Lident (Ident.name id)
| Pdot (p, d) -> Longident.Ldot (to_longident p, d)
| Pextra_ty (p, Pcstr_ty d) [@if ocaml_version >= (5, 1, 0)] -> Longident.Ldot (to_longident p, d)
| Papply (p1, p2) -> Longident.Lapply (to_longident p1, to_longident p2)
| Pextra_ty (p, Pext_ty) [@if ocaml_version >= (5, 1, 0)] -> to_longident p
end

0 comments on commit d9d3ff6

Please sign in to comment.