Permalink
Browse files

ocp-indent the code base

  • Loading branch information...
rgrinberg committed Feb 3, 2018
1 parent 5ed0712 commit f0bcf8ca15d4ada941c83c7b8caf41542756bd2f
Showing with 8,010 additions and 8,010 deletions.
  1. +23 −23 Camomile/camomileLibraryDefault.mli
  2. +20 −20 Camomile/camomileLibraryDyn.ml
  3. +23 −23 Camomile/camomileLibraryDyn.mli
  4. +8 −8 Camomile/configInt.mli
  5. +30 −30 Camomile/internal/avlTree.ml
  6. +8 −8 Camomile/internal/bitsvect.ml
  7. +25 −25 Camomile/internal/byte_labeled_dag.ml
  8. +8 −8 Camomile/internal/bytesvect.ml
  9. +51 −51 Camomile/internal/charmap.ml
  10. +14 −14 Camomile/internal/charmap.mli
  11. +3 −3 Camomile/internal/database.ml
  12. +11 −11 Camomile/internal/database.mli
  13. +26 −26 Camomile/internal/hangul.ml
  14. +36 −36 Camomile/internal/iMap.ml
  15. +2 −2 Camomile/internal/iMap.mli
  16. +135 −135 Camomile/internal/iSet.ml
  17. +1 −1 Camomile/internal/iSet.mli
  18. +91 −91 Camomile/internal/tbl31.ml
  19. +401 −401 Camomile/internal/unidata.ml
  20. +116 −116 Camomile/internal/unidata.mli
  21. +60 −60 Camomile/internal/unimap.ml
  22. +20 −20 Camomile/internal/unimap.mli
  23. +11 −11 Camomile/internal/xArray.ml
  24. +31 −31 Camomile/internal/xArray.mli
  25. +115 −115 Camomile/mappings/gen_mappings.ml
  26. +9 −9 Camomile/public/caseMap.ml
  27. +14 −14 Camomile/public/caseMap.mli
  28. +2,640 −2,640 Camomile/public/charEncoding.ml
  29. +118 −118 Camomile/public/charEncoding.mli
  30. +5 −5 Camomile/public/locale.ml
  31. +17 −17 Camomile/public/locale.mli
  32. +26 −26 Camomile/public/oOChannel.ml
  33. +18 −18 Camomile/public/oOChannel.mli
  34. +25 −25 Camomile/public/stringPrep.ml
  35. +11 −11 Camomile/public/subText.ml
  36. +12 −12 Camomile/public/subText.mli
  37. +8 −8 Camomile/public/uCS4.ml
  38. +34 −34 Camomile/public/uCS4.mli
  39. +4 −4 Camomile/public/uChar.ml
  40. +14 −14 Camomile/public/uChar.mli
  41. +419 −419 Camomile/public/uCharInfo.ml
  42. +241 −241 Camomile/public/uCharInfo.mli
  43. +33 −33 Camomile/public/uCharTbl.mli
  44. +46 −46 Camomile/public/uCol.mli
  45. +66 −66 Camomile/public/uLine.ml
  46. +21 −21 Camomile/public/uLine.mli
  47. +21 −21 Camomile/public/uMap.mli
  48. +387 −387 Camomile/public/uNF.ml
  49. +7 −7 Camomile/public/uNF.mli
  50. +11 −11 Camomile/public/uPervasives.ml
  51. +211 −211 Camomile/public/uRe.ml
  52. +13 −13 Camomile/public/uRe.mli
  53. +105 −105 Camomile/public/uReStr.ml
  54. +43 −43 Camomile/public/uReStr.mli
  55. +1 −1 Camomile/public/uSet.ml
  56. +17 −17 Camomile/public/uSet.mli
  57. +23 −23 Camomile/public/uTF16.ml
  58. +41 −41 Camomile/public/uTF16.mli
  59. +50 −50 Camomile/public/uTF8.ml
  60. +39 −39 Camomile/public/uTF8.mli
  61. +16 −16 Camomile/public/uText.ml
  62. +52 −52 Camomile/public/uText.mli
  63. +37 −37 Camomile/public/unicodeString.mli
  64. +19 −19 Camomile/public/xString.ml
  65. +44 −44 Camomile/public/xString.mli
  66. +20 −20 Camomile/tools/camomilelocaledef_lexer.ml
  67. +18 −18 Camomile/tools/camomilestringprep.ml
  68. +38 −38 Camomile/tools/iana.ml
  69. +3 −3 Camomile/tools/parse_age.ml
  70. +26 −26 Camomile/tools/parse_allkeys.ml
  71. +17 −17 Camomile/tools/parse_casefolding.ml
  72. +18 −18 Camomile/tools/parse_scripts.ml
  73. +26 −26 Camomile/tools/parse_specialcasing.ml
  74. +104 −104 Camomile/tools/parse_unidata.ml
  75. +14 −14 Camomile/tools/parse_uniset.ml
  76. +122 −122 Camomile/toolslib/absOrd.ml
  77. +85 −85 camomile-test/lib/blender.ml
  78. +5 −5 camomile-test/lib/blender.mli
  79. +16 −16 camomile-test/tester-lib/testUColJapanese.ml
  80. +98 −98 camomile-test/tester-lib/uStorageTest.ml
  81. +118 −118 camomile-test/tester/testOOChannel.ml
  82. +363 −363 camomile-test/tester/test_base.ml
  83. +66 −66 camomile-test/tester/test_caseMap.ml
  84. +68 −68 camomile-test/tester/test_charEncoding.ml
  85. +26 −26 camomile-test/tester/test_normalform.ml
  86. +34 −34 camomile-test/tester/test_stringprep.ml
  87. +241 −241 camomile-test/tester/test_uCol.ml
  88. +10 −10 camomile-test/tester/test_uTF8.ml
  89. +9 −9 camomile-test/tester/uCS4_test.ml
  90. +237 −237 camomile-test/tester/uReStr_test.ml
  91. +41 −41 camomile-test/tester/uTF16_test.ml
  92. 0 configure.ml
@@ -38,26 +38,26 @@ open CamomileLibrary
module Config : ConfigInt.Type
module Camomile : Type with
module OOChannel = OOChannel and
module UChar = UChar and
module USet = USet and
module UMap = UMap and
module UCharTbl = UCharTbl and
module UnicodeString = UnicodeString and
module UText = UText and
module XString = XString and
module SubText = SubText and
module ULine = ULine and
module Locale = Locale and
module CharEncoding = CharEncoding.Configure(Config) and
module UTF8 = UTF8 and
module UTF16 = UTF16 and
module UCS4 = UCS4 and
module UPervasives = UPervasives and
module URe = URe and
module UCharInfo = UCharInfo.Make(Config) and
module UNF.Make = UNF.Make(Config) and
module UCol.Make = UCol.Make(Config) and
module CaseMap.Make = CaseMap.Make(Config) and
module UReStr = UReStr.Configure(Config) and
module StringPrep.Make = StringPrep.Make(Config)
module OOChannel = OOChannel and
module UChar = UChar and
module USet = USet and
module UMap = UMap and
module UCharTbl = UCharTbl and
module UnicodeString = UnicodeString and
module UText = UText and
module XString = XString and
module SubText = SubText and
module ULine = ULine and
module Locale = Locale and
module CharEncoding = CharEncoding.Configure(Config) and
module UTF8 = UTF8 and
module UTF16 = UTF16 and
module UCS4 = UCS4 and
module UPervasives = UPervasives and
module URe = URe and
module UCharInfo = UCharInfo.Make(Config) and
module UNF.Make = UNF.Make(Config) and
module UCol.Make = UCol.Make(Config) and
module CaseMap.Make = CaseMap.Make(Config) and
module UReStr = UReStr.Configure(Config) and
module StringPrep.Make = StringPrep.Make(Config)
@@ -36,55 +36,55 @@ module Config = struct
let camomile_dir_var =
"CAMOMILE_DIR"
let camomile_dir () =
Sys.getenv camomile_dir_var
let find_dir var dn dflt =
try
let f =
List.find
List.find
(fun f ->
try
let dn = f () in
Sys.is_directory dn
with _ ->
false)
try
let dn = f () in
Sys.is_directory dn
with _ ->
false)
[
(fun () -> Sys.getenv var);
(fun () -> Filename.concat (camomile_dir ()) dn);
(fun () -> dflt);
]
(fun () -> Sys.getenv var);
(fun () -> Filename.concat (camomile_dir ()) dn);
(fun () -> dflt);
]
in
f ()
with Not_found ->
failwith
(Printf.sprintf
(Printf.sprintf
"Cannot find camomile %s directory, usually located here: '%s'. \
Use environment variable %s or %s to locate it precisely."
dn dflt
camomile_dir_var var)
Use environment variable %s or %s to locate it precisely."
dn dflt
camomile_dir_var var)
module Default = CamomileDefaultConfig
let datadir =
find_dir
"CAMOMILE_DATADIR"
"database"
Default.datadir
let localedir =
find_dir
"CAMOMILE_LOCALEDIR"
"locales"
Default.localedir
let charmapdir =
find_dir
"CAMOMILE_CHARMAPDIR"
"charmaps"
Default.charmapdir
let unimapdir =
find_dir
"CAMOMILE_UNIMAPDIR"
@@ -48,26 +48,26 @@ open CamomileLibrary
module Config : ConfigInt.Type
module Camomile : CamomileLibrary.Type with
module OOChannel = OOChannel and
module UChar = UChar and
module USet = USet and
module UMap = UMap and
module UCharTbl = UCharTbl and
module UnicodeString = UnicodeString and
module UText = UText and
module XString = XString and
module SubText = SubText and
module ULine = ULine and
module Locale = Locale and
module CharEncoding = CharEncoding.Configure(Config) and
module UTF8 = UTF8 and
module UTF16 = UTF16 and
module UCS4 = UCS4 and
module UPervasives = UPervasives and
module URe = URe and
module UCharInfo = UCharInfo.Make(Config) and
module UNF.Make = UNF.Make(Config) and
module UCol.Make = UCol.Make(Config) and
module CaseMap.Make = CaseMap.Make(Config) and
module UReStr = UReStr.Configure(Config) and
module StringPrep.Make = StringPrep.Make(Config)
module OOChannel = OOChannel and
module UChar = UChar and
module USet = USet and
module UMap = UMap and
module UCharTbl = UCharTbl and
module UnicodeString = UnicodeString and
module UText = UText and
module XString = XString and
module SubText = SubText and
module ULine = ULine and
module Locale = Locale and
module CharEncoding = CharEncoding.Configure(Config) and
module UTF8 = UTF8 and
module UTF16 = UTF16 and
module UCS4 = UCS4 and
module UPervasives = UPervasives and
module URe = URe and
module UCharInfo = UCharInfo.Make(Config) and
module UNF.Make = UNF.Make(Config) and
module UCol.Make = UCol.Make(Config) and
module CaseMap.Make = CaseMap.Make(Config) and
module UReStr = UReStr.Configure(Config) and
module StringPrep.Make = StringPrep.Make(Config)
View
@@ -1,14 +1,14 @@
(** Configuration values *)
module type Type = sig
(** Directory of compiled Unicode data *)
val datadir : string
(** Directory of compiled Unicode data *)
val datadir : string
(** Directory of compiled character mapping tables a la ISO *)
val charmapdir : string
(** Directory of compiled character mapping tables a la ISO *)
val charmapdir : string
(** Directory of camomile-style compiled character mapping table *)
val unimapdir : string
(** Directory of camomile-style compiled character mapping table *)
val unimapdir : string
(** Directory of compiled locale data *)
val localedir : string
(** Directory of compiled locale data *)
val localedir : string
end
@@ -70,24 +70,24 @@ let bal l v r =
match l with
Empty -> assert false
| Node (ll, lv, lr, _) ->
if height ll >= height lr then
create ll lv (create lr v r)
else
match lr with
Empty -> assert false
| Node (lrl, lrv, lrr, _) ->
create (create ll lv lrl) lrv (create lrr v r)
if height ll >= height lr then
create ll lv (create lr v r)
else
match lr with
Empty -> assert false
| Node (lrl, lrv, lrr, _) ->
create (create ll lv lrl) lrv (create lrr v r)
else if hr >= hl + 2 then
match r with
Empty -> assert false
| Node (rl, rv, rr, _) ->
if height rr >= height rl then
create (create l v rl) rv rr
else
match rl with
Empty -> assert false
| Node (rll, rlv, rlr, _) ->
create (create l v rll) rlv (create rlr rv rr)
if height rr >= height rl then
create (create l v rl) rv rr
else
match rl with
Empty -> assert false
| Node (rll, rlv, rlr, _) ->
create (create l v rll) rlv (create rlr rv rr)
else
create l v r
@@ -105,46 +105,46 @@ let rec make_tree l v r =
Empty, _ -> add_left v r
| _, Empty -> add_right v l
| Node(ll, lv, lr, lh), Node(rl, rv, rr, rh) ->
if lh > rh + 1 then bal ll lv (make_tree lr v r) else
if rh > lh + 1 then bal (make_tree l v rl) rv rr else
if lh > rh + 1 then bal ll lv (make_tree lr v r) else
if rh > lh + 1 then bal (make_tree l v rl) rv rr else
create l v r
(* Utilities *)
let rec split_leftmost = function
Empty -> raise Not_found
| Node (Empty, v, r, _) -> (v, r)
| Node (l, v, r, _) ->
let v0, l' = split_leftmost l in
(v0, make_tree l' v r)
let v0, l' = split_leftmost l in
(v0, make_tree l' v r)
let rec split_rightmost = function
Empty -> raise Not_found
| Node (l, v, Empty, _) -> (v, l)
| Node (l, v, r, _) ->
let v0, r' = split_rightmost r in
(v0, make_tree l v r')
let v0, r' = split_rightmost r in
(v0, make_tree l v r')
let rec concat t1 t2 =
match t1, t2 with
Empty, _ -> t2
| _, Empty -> t1
| Node (l1, v1, r1, h1), Node (l2, v2, r2, h2) ->
if h1 < h2 then
make_tree (concat t1 l2) v2 r2
else
make_tree l1 v1 (concat r1 t2)
if h1 < h2 then
make_tree (concat t1 l2) v2 r2
else
make_tree l1 v1 (concat r1 t2)
let rec iter proc = function
Empty -> ()
| Node (l, v, r, _) ->
iter proc l;
proc v;
iter proc r
iter proc l;
proc v;
iter proc r
let rec fold f t init =
match t with
Empty -> init
| Node (l, v, r, _) ->
let x = fold f l init in
let x = f v x in
fold f r x
let x = fold f l init in
let x = f v x in
fold f r x
@@ -37,10 +37,10 @@
let rec bits n = if n = 0 then 0 else 1 + bits (n lsr 1)
type t =
{len : int;
mutable bits : int;
mutable contents : Bytes.t;
mutable id : int}
{len : int;
mutable bits : int;
mutable contents : Bytes.t;
mutable id : int}
(* get v i : read the i-th element of v *)
(* b < 8 *)
@@ -73,10 +73,10 @@ let set_raw vect i n =
let c0' = c0 lor ((n lsl i1) land 255) in
Bytes.set v i0 (Char.chr c0');
if b + i1 <= 8 then () else
let masq2 = (1 lsl (b + i1 - 8)) - 1 in
let c1 = (Char.code (Bytes.get v (i0 + 1))) land (lnot masq2) in
let c1' = c1 lor (n lsr (8 - i1)) in
Bytes.set v (i0 + 1) (Char.chr c1')
let masq2 = (1 lsl (b + i1 - 8)) - 1 in
let c1 = (Char.code (Bytes.get v (i0 + 1))) land (lnot masq2) in
let c1' = c1 lor (n lsr (8 - i1)) in
Bytes.set v (i0 + 1) (Char.chr c1')
let bits_to_bytes b = b / 8 + 2
Oops, something went wrong.

0 comments on commit f0bcf8c

Please sign in to comment.