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

« back to all changes in this revision

Viewing changes to tools/coqdoc/alpha.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(************************************************************************)
 
2
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
 
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
 
4
(*   \VV/  **************************************************************)
 
5
(*    //   *      This file is distributed under the terms of the       *)
 
6
(*         *       GNU Lesser General Public License Version 2.1        *)
 
7
(************************************************************************)
 
8
 
 
9
(*i $Id: alpha.ml 5920 2004-07-16 20:01:26Z herbelin $ i*)
 
10
 
 
11
let norm_char c = match Char.uppercase c with
 
12
  | '\192'..'\198' -> 'A'
 
13
  | '\199' -> 'C'
 
14
  | '\200'..'\203' -> 'E'
 
15
  | '\204'..'\207' -> 'I'
 
16
  | '\209' -> 'N'
 
17
  | '\210'..'\214' -> 'O'
 
18
  | '\217'..'\220' -> 'U'
 
19
  | '\221' -> 'Y'
 
20
  | c -> c
 
21
 
 
22
let norm_string s =
 
23
  let u = String.copy s in
 
24
  for i = 0 to String.length s - 1 do
 
25
    u.[i] <- norm_char s.[i]
 
26
  done;
 
27
  u
 
28
 
 
29
let compare_char c1 c2 = match norm_char c1, norm_char c2 with
 
30
  | ('A'..'Z' as c1), ('A'..'Z' as c2) -> compare c1 c2
 
31
  | 'A'..'Z', _ -> -1
 
32
  | _, 'A'..'Z' -> 1
 
33
  | c1, c2 -> compare c1 c2
 
34
 
 
35
let compare_string s1 s2 = 
 
36
  let n1 = String.length s1 in
 
37
  let n2 = String.length s2 in
 
38
  let rec cmp i = 
 
39
    if i == n1 || i == n2 then
 
40
      n1 - n2
 
41
    else
 
42
      let c = compare_char s1.[i] s2.[i] in
 
43
      if c == 0 then cmp (succ i) else c
 
44
  in
 
45
  cmp 0