Skip to content

Commit 615290d

Browse files
committed
[api] Remove Misctypes.
We move the last 3 types to more adequate places.
1 parent 4aaeb5d commit 615290d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+74
-125
lines changed

interp/constrexpr.ml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ type name_decl = lname * universe_decl_expr option
2222

2323
type notation = string
2424

25+
type 'a or_by_notation_r =
26+
| AN of 'a
27+
| ByNotation of (string * string option)
28+
29+
type 'a or_by_notation = 'a or_by_notation_r CAst.t
30+
31+
(* NB: the last string in [ByNotation] is actually a [Notation.delimiters],
32+
but this formulation avoids a useless dependency. *)
33+
2534
type explicitation =
2635
| ExplByPos of int * Id.t option (* a reference to the n-th product starting from left *)
2736
| ExplByName of Id.t

interp/genredexpr.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ type ('a,'b,'c) may_eval =
5757

5858
open Libnames
5959
open Constrexpr
60-
open Misctypes
6160

6261
type r_trm = constr_expr
6362
type r_pat = constr_pattern_expr

interp/smartlocate.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ open Pp
1818
open CErrors
1919
open Libnames
2020
open Globnames
21-
open Misctypes
2221
open Syntax_def
2322
open Notation_term
2423

@@ -65,13 +64,13 @@ let global_with_alias ?head r =
6564
try locate_global_with_alias ?head qid
6665
with Not_found -> Nametab.error_global_not_found qid
6766

68-
let smart_global ?head = CAst.with_loc_val (fun ?loc -> function
67+
let smart_global ?head = let open Constrexpr in CAst.with_loc_val (fun ?loc -> function
6968
| AN r ->
7069
global_with_alias ?head r
7170
| ByNotation (ntn,sc) ->
7271
Notation.interp_notation_as_global_reference ?loc (fun _ -> true) ntn sc)
7372

74-
let smart_global_inductive = CAst.with_loc_val (fun ?loc -> function
73+
let smart_global_inductive = let open Constrexpr in CAst.with_loc_val (fun ?loc -> function
7574
| AN r ->
7675
global_inductive_with_alias r
7776
| ByNotation (ntn,sc) ->

interp/smartlocate.mli

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
open Names
1212
open Libnames
1313
open Globnames
14-
open Misctypes
1514

1615
(** [locate_global_with_alias] locates global reference possibly following
1716
a notation if this notation has a role of aliasing; raise [Not_found]
@@ -33,7 +32,7 @@ val global_with_alias : ?head:bool -> reference -> GlobRef.t
3332
val global_inductive_with_alias : reference -> inductive
3433

3534
(** Locate a reference taking into account notations and "aliases" *)
36-
val smart_global : ?head:bool -> reference or_by_notation -> GlobRef.t
35+
val smart_global : ?head:bool -> reference Constrexpr.or_by_notation -> GlobRef.t
3736

3837
(** The same for inductive types *)
39-
val smart_global_inductive : reference or_by_notation -> inductive
38+
val smart_global_inductive : reference Constrexpr.or_by_notation -> inductive

interp/stdarg.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
open Genarg
1212
open Geninterp
1313

14+
type 'a and_short_name = 'a * Names.lident option
15+
1416
let make0 ?dyn name =
1517
let wit = Genarg.make0 name in
1618
let () = register_val0 wit dyn in

interp/stdarg.mli

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ open Libnames
1717
open Genredexpr
1818
open Pattern
1919
open Constrexpr
20-
open Misctypes
2120
open Genarg
2221
open Genintern
22+
open Locus
23+
24+
type 'a and_short_name = 'a * lident option
2325

2426
val wit_unit : unit uniform_genarg_type
2527

library/library.mllib

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Nametab
66
Global
77
Decl_kinds
88
Lib
9-
Misctypes
109
Declaremods
1110
Loadpath
1211
Library

parsing/g_prim.ml4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ GEXTEND Gram
8585
[ [ s = ne_string; sc = OPT ["%"; key = IDENT -> key ] -> (s, sc) ] ]
8686
;
8787
smart_global:
88-
[ [ c = reference -> CAst.make ~loc:!@loc @@ Misctypes.AN c
89-
| ntn = by_notation -> CAst.make ~loc:!@loc @@ Misctypes.ByNotation ntn ] ]
88+
[ [ c = reference -> CAst.make ~loc:!@loc @@ Constrexpr.AN c
89+
| ntn = by_notation -> CAst.make ~loc:!@loc @@ Constrexpr.ByNotation ntn ] ]
9090
;
9191
qualid:
9292
[ [ qid = basequalid -> CAst.make ~loc:!@loc qid ] ]

parsing/pcoq.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ open Extend
1313
open Genarg
1414
open Constrexpr
1515
open Libnames
16-
open Misctypes
1716

1817
(** The parser of Coq *)
1918

plugins/extraction/extract_env.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ let separate_extraction lr =
646646
is \verb!Extraction! [qualid]. *)
647647

648648
let simple_extraction r =
649-
Vernacentries.dump_global CAst.(make (Misctypes.AN r));
649+
Vernacentries.dump_global CAst.(make (Constrexpr.AN r));
650650
match locate_ref [r] with
651651
| ([], [mp]) as p -> full_extr None p
652652
| [r],[] ->

0 commit comments

Comments
 (0)