type attr = Name of id * bool (* name, real? *)
| Apix of int (* additional position index *)
| Mark of int (* node marker *)
+ | Meta of string (* metaliguistic annotation *)
| Priv (* private global definition *)
type attrs = attr list (* attributes *)
| e :: tl ->
let f a = f (e :: a) in get_names f tl
+let count_names a =
+ let rec aux k = function
+ | [] -> k
+ | Name _ :: tl -> aux (succ k) tl
+ | _ :: tl -> aux k tl
+ in
+ aux 0 a
+
let rec apix err f = function
| Apix i :: _ -> f i
| _ :: tl -> apix err f tl