~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to tools/coqdoc/index.ml

  • Committer: Package Import Robot
  • Author(s): Stéphane Glondu
  • Date: 2012-01-03 23:42:48 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20120103234248-p9r8h1579n67v55a
Tags: 8.3pl3-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
(* -*- compile-command: "make -C ../.. bin/coqdoc" -*- *)
2
2
(************************************************************************)
3
3
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
4
 
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010     *)
 
4
(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011     *)
5
5
(*   \VV/  **************************************************************)
6
6
(*    //   *      This file is distributed under the terms of the       *)
7
7
(*         *       GNU Lesser General Public License Version 2.1        *)
8
8
(************************************************************************)
9
9
 
10
 
(*i $Id: index.ml 13676 2010-12-04 10:34:21Z herbelin $ i*)
 
10
(*i $Id: index.ml 14641 2011-11-06 11:59:10Z herbelin $ i*)
11
11
 
12
12
open Filename
13
13
open Lexing
61
61
  then id
62
62
  else ""
63
63
 
64
 
let add_def loc ty sp id =
65
 
  Hashtbl.add reftable (!current_library, loc) (Def (full_ident sp id, ty));
 
64
let add_def loc1 loc2 ty sp id =
 
65
  for loc = loc1 to loc2 do
 
66
    Hashtbl.add reftable (!current_library, loc) (Def (full_ident sp id, ty))
 
67
  done;
66
68
  Hashtbl.add deftable id (Ref (!current_library, full_ident sp id, ty))
67
69
 
68
70
let add_ref m loc m' sp id ty =
341
343
                    for loc=loc1 to loc2 do
342
344
                      add_ref !cur_mod loc lib_dp sp id (type_of_string ty)
343
345
                    done)
344
 
               with _ ->
345
 
               try
346
 
                Scanf.sscanf s "R%d %s %s %s %s"
347
 
                  (fun loc lib_dp sp id ty ->
348
 
                    add_ref !cur_mod loc lib_dp sp id (type_of_string ty))
349
346
               with _ -> ())
350
347
          | _ ->
351
 
              try Scanf.sscanf s "%s %d %s %s"
352
 
                (fun ty loc sp id -> add_def loc (type_of_string ty) sp id)
 
348
              try Scanf.sscanf s "not %d %s %s"
 
349
                (fun loc sp id -> add_def loc loc (type_of_string "not") sp id)
 
350
              with Scanf.Scan_failure _ ->
 
351
              try Scanf.sscanf s "%s %d:%d %s %s"
 
352
                (fun ty loc1 loc2 sp id ->
 
353
                  add_def loc1 loc2 (type_of_string ty) sp id)
353
354
              with Scanf.Scan_failure _ -> ()
 
355
 
354
356
      end
355
357
    done; assert false
356
358
  with End_of_file ->