diff options
| author | Pierre-Marie Pédrot | 2018-10-06 13:55:48 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2018-10-06 13:55:48 +0200 |
| commit | 371566f7619aed79aad55ffed6ee0920b961be6e (patch) | |
| tree | f5a7f56d5d5e924987ef0970aa0b72ec53aad673 /dev | |
| parent | 28df7dd06dbea299736f3897ecabd2a6e3fd8e28 (diff) | |
| parent | 650c65af484c45f4e480252b55d148bcc198be6c (diff) | |
Merge PR #8555: Remove section paths from kernel names
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/ci/user-overlays/08555-maximedenes-rm-section-path.sh | 9 | ||||
| -rw-r--r-- | dev/doc/changes.md | 13 | ||||
| -rw-r--r-- | dev/top_printers.ml | 25 |
3 files changed, 34 insertions, 13 deletions
diff --git a/dev/ci/user-overlays/08555-maximedenes-rm-section-path.sh b/dev/ci/user-overlays/08555-maximedenes-rm-section-path.sh new file mode 100644 index 0000000000..41c2ad6fef --- /dev/null +++ b/dev/ci/user-overlays/08555-maximedenes-rm-section-path.sh @@ -0,0 +1,9 @@ +if [ "$CI_PULL_REQUEST" = "8555" ] || [ "$CI_BRANCH" = "rm-section-path" ]; then + + ltac2_CI_REF=rm-section-path + ltac2_CI_GITURL=https://github.com/maximedenes/ltac2 + + Equations_CI_REF=rm-section-path + Equations_CI_GITURL=https://github.com/maximedenes/Coq-Equations + +fi diff --git a/dev/doc/changes.md b/dev/doc/changes.md index 9d592ee879..d6d296f012 100644 --- a/dev/doc/changes.md +++ b/dev/doc/changes.md @@ -1,5 +1,18 @@ ## Changes between Coq 8.9 and Coq 8.10 +### ML API + +Names + +- Kernel names no longer contain a section path. They now have only two + components (module path and label), which led to some changes in the API: + + KerName.make takes only 2 components + KerName.repr returns only 2 components + KerName.make2 is now KerName.make + Constant.make3 has been removed, use Constant.make2 + Constant.repr3 has been removed, use Constant.repr2 + ## Changes between Coq 8.8 and Coq 8.9 ### ML API diff --git a/dev/top_printers.ml b/dev/top_printers.ml index e15fd776b2..8129a4a867 100644 --- a/dev/top_printers.ml +++ b/dev/top_printers.ml @@ -552,23 +552,22 @@ open Libnames let encode_path ?loc prefix mpdir suffix id = let dir = match mpdir with | None -> [] - | Some (mp,dir) -> - (DirPath.repr (dirpath_of_string (ModPath.to_string mp))@ - DirPath.repr dir) in + | Some mp -> DirPath.repr (dirpath_of_string (ModPath.to_string mp)) + in make_qualid ?loc (DirPath.make (List.rev (Id.of_string prefix::dir@suffix))) id let raw_string_of_ref ?loc _ = function | ConstRef cst -> - let (mp,dir,id) = Constant.repr3 cst in - encode_path ?loc "CST" (Some (mp,dir)) [] (Label.to_id id) + let (mp,id) = Constant.repr2 cst in + encode_path ?loc "CST" (Some mp) [] (Label.to_id id) | IndRef (kn,i) -> - let (mp,dir,id) = MutInd.repr3 kn in - encode_path ?loc "IND" (Some (mp,dir)) [Label.to_id id] + let (mp,id) = MutInd.repr2 kn in + encode_path ?loc "IND" (Some mp) [Label.to_id id] (Id.of_string ("_"^string_of_int i)) | ConstructRef ((kn,i),j) -> - let (mp,dir,id) = MutInd.repr3 kn in - encode_path ?loc "CSTR" (Some (mp,dir)) + let (mp,id) = MutInd.repr2 kn in + encode_path ?loc "CSTR" (Some mp) [Label.to_id id;Id.of_string ("_"^string_of_int i)] (Id.of_string ("_"^string_of_int j)) | VarRef id -> @@ -576,14 +575,14 @@ let raw_string_of_ref ?loc _ = function let short_string_of_ref ?loc _ = function | VarRef id -> qualid_of_ident ?loc id - | ConstRef cst -> qualid_of_ident ?loc (Label.to_id (pi3 (Constant.repr3 cst))) - | IndRef (kn,0) -> qualid_of_ident ?loc (Label.to_id (pi3 (MutInd.repr3 kn))) + | ConstRef cst -> qualid_of_ident ?loc (Label.to_id (Constant.label cst)) + | IndRef (kn,0) -> qualid_of_ident ?loc (Label.to_id (MutInd.label kn)) | IndRef (kn,i) -> - encode_path ?loc "IND" None [Label.to_id (pi3 (MutInd.repr3 kn))] + encode_path ?loc "IND" None [Label.to_id (MutInd.label kn)] (Id.of_string ("_"^string_of_int i)) | ConstructRef ((kn,i),j) -> encode_path ?loc "CSTR" None - [Label.to_id (pi3 (MutInd.repr3 kn));Id.of_string ("_"^string_of_int i)] + [Label.to_id (MutInd.label kn);Id.of_string ("_"^string_of_int i)] (Id.of_string ("_"^string_of_int j)) (* Anticipate that printers can be used from ocamldebug and that |
