@@ -982,37 +982,30 @@ module Magic_number = struct
982982
983983 type raw_kind = string
984984
985+ (* We do not accept Caml1999 prefixes. *)
985986 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
990991 | "Caml2021y" -> Some (Cmx {flambda = true })
991992 | "Caml2021Y" -> Some (Cmx {flambda = false })
992993 | "Caml2021z" -> Some (Cmxa {flambda = true })
993994 | "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
1006999 | _ -> None
10071000
10081001 (* note: over time the magic kind number has changed for certain kinds;
10091002 this function returns them as they are produced by the current compiler,
10101003 but [parse_kind] accepts older formats as well. *)
10111004 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 "
10161009 | Cmx config ->
10171010 if config.flambda
10181011 then " Caml2021y"
@@ -1021,10 +1014,10 @@ module Magic_number = struct
10211014 if config.flambda
10221015 then " Caml2021z"
10231016 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 "
10281021
10291022 let string_of_kind : kind -> string = function
10301023 | Exec -> " exec"
0 commit comments