let level_number entry lab =
                  let rec lookup levn =
                    function
                    | [] -> failwith ("unknown level " ^ lab)
                    | lev :: levs ->
                        if Tools.is_level_labelled lab lev
                        then levn
                        else lookup (succ levn) levs
                  in
                    match entry.edesc with
                    | Dlevels elev -> lookup 0 elev
                    | Dparser _ -> raise Not_found