Skip to content

Commit

Permalink
fix code to use stdcompat
Browse files Browse the repository at this point in the history
  • Loading branch information
aryx committed Apr 19, 2024
1 parent fae014b commit eb4a150
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-and-test.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ local job = {
//TODO: 'windows-latest'
],
'ocaml-compiler': [
// Old version with |> builtin but ideally we would like even before
// Version that I ported ocamlrun to plan9 (need stdcompat
// so we can use |> and bytes type without issues)
'3.10.0',
// Old version with |> builtin
'4.02.1',
// first version with valid ocamlformat
'4.04.1',
//TODO: 3.10.0, but pb with |>
//TODO: Ideally 4.14.1 and ocaml latest (5.2.0)
],
}
},
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
strategy:
matrix:
ocaml-compiler:
- 3.10.0
- 4.02.1
- 4.04.1
os:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-mk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ EXTERNAL_LIB=`ocamlfind query stdcompat`
OCAMLCFLAGS="-I $EXTERNAL_LIB"

#TODO? for windows under cygwin might need -custom
EXTRALINKFLAGS=
EXTRALINKFLAGS="-I $EXTERNAL_LIB stdcompat.cma"

TOP=`pwd`

Expand Down
1 change: 1 addition & 0 deletions lib_core/commons/IO.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
open Stdcompat (* for bytes *)

(*****************************************************************************)
(* Prelude *)
Expand Down
1 change: 1 addition & 0 deletions lib_core/commons/IO.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
open Stdcompat (* for bytes type *)

(** High-order abstract I/O.
Expand Down
3 changes: 2 additions & 1 deletion lib_core/commons/common.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
(* Copyright 2015, 2016, 2017 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)

type byte = char

type bytes = string
(* builtin since OCaml 4.02 (bytes are mutable strings) *)
(* type bytes = string *)

type filename = string
type dirname = string
Expand Down
2 changes: 1 addition & 1 deletion lib_core/commons/common.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

type byte = char
type bytes = string
(* type bytes = string *)

type filename = string
type dirname = string
Expand Down
1 change: 1 addition & 0 deletions lib_core/commons/ocaml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)
open Stdcompat (* for |> *)
open Common

(*****************************************************************************)
Expand Down
1 change: 1 addition & 0 deletions mk/env.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

(*****************************************************************************)
Expand Down
1 change: 1 addition & 0 deletions mk/eval.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module A = Ast
Expand Down
1 change: 1 addition & 0 deletions mk/graph.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module A = Ast
Expand Down
1 change: 1 addition & 0 deletions mk/main.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016, 2018 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module G = Graph
Expand Down
1 change: 1 addition & 0 deletions mk/outofdate.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module G = Graph
Expand Down
1 change: 1 addition & 0 deletions mk/parse.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

let parse file =
Expand Down
1 change: 1 addition & 0 deletions mk/parser.mly
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%{
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

open Ast
Expand Down
1 change: 1 addition & 0 deletions mk/percent.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

(*****************************************************************************)
Expand Down
1 change: 1 addition & 0 deletions mk/scheduler.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module J = Job
Expand Down
1 change: 1 addition & 0 deletions mk/shell.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016, 2018 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

(*****************************************************************************)
Expand Down
1 change: 1 addition & 0 deletions mk/shellenv.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

type t = (string * string list) list
Expand Down
1 change: 1 addition & 0 deletions shell/compile.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
open Stdcompat (* for |> *)
open Common

module A = Ast
Expand Down
1 change: 1 addition & 0 deletions shell/interpreter.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
open Stdcompat (* for |> *)
open Common

module O = Opcode
Expand Down
1 change: 1 addition & 0 deletions shell/main.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module R = Runtime
Expand Down
1 change: 1 addition & 0 deletions shell/op_process.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
open Stdcompat (* for |> *)
open Common

module R = Runtime
Expand Down
1 change: 1 addition & 0 deletions shell/parse.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

module R = Runtime
Expand Down
1 change: 1 addition & 0 deletions shell/parser.mly
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%{
(* Copyright 2016 Yoann Padioleau, see copyright.txt *)
open Stdcompat (* for |> *)
open Common

open Ast
Expand Down
1 change: 1 addition & 0 deletions shell/process.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
open Stdcompat (* for |> *)
open Common

module R = Runtime
Expand Down
1 change: 1 addition & 0 deletions shell/runtime.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
open Stdcompat (* for |> *)
open Common

(*****************************************************************************)
Expand Down

0 comments on commit eb4a150

Please sign in to comment.