Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OCaml 4.10 #2529

Merged
merged 4 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ jobs:
- OCAML_VERSION: "4.09.x"
- NPM_CONFIG_PREFIX: "~/.npm-global"
<<: *common_steps
4.10.0:
docker:
- image: ocurrent/opam:debian-9-ocaml-4.10
environment:
- TERM: dumb
- OCAML_VERSION: "4.10.x"
- NPM_CONFIG_PREFIX: "~/.npm-global"
<<: *common_steps
esy_build:
docker:
- image: ocaml/opam2:debian-9-ocaml-4.06
Expand Down Expand Up @@ -179,4 +187,5 @@ workflows:
- 4.07.0
- 4.08.0
- 4.09.0
- 4.10.0
- esy_build
2 changes: 1 addition & 1 deletion esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"version": "3.5.4",
"dependencies": {
"ocaml": " >= 4.2.0 < 4.10.0",
"ocaml": " >= 4.2.0 < 4.11.0",
"@opam/fix": "*",
"@opam/ocamlfind": "*",
"@opam/menhir": " >= 20170418.0.0",
Expand Down
4 changes: 4 additions & 0 deletions formatTest/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ VERBOSE=${VERBOSE:-}
OCAML_VERSION=`echo $(ocaml -version) | egrep -o '[0-9]+.[0-9]+.[0-9]+' | head -1`
OCAML_VERSION=${OCAML_VERSION:-"4.02.3"}

case ${OCAML_VERSION} in
4.10.*) OCAML_VERSION=4.09.0;; # Outputs from OCaml 4.10 are exepected to be the same as OCaml 4.09
esac

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

REFMT="$DIR/../_build/install/default/bin/refmt"
Expand Down
2 changes: 1 addition & 1 deletion reason.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/facebook/reason.git"
},
"dependencies": {
"ocaml": " >= 4.2.0 < 4.10.0",
"ocaml": " >= 4.2.0 < 4.11.0",
"@opam/fix": "*",
"@opam/ocamlfind": "*",
"@opam/menhir": " >= 20170418.0.0",
Expand Down
2 changes: 1 addition & 1 deletion reason.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build: [
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.02" & < "4.10"}
"ocaml" {>= "4.02" & < "4.11"}
"dune" {>= "1.4"}
"ocamlfind" {build}
"menhir" {>= "20170418"}
Expand Down
2 changes: 1 addition & 1 deletion rtop.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@opam/dune": "*",
"@esy-ocaml/reason": "^3.2.0",
"@opam/utop": " >= 1.17.0",
"ocaml": ">= 4.2.0 < 4.10.0"
"ocaml": ">= 4.2.0 < 4.11.0"
},
"devDependencies": {
"@esy-ocaml/merlin": "*",
Expand Down
2 changes: 1 addition & 1 deletion rtop.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build: [
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.02" & < "4.10"}
"ocaml" {>= "4.02" & < "4.11"}
"dune" {>= "1.4"}
"reason"
"utop" {>= "1.17"}
Expand Down
4 changes: 2 additions & 2 deletions src/reason-parser/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

(rule
(targets ocaml_util.ml)
(deps ../generate/select.exe ocaml_util.ml-4.09 ocaml_util.ml-4.08
(deps ../generate/select.exe ocaml_util.ml-4.10 ocaml_util.ml-4.09 ocaml_util.ml-4.08
ocaml_util.ml-4.07 ocaml_util.ml-4.06 ocaml_util.ml-default)
(action
(with-stdout-to
%{targets}
(run ../generate/select.exe ocaml_util.ml-4.09 ocaml_util.ml-4.08
(run ../generate/select.exe ocaml_util.ml-4.10 ocaml_util.ml-4.09 ocaml_util.ml-4.08
ocaml_util.ml-4.07 ocaml_util.ml-4.06 ocaml_util.ml-default))))

(rule
Expand Down
11 changes: 11 additions & 0 deletions src/reason-parser/ocaml_util.ml-4.10
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
let warn_latin1 lexbuf =
Location.deprecated (Location.curr lexbuf) "ISO-Latin1 characters in identifiers"
;;

let print_loc ppf loc =
Location.print_loc ppf loc


let print_error loc f ppf x =
let error = Location.error_of_printer ~loc f x in
Location.print_report ppf error