Skip to content

Commit b9dc09c

Browse files
committed
Fix a bunch of deprecation warnings & errors
1 parent 64b4968 commit b9dc09c

File tree

14 files changed

+46
-46
lines changed

14 files changed

+46
-46
lines changed

src/ace-lib/ace.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type 'a editor = {
2424
mutable sync_observers : (bool -> unit) list;
2525
}
2626

27-
let ace : Ace_types.ace Js.t = Js.Unsafe.variable "ace"
27+
let ace : Ace_types.ace Js.t = Js.Unsafe.pure_js_expr "ace"
2828
let edit el = ace##(edit el)
2929

3030
let create_position r c =
@@ -90,7 +90,7 @@ let focus { editor } = editor##focus
9090

9191
let create_editor editor_div =
9292
let editor = edit editor_div in
93-
Js.Unsafe.set editor "$blockScrolling" (Js.Unsafe.variable "Infinity");
93+
Js.Unsafe.set editor "$blockScrolling" (Js.Unsafe.pure_js_expr "Infinity");
9494
let data =
9595
{ editor; editor_div;
9696
marks = [];
@@ -130,7 +130,7 @@ let string_of_make_type: mark_type -> string = function
130130
| Warning -> "warning"
131131
| Message -> "message"
132132

133-
let require s = (Js.Unsafe.variable "ace")##(require (Js.string s))
133+
let require s = (Js.Unsafe.pure_js_expr "ace")##(require (Js.string s))
134134

135135
type range = Ace_types.range Js.t
136136
let range_cstr = (require "ace/range")##._Range

src/app/learnocaml_playground_main.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ open Learnocaml_common
1414
open Learnocaml_data
1515
open Learnocaml_config
1616

17-
module H = Tyxml_js.Html
18-
1917
let init_tabs, select_tab =
2018
mk_tab_handlers "toplevel" ["editor"]
2119

src/app/learnocaml_student_view.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module El = struct
3434
name: string;
3535
btn: Html_types.div H.elt;
3636
tab: Html_types.div H.elt;
37-
}
37+
}[@@ocaml.warning "-69"]
3838
let tid name = {
3939
name;
4040
btn = snd (id ("learnocaml-exo-button-" ^ name));

src/grader/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
(wrapped false)
2222
(modules introspection_intf)
2323
(modules_without_implementation introspection_intf)
24-
(libraries learnocaml_report ty))
24+
(libraries unix learnocaml_report ty))
2525

2626
;; dynamic part, on which Test_lib depends
2727
(library

src/grader/grading.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* Learn-OCaml is distributed under the terms of the MIT license. See the
77
* included LICENSE file for details. *)
88

9-
open Toploop_ext
10-
119
type error =
1210
| Internal_error of string * Toploop_ext.error
1311
| User_code_error of Toploop_ext.error

src/grader/grading_cli.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ let get_grade ?callback ?timeout ?dirname exo solution =
5656
try
5757
let oc = Unix.out_channel_of_descr out_fd in
5858
let (ret: grader_answer) =
59-
Load_path.init [ cmis_dir ] ;
59+
Load_path.init
60+
~auto_include:Load_path.no_auto_include
61+
[ cmis_dir ] ;
6062
Toploop_unix.initialize () ;
6163
let divert name chan cb =
6264
let redirection = Toploop_unix.redirect_channel name chan cb in

src/grader/test_lib.mli

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@
517517
(** Grading function for variables and references. *)
518518
module Test_functions_ref_var : sig
519519

520-
(** [test_ref ty got exp] returns {!LearnOcaml_report.Success 1}
520+
(** [test_ref ty got exp] returns {!Learnocaml_report.Success 1}
521521
report if reference [got] value is equal to [exp] and
522-
{!LearnOcaml_report.Failure} report otherwise.
522+
{!Learnocaml_report.Failure} report otherwise.
523523
524524
{e WARNING:} contrary to other grading functions, you cannot
525525
use this function to evaluate a reference defined or modified
@@ -529,22 +529,22 @@
529529
val test_ref :
530530
'a Ty.ty -> 'a ref -> 'a -> Learnocaml_report.t
531531

532-
(** [test_variable ty name r] returns {!LearnOcaml_report.Success
532+
(** [test_variable ty name r] returns {!Learnocaml_report.Success
533533
1} report if variable named [name] exists and is equal to
534-
[r]. Otherwise returns {!LearnOcaml_report.Failure} report.*)
534+
[r]. Otherwise returns {!Learnocaml_report.Failure} report.*)
535535
val test_variable :
536536
'a Ty.ty -> string -> 'a -> Learnocaml_report.t
537537

538538
(** [test_variable_property ty name cb] returns the report
539539
resulting of application of cb to variable named [name] if it
540-
exists. Otherwise returns {!LearnOcaml_report.Failure} report. *)
540+
exists. Otherwise returns {!Learnocaml_report.Failure} report. *)
541541
val test_variable_property :
542542
'a Ty.ty -> string -> ('a -> Learnocaml_report.t) -> Learnocaml_report.t
543543

544-
(** [test_variable ty name r] returns {!LearnOcaml_report.Success
544+
(** [test_variable ty name r] returns {!Learnocaml_report.Success
545545
1} report if variable named [name] exists and is equal to
546546
variable with the same name defined in solution. Otherwise returns
547-
{!LearnOcaml_report.Failure} report.*)
547+
{!Learnocaml_report.Failure} report.*)
548548
val test_variable_against_solution :
549549
'a Ty.ty -> string -> Learnocaml_report.t
550550

@@ -620,7 +620,7 @@
620620
outputs.
621621
622622
A test [(arg-1, r, out, err)] results in a
623-
{!LearnOcaml_report.Success 1} report if the student function
623+
{!Learnocaml_report.Success 1} report if the student function
624624
applied to [arg-1] is equal to [r] and if standard output and
625625
standard error messages match [out] and [err] respectively. The
626626
result of a test is a {!Learnocaml_report.Failure} report otherwise.
@@ -642,7 +642,7 @@
642642
named [name] by comparing outputs obtained with the student
643643
function against outputs of [rf].
644644
645-
A test [arg-1] results in a {!LearnOcaml_report.Success 1} report
645+
A test [arg-1] results in a {!Learnocaml_report.Success 1} report
646646
if the student function applied to [arg-1] gives the same
647647
result than the solution function [rf] applied to [arg-1]. Otherwise
648648
the result of a test is a {!Learnocaml_report.Failure} report.
@@ -668,7 +668,7 @@
668668
which must be defined under name [name] in the corresponding
669669
[solution.ml] file.
670670
671-
A test [arg-1] results in a {!LearnOcaml_report.Success 1} report
671+
A test [arg-1] results in a {!Learnocaml_report.Success 1} report
672672
if the student function applied to [arg-1] gives the same
673673
result than the solution function [rf] applied to
674674
[arg-1]. Otherwise the result of a test is a
@@ -713,7 +713,7 @@
713713
outputs.
714714
715715
A test [(arg-1, arg-2, r, out, err)] results in a
716-
{!LearnOcaml_report.Success 1} report if the student function
716+
{!Learnocaml_report.Success 1} report if the student function
717717
applied to [arg-1] and [arg-2] is equal to [r] and if standard
718718
output and standard error messages match [out] and [err]
719719
respectively. The result of a test is a
@@ -738,7 +738,7 @@
738738
named [name] by comparing outputs obtained with the student
739739
function against outputs of [rf].
740740
741-
A test [(arg-1, arg-2)] results in a {!LearnOcaml_report.Success
741+
A test [(arg-1, arg-2)] results in a {!Learnocaml_report.Success
742742
1} report if the student function applied to [arg-1] and
743743
[arg-2] gives the same result than the solution function [rf]
744744
applied to the same arguments. Otherwise the result of a test is a
@@ -768,7 +768,7 @@
768768
be defined under name [name] in the corresponding [solution.ml]
769769
file.
770770
771-
A test [(arg-1, arg-2)] results in a {!LearnOcaml_report.Success
771+
A test [(arg-1, arg-2)] results in a {!Learnocaml_report.Success
772772
1} report if the student function applied to [arg-1] and
773773
[arg-2] gives the same result than the solution function [rf]
774774
applied to the same arguments. Otherwise the result of a test
@@ -813,7 +813,7 @@
813813
outputs.
814814
815815
A test [(arg-1, arg-2, arg-3, r, out, err)] results in a
816-
{!LearnOcaml_report.Success 1} report if the student function
816+
{!Learnocaml_report.Success 1} report if the student function
817817
applied to [arg-1], [arg-2] and [arg-3] is equal to [r] and if
818818
standard output and standard error messages match [out] and
819819
[err] respectively. The result of a test is a
@@ -838,7 +838,7 @@
838838
function against outputs of [rf].
839839
840840
A test [(arg-1, arg-2, arg-3)] results in a
841-
{!LearnOcaml_report.Success 1} report if the student function
841+
{!Learnocaml_report.Success 1} report if the student function
842842
applied to [arg-1], [arg-2] and [arg-3] gives the same result
843843
than the solution function [rf] applied to the same
844844
arguments. Otherwise the result of a test is a
@@ -870,7 +870,7 @@
870870
file.
871871
872872
A test [(arg-1, arg-2, arg-3)] results in a
873-
{!LearnOcaml_report.Success 1} report if the student function
873+
{!Learnocaml_report.Success 1} report if the student function
874874
applied to [arg-1], [arg-2] and [arg-3] gives the same result
875875
than the solution function [rf] applied to the same
876876
arguments. Otherwise the result of a test is a
@@ -916,7 +916,7 @@
916916
outputs.
917917
918918
A test [(arg-1, arg-2, arg-3, arg-4, r, out, err)] results in a
919-
{!LearnOcaml_report.Success 1} report if the student function
919+
{!Learnocaml_report.Success 1} report if the student function
920920
applied to [arg-1], [arg-2], [arg-3] and [arg-4] is equal to
921921
[r] and if standard output and standard error messages match
922922
[out] and [err] respectively. The result of a test is a
@@ -942,7 +942,7 @@
942942
function against outputs of [rf].
943943
944944
A test [(arg-1, arg-2, arg-3m arg-4)] results in a
945-
{!LearnOcaml_report.Success 1} report if the student function
945+
{!Learnocaml_report.Success 1} report if the student function
946946
applied to [arg-1], [arg-2], [arg-3] and [arg-4] gives the same
947947
result than the solution function [rf] applied to the same
948948
arguments. Otherwise the result of a test is a
@@ -972,7 +972,7 @@
972972
[solution.ml] file.
973973
974974
A test [(arg-1, arg-2, arg-3, arg-4)] results in a
975-
{!LearnOcaml_report.Success 1} report if the student function
975+
{!Learnocaml_report.Success 1} report if the student function
976976
applied to [arg-1], [arg-2], [arg-3] and [arg-4] gives the same
977977
result than the solution function [rf] applied to the same
978978
arguments. Otherwise the result of a test is a

src/main/learnocaml_main.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
open Lwt.Infix
1010
open Cmdliner
1111

12-
module StringSet = Set.Make(String)
13-
1412
let ( / ) = Filename.concat
1513

1614
let readlink f =

src/ppx-metaquot/genlifter.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,4 @@ module Main : sig end = struct
261261
Printf.eprintf "** fatal error: %s\n%!" (Printexc.to_string exn)
262262

263263
end
264+
open Main

src/repo/dune

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
(name learnocaml_tutorial_parser)
1515
(wrapped false)
1616
(modules Learnocaml_tutorial_parser)
17-
(libraries learnocaml_repository
17+
(libraries str
18+
learnocaml_repository
1819
learnocaml_data
1920
lwt.unix
2021
markup

0 commit comments

Comments
 (0)