@@ -982,37 +982,30 @@ module Magic_number = struct
982
982
983
983
type raw_kind = string
984
984
985
+ (* We do not accept Caml1999 prefixes. *)
985
986
let parse_kind : raw_kind -> kind option = function
986
- | "Caml1999X " -> Some Exec
987
- | "Caml1999I " -> Some Cmi
988
- | "Caml1999O " -> Some Cmo
989
- | "Caml1999A " -> Some Cma
987
+ | "Caml2021X " -> Some Exec
988
+ | "Caml2021I " -> Some Cmi
989
+ | "Caml2021O " -> Some Cmo
990
+ | "Caml2021A " -> Some Cma
990
991
| "Caml2021y" -> Some (Cmx {flambda = true })
991
992
| "Caml2021Y" -> Some (Cmx {flambda = false })
992
993
| "Caml2021z" -> Some (Cmxa {flambda = true })
993
994
| "Caml2021Z" -> Some (Cmxa {flambda = false })
994
-
995
- (* Caml2007D and Caml2012T were used instead of the common Caml1999 prefix
996
- between the introduction of those magic numbers and October 2017
997
- (8ba70ff194b66c0a50ffb97d41fe9c4bdf9362d6).
998
-
999
- We accept them here, but will always produce/show kind prefixes
1000
- that follow the current convention, Caml1999{D,T}. *)
1001
- | "Caml2007D" | "Caml1999D" -> Some Cmxs
1002
- | "Caml2012T" | "Caml1999T" -> Some Cmt
1003
-
1004
- | "Caml1999M" -> Some Ast_impl
1005
- | "Caml1999N" -> Some Ast_intf
995
+ | "Caml2021D" -> Some Cmxs
996
+ | "Caml2021T" -> Some Cmt
997
+ | "Caml2021M" -> Some Ast_impl
998
+ | "Caml2021N" -> Some Ast_intf
1006
999
| _ -> None
1007
1000
1008
1001
(* note: over time the magic kind number has changed for certain kinds;
1009
1002
this function returns them as they are produced by the current compiler,
1010
1003
but [parse_kind] accepts older formats as well. *)
1011
1004
let raw_kind : kind -> raw = function
1012
- | Exec -> " Caml1999X "
1013
- | Cmi -> " Caml1999I "
1014
- | Cmo -> " Caml1999O "
1015
- | Cma -> " Caml1999A "
1005
+ | Exec -> " Caml2021X "
1006
+ | Cmi -> " Caml2021I "
1007
+ | Cmo -> " Caml2021O "
1008
+ | Cma -> " Caml2021A "
1016
1009
| Cmx config ->
1017
1010
if config.flambda
1018
1011
then " Caml2021y"
@@ -1021,10 +1014,10 @@ module Magic_number = struct
1021
1014
if config.flambda
1022
1015
then " Caml2021z"
1023
1016
else " Caml2021Z"
1024
- | Cmxs -> " Caml1999D "
1025
- | Cmt -> " Caml1999T "
1026
- | Ast_impl -> " Caml1999M "
1027
- | Ast_intf -> " Caml1999N "
1017
+ | Cmxs -> " Caml2021D "
1018
+ | Cmt -> " Caml2021T "
1019
+ | Ast_impl -> " Caml2021M "
1020
+ | Ast_intf -> " Caml2021N "
1028
1021
1029
1022
let string_of_kind : kind -> string = function
1030
1023
| Exec -> " exec"
0 commit comments