| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
type production_position = |
| 14 |
| BorderProd of Constrexpr.side * Gramlib.Gramext.g_assoc option |
| 15 |
| InternalProd |
| 16 |
|
| 17 |
type production_level = |
| 18 |
| NextLevel |
| 19 |
| NumLevel of int |
| 20 |
| DefaultLevel |
| 21 |
|
| 22 |
let production_level_eq lev1 lev2 = |
| 23 |
match lev1, lev2 with |
| 24 |
| NextLevel, NextLevel -> true |
| 25 |
| NumLevel n1, NumLevel n2 -> Int.equal n1 n2 |
| 26 |
| DefaultLevel, DefaultLevel -> true |
| 27 |
| (NextLevel | NumLevel _| DefaultLevel), _ -> false |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
type ('custom,'a) constr_entry_key_gen = |
| 32 |
| ETIdent |
| 33 |
| ETName |
| 34 |
| ETGlobal |
| 35 |
| ETBigint |
| 36 |
| ETBinder of bool |
| 37 |
| ETConstr of 'custom Constrexpr.notation_entry_gen * Notation_term.notation_binder_kind option * 'a |
| 38 |
| ETPattern of bool * int option |
| 39 |
|
| 40 |
let constr_entry_key_eq_gen binder_kind_eq v1 v2 = match v1, v2 with |
| 41 |
| ETIdent, ETIdent -> true |
| 42 |
| ETName, ETName -> true |
| 43 |
| ETGlobal, ETGlobal -> true |
| 44 |
| ETBigint, ETBigint -> true |
| 45 |
| ETBinder b1, ETBinder b2 -> b1 == b2 |
| 46 |
| ETConstr (s1,bko1,_lev1), ETConstr (s2,bko2,_lev2) -> |
| 47 |
Notationextern.notation_entry_eq s1 s2 && binder_kind_eq bko1 bko2 |
| 48 |
| ETPattern (b1,n1), ETPattern (b2,n2) -> b1 = b2 && Option.equal Int.equal n1 n2 |
| 49 |
| (ETIdent | ETName | ETGlobal | ETBigint | ETBinder _ | ETConstr _ | ETPattern _), _ -> false |
| 50 |
|
| 51 |
let constr_entry_key_eq = constr_entry_key_eq_gen (Option.equal Notationextern.notation_binder_kind_eq) |
| 52 |
|
| 53 |
let constr_entry_key_eq_ignore_binder_kind = constr_entry_key_eq_gen (fun _ _ -> true) |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
type constr_entry_key = |
| 58 |
(Globnames.CustomName.t, production_level * production_position) constr_entry_key_gen |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
type 'custom simple_constr_prod_entry_key = |
| 63 |
('custom, production_level) constr_entry_key_gen |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
type binder_target = ForBinder | ForTerm |
| 68 |
|
| 69 |
type binder_entry_kind = ETBinderOpen | ETBinderClosed of constr_prod_entry_key option * (bool * string) list |
| 70 |
|
| 71 |
and constr_prod_entry_key = |
| 72 |
| ETProdIdent |
| 73 |
| ETProdName |
| 74 |
| ETProdGlobal |
| 75 |
| ETProdBigint |
| 76 |
| ETProdOneBinder of bool |
| 77 |
| ETProdConstr of Constrexpr.notation_entry * (production_level * production_position) |
| 78 |
| ETProdPattern of int |
| 79 |
| ETProdConstrList of Constrexpr.notation_entry * (production_level * production_position) * (bool * string) list |
| 80 |
| ETProdBinderList of binder_entry_kind |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
type 'a user_symbol = |
| 85 |
| Ulist1 of 'a user_symbol |
| 86 |
| Ulist1sep of 'a user_symbol * string |
| 87 |
| Ulist0 of 'a user_symbol |
| 88 |
| Ulist0sep of 'a user_symbol * string |
| 89 |
| Uopt of 'a user_symbol |
| 90 |
| Uentry of 'a |
| 91 |
| Uentryl of 'a * int |
| 92 |
|
| 93 |
type ('a,'b,'c) ty_user_symbol = |
| 94 |
| TUlist1 : ('a,'b,'c) ty_user_symbol -> ('a list,'b list,'c list) ty_user_symbol |
| 95 |
| TUlist1sep : ('a,'b,'c) ty_user_symbol * string -> ('a list,'b list,'c list) ty_user_symbol |
| 96 |
| TUlist0 : ('a,'b,'c) ty_user_symbol -> ('a list,'b list,'c list) ty_user_symbol |
| 97 |
| TUlist0sep : ('a,'b,'c) ty_user_symbol * string -> ('a list,'b list,'c list) ty_user_symbol |
| 98 |
| TUopt : ('a,'b,'c) ty_user_symbol -> ('a option, 'b option, 'c option) ty_user_symbol |
| 99 |
| TUentry : ('a, 'b, 'c) Genarg.ArgT.tag -> ('a,'b,'c) ty_user_symbol |
| 100 |
| TUentryl : ('a, 'b, 'c) Genarg.ArgT.tag * int -> ('a,'b,'c) ty_user_symbol |