@tellahq/rescript 10.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (997) hide show
  1. package/CHANGELOG.md +1717 -0
  2. package/COPYING +674 -0
  3. package/COPYING.LESSER +165 -0
  4. package/CREDITS.md +59 -0
  5. package/LICENSE +24 -0
  6. package/README.md +114 -0
  7. package/bsc +22 -0
  8. package/bsrefmt +16 -0
  9. package/darwin/bsb_helper.exe +0 -0
  10. package/darwin/bsc.exe +0 -0
  11. package/darwin/ninja.COPYING +202 -0
  12. package/darwin/ninja.exe +0 -0
  13. package/darwin/refmt.exe +0 -0
  14. package/darwin/rescript.exe +0 -0
  15. package/darwinarm64/bsb_helper.exe +0 -0
  16. package/darwinarm64/bsc.exe +0 -0
  17. package/darwinarm64/ninja.COPYING +202 -0
  18. package/darwinarm64/ninja.exe +0 -0
  19. package/darwinarm64/refmt.exe +0 -0
  20. package/darwinarm64/rescript.exe +0 -0
  21. package/docs/docson/build-schema.json +557 -0
  22. package/freebsd/ninja.COPYING +202 -0
  23. package/jscomp/stubs/ext_basic_hash_stubs.c +216 -0
  24. package/lib/4.06.1/bsb_helper.ml +2436 -0
  25. package/lib/4.06.1/bsb_helper.mli +0 -0
  26. package/lib/4.06.1/refmt_main3.ml +115517 -0
  27. package/lib/4.06.1/refmt_main3.mli +1 -0
  28. package/lib/4.06.1/rescript.ml +15500 -0
  29. package/lib/4.06.1/rescript.mli +0 -0
  30. package/lib/4.06.1/whole_compiler.ml +306395 -0
  31. package/lib/4.06.1/whole_compiler.mli +0 -0
  32. package/lib/bstracing +270 -0
  33. package/lib/es6/arg.js +717 -0
  34. package/lib/es6/array.js +511 -0
  35. package/lib/es6/arrayLabels.js +511 -0
  36. package/lib/es6/belt.js +57 -0
  37. package/lib/es6/belt_Array.js +764 -0
  38. package/lib/es6/belt_Float.js +16 -0
  39. package/lib/es6/belt_HashMap.js +280 -0
  40. package/lib/es6/belt_HashMapInt.js +264 -0
  41. package/lib/es6/belt_HashMapString.js +264 -0
  42. package/lib/es6/belt_HashSet.js +222 -0
  43. package/lib/es6/belt_HashSetInt.js +207 -0
  44. package/lib/es6/belt_HashSetString.js +207 -0
  45. package/lib/es6/belt_Id.js +71 -0
  46. package/lib/es6/belt_Int.js +16 -0
  47. package/lib/es6/belt_List.js +1512 -0
  48. package/lib/es6/belt_Map.js +376 -0
  49. package/lib/es6/belt_MapDict.js +417 -0
  50. package/lib/es6/belt_MapInt.js +307 -0
  51. package/lib/es6/belt_MapString.js +307 -0
  52. package/lib/es6/belt_MutableMap.js +395 -0
  53. package/lib/es6/belt_MutableMapInt.js +362 -0
  54. package/lib/es6/belt_MutableMapString.js +362 -0
  55. package/lib/es6/belt_MutableQueue.js +299 -0
  56. package/lib/es6/belt_MutableSet.js +538 -0
  57. package/lib/es6/belt_MutableSetInt.js +501 -0
  58. package/lib/es6/belt_MutableSetString.js +501 -0
  59. package/lib/es6/belt_MutableStack.js +137 -0
  60. package/lib/es6/belt_Option.js +151 -0
  61. package/lib/es6/belt_Range.js +109 -0
  62. package/lib/es6/belt_Result.js +136 -0
  63. package/lib/es6/belt_Set.js +314 -0
  64. package/lib/es6/belt_SetDict.js +362 -0
  65. package/lib/es6/belt_SetInt.js +359 -0
  66. package/lib/es6/belt_SetString.js +359 -0
  67. package/lib/es6/belt_SortArray.js +427 -0
  68. package/lib/es6/belt_SortArrayInt.js +374 -0
  69. package/lib/es6/belt_SortArrayString.js +374 -0
  70. package/lib/es6/belt_internalAVLset.js +940 -0
  71. package/lib/es6/belt_internalAVLtree.js +1146 -0
  72. package/lib/es6/belt_internalBuckets.js +287 -0
  73. package/lib/es6/belt_internalBucketsType.js +49 -0
  74. package/lib/es6/belt_internalMapInt.js +365 -0
  75. package/lib/es6/belt_internalMapString.js +365 -0
  76. package/lib/es6/belt_internalSetBuckets.js +191 -0
  77. package/lib/es6/belt_internalSetInt.js +209 -0
  78. package/lib/es6/belt_internalSetString.js +209 -0
  79. package/lib/es6/buffer.js +477 -0
  80. package/lib/es6/bytes.js +704 -0
  81. package/lib/es6/bytesLabels.js +704 -0
  82. package/lib/es6/callback.js +16 -0
  83. package/lib/es6/caml.js +196 -0
  84. package/lib/es6/caml_array.js +122 -0
  85. package/lib/es6/caml_array_extern.js +1 -0
  86. package/lib/es6/caml_bytes.js +122 -0
  87. package/lib/es6/caml_exceptions.js +31 -0
  88. package/lib/es6/caml_external_polyfill.js +32 -0
  89. package/lib/es6/caml_float.js +129 -0
  90. package/lib/es6/caml_float_extern.js +1 -0
  91. package/lib/es6/caml_format.js +818 -0
  92. package/lib/es6/caml_hash.js +101 -0
  93. package/lib/es6/caml_hash_primitive.js +51 -0
  94. package/lib/es6/caml_int32.js +28 -0
  95. package/lib/es6/caml_int64.js +606 -0
  96. package/lib/es6/caml_int64_extern.js +1 -0
  97. package/lib/es6/caml_js_exceptions.js +31 -0
  98. package/lib/es6/caml_lexer.js +258 -0
  99. package/lib/es6/caml_md5.js +168 -0
  100. package/lib/es6/caml_module.js +117 -0
  101. package/lib/es6/caml_nativeint_extern.js +1 -0
  102. package/lib/es6/caml_obj.js +413 -0
  103. package/lib/es6/caml_option.js +86 -0
  104. package/lib/es6/caml_parser.js +303 -0
  105. package/lib/es6/caml_splice_call.js +52 -0
  106. package/lib/es6/caml_string.js +23 -0
  107. package/lib/es6/caml_string_extern.js +1 -0
  108. package/lib/es6/caml_sys.js +99 -0
  109. package/lib/es6/caml_undefined_extern.js +1 -0
  110. package/lib/es6/camlinternalLazy.js +59 -0
  111. package/lib/es6/camlinternalMod.js +1 -0
  112. package/lib/es6/char.js +126 -0
  113. package/lib/es6/complex.js +176 -0
  114. package/lib/es6/curry.js +526 -0
  115. package/lib/es6/digest.js +118 -0
  116. package/lib/es6/dom.js +12 -0
  117. package/lib/es6/dom_storage.js +27 -0
  118. package/lib/es6/dom_storage2.js +1 -0
  119. package/lib/es6/filename.js +496 -0
  120. package/lib/es6/genlex.js +666 -0
  121. package/lib/es6/hashtbl.js +1115 -0
  122. package/lib/es6/hashtblLabels.js +170 -0
  123. package/lib/es6/int32.js +75 -0
  124. package/lib/es6/int64.js +70 -0
  125. package/lib/es6/js.js +111 -0
  126. package/lib/es6/js_OO.js +15 -0
  127. package/lib/es6/js_array.js +223 -0
  128. package/lib/es6/js_array2.js +1 -0
  129. package/lib/es6/js_bigint.js +1 -0
  130. package/lib/es6/js_cast.js +1 -0
  131. package/lib/es6/js_console.js +1 -0
  132. package/lib/es6/js_date.js +1 -0
  133. package/lib/es6/js_dict.js +85 -0
  134. package/lib/es6/js_exn.js +44 -0
  135. package/lib/es6/js_float.js +1 -0
  136. package/lib/es6/js_global.js +1 -0
  137. package/lib/es6/js_int.js +17 -0
  138. package/lib/es6/js_json.js +172 -0
  139. package/lib/es6/js_list.js +333 -0
  140. package/lib/es6/js_map.js +1 -0
  141. package/lib/es6/js_mapperRt.js +54 -0
  142. package/lib/es6/js_math.js +50 -0
  143. package/lib/es6/js_null.js +49 -0
  144. package/lib/es6/js_null_undefined.js +35 -0
  145. package/lib/es6/js_obj.js +1 -0
  146. package/lib/es6/js_option.js +104 -0
  147. package/lib/es6/js_promise.js +17 -0
  148. package/lib/es6/js_re.js +1 -0
  149. package/lib/es6/js_result.js +1 -0
  150. package/lib/es6/js_set.js +1 -0
  151. package/lib/es6/js_string.js +199 -0
  152. package/lib/es6/js_string2.js +1 -0
  153. package/lib/es6/js_typed_array.js +1733 -0
  154. package/lib/es6/js_typed_array2.js +39 -0
  155. package/lib/es6/js_types.js +77 -0
  156. package/lib/es6/js_undefined.js +52 -0
  157. package/lib/es6/js_vector.js +134 -0
  158. package/lib/es6/js_weakmap.js +1 -0
  159. package/lib/es6/js_weakset.js +1 -0
  160. package/lib/es6/jsx.js +1 -0
  161. package/lib/es6/jsxDOM.js +1 -0
  162. package/lib/es6/jsxDOMStyle.js +1 -0
  163. package/lib/es6/jsxEvent.js +59 -0
  164. package/lib/es6/lazy.js +44 -0
  165. package/lib/es6/lexing.js +217 -0
  166. package/lib/es6/list.js +1713 -0
  167. package/lib/es6/listLabels.js +1713 -0
  168. package/lib/es6/map.js +936 -0
  169. package/lib/es6/mapLabels.js +951 -0
  170. package/lib/es6/moreLabels.js +1931 -0
  171. package/lib/es6/node.js +39 -0
  172. package/lib/es6/node_buffer.js +1 -0
  173. package/lib/es6/node_child_process.js +1 -0
  174. package/lib/es6/node_fs.js +9 -0
  175. package/lib/es6/node_module.js +1 -0
  176. package/lib/es6/node_path.js +1 -0
  177. package/lib/es6/node_process.js +18 -0
  178. package/lib/es6/obj.js +11 -0
  179. package/lib/es6/package.json +1 -0
  180. package/lib/es6/parsing.js +237 -0
  181. package/lib/es6/pervasives.js +250 -0
  182. package/lib/es6/printexc.js +102 -0
  183. package/lib/es6/queue.js +181 -0
  184. package/lib/es6/random.js +280 -0
  185. package/lib/es6/set.js +955 -0
  186. package/lib/es6/setLabels.js +988 -0
  187. package/lib/es6/sort.js +168 -0
  188. package/lib/es6/stack.js +88 -0
  189. package/lib/es6/stdLabels.js +18 -0
  190. package/lib/es6/stream.js +496 -0
  191. package/lib/es6/string.js +337 -0
  192. package/lib/es6/stringLabels.js +337 -0
  193. package/lib/es6/sys.js +182 -0
  194. package/lib/es6/uchar.js +133 -0
  195. package/lib/js/arg.js +715 -0
  196. package/lib/js/array.js +509 -0
  197. package/lib/js/arrayLabels.js +509 -0
  198. package/lib/js/belt.js +55 -0
  199. package/lib/js/belt_Array.js +762 -0
  200. package/lib/js/belt_Float.js +14 -0
  201. package/lib/js/belt_HashMap.js +278 -0
  202. package/lib/js/belt_HashMapInt.js +262 -0
  203. package/lib/js/belt_HashMapString.js +262 -0
  204. package/lib/js/belt_HashSet.js +220 -0
  205. package/lib/js/belt_HashSetInt.js +205 -0
  206. package/lib/js/belt_HashSetString.js +205 -0
  207. package/lib/js/belt_Id.js +69 -0
  208. package/lib/js/belt_Int.js +14 -0
  209. package/lib/js/belt_List.js +1510 -0
  210. package/lib/js/belt_Map.js +374 -0
  211. package/lib/js/belt_MapDict.js +415 -0
  212. package/lib/js/belt_MapInt.js +305 -0
  213. package/lib/js/belt_MapString.js +305 -0
  214. package/lib/js/belt_MutableMap.js +393 -0
  215. package/lib/js/belt_MutableMapInt.js +360 -0
  216. package/lib/js/belt_MutableMapString.js +360 -0
  217. package/lib/js/belt_MutableQueue.js +297 -0
  218. package/lib/js/belt_MutableSet.js +536 -0
  219. package/lib/js/belt_MutableSetInt.js +499 -0
  220. package/lib/js/belt_MutableSetString.js +499 -0
  221. package/lib/js/belt_MutableStack.js +135 -0
  222. package/lib/js/belt_Option.js +149 -0
  223. package/lib/js/belt_Range.js +107 -0
  224. package/lib/js/belt_Result.js +134 -0
  225. package/lib/js/belt_Set.js +312 -0
  226. package/lib/js/belt_SetDict.js +360 -0
  227. package/lib/js/belt_SetInt.js +357 -0
  228. package/lib/js/belt_SetString.js +357 -0
  229. package/lib/js/belt_SortArray.js +425 -0
  230. package/lib/js/belt_SortArrayInt.js +372 -0
  231. package/lib/js/belt_SortArrayString.js +372 -0
  232. package/lib/js/belt_internalAVLset.js +938 -0
  233. package/lib/js/belt_internalAVLtree.js +1144 -0
  234. package/lib/js/belt_internalBuckets.js +285 -0
  235. package/lib/js/belt_internalBucketsType.js +47 -0
  236. package/lib/js/belt_internalMapInt.js +363 -0
  237. package/lib/js/belt_internalMapString.js +363 -0
  238. package/lib/js/belt_internalSetBuckets.js +189 -0
  239. package/lib/js/belt_internalSetInt.js +207 -0
  240. package/lib/js/belt_internalSetString.js +207 -0
  241. package/lib/js/buffer.js +475 -0
  242. package/lib/js/bytes.js +702 -0
  243. package/lib/js/bytesLabels.js +702 -0
  244. package/lib/js/callback.js +14 -0
  245. package/lib/js/caml.js +194 -0
  246. package/lib/js/caml_array.js +120 -0
  247. package/lib/js/caml_array_extern.js +1 -0
  248. package/lib/js/caml_bytes.js +120 -0
  249. package/lib/js/caml_exceptions.js +29 -0
  250. package/lib/js/caml_external_polyfill.js +30 -0
  251. package/lib/js/caml_float.js +127 -0
  252. package/lib/js/caml_float_extern.js +1 -0
  253. package/lib/js/caml_format.js +816 -0
  254. package/lib/js/caml_hash.js +99 -0
  255. package/lib/js/caml_hash_primitive.js +49 -0
  256. package/lib/js/caml_int32.js +26 -0
  257. package/lib/js/caml_int64.js +604 -0
  258. package/lib/js/caml_int64_extern.js +1 -0
  259. package/lib/js/caml_js_exceptions.js +29 -0
  260. package/lib/js/caml_lexer.js +256 -0
  261. package/lib/js/caml_md5.js +166 -0
  262. package/lib/js/caml_module.js +115 -0
  263. package/lib/js/caml_nativeint_extern.js +1 -0
  264. package/lib/js/caml_obj.js +411 -0
  265. package/lib/js/caml_option.js +84 -0
  266. package/lib/js/caml_parser.js +301 -0
  267. package/lib/js/caml_splice_call.js +50 -0
  268. package/lib/js/caml_string.js +21 -0
  269. package/lib/js/caml_string_extern.js +1 -0
  270. package/lib/js/caml_sys.js +97 -0
  271. package/lib/js/caml_undefined_extern.js +1 -0
  272. package/lib/js/camlinternalLazy.js +57 -0
  273. package/lib/js/camlinternalMod.js +1 -0
  274. package/lib/js/char.js +124 -0
  275. package/lib/js/complex.js +174 -0
  276. package/lib/js/curry.js +524 -0
  277. package/lib/js/digest.js +116 -0
  278. package/lib/js/dom.js +10 -0
  279. package/lib/js/dom_storage.js +25 -0
  280. package/lib/js/dom_storage2.js +1 -0
  281. package/lib/js/filename.js +494 -0
  282. package/lib/js/genlex.js +664 -0
  283. package/lib/js/hashtbl.js +1113 -0
  284. package/lib/js/hashtblLabels.js +168 -0
  285. package/lib/js/int32.js +73 -0
  286. package/lib/js/int64.js +68 -0
  287. package/lib/js/js.js +109 -0
  288. package/lib/js/js_OO.js +13 -0
  289. package/lib/js/js_array.js +221 -0
  290. package/lib/js/js_array2.js +1 -0
  291. package/lib/js/js_bigint.js +1 -0
  292. package/lib/js/js_cast.js +1 -0
  293. package/lib/js/js_console.js +1 -0
  294. package/lib/js/js_date.js +1 -0
  295. package/lib/js/js_dict.js +83 -0
  296. package/lib/js/js_exn.js +42 -0
  297. package/lib/js/js_float.js +1 -0
  298. package/lib/js/js_global.js +1 -0
  299. package/lib/js/js_int.js +15 -0
  300. package/lib/js/js_json.js +170 -0
  301. package/lib/js/js_list.js +331 -0
  302. package/lib/js/js_map.js +1 -0
  303. package/lib/js/js_mapperRt.js +52 -0
  304. package/lib/js/js_math.js +48 -0
  305. package/lib/js/js_null.js +47 -0
  306. package/lib/js/js_null_undefined.js +33 -0
  307. package/lib/js/js_obj.js +1 -0
  308. package/lib/js/js_option.js +103 -0
  309. package/lib/js/js_promise.js +15 -0
  310. package/lib/js/js_re.js +1 -0
  311. package/lib/js/js_result.js +1 -0
  312. package/lib/js/js_set.js +1 -0
  313. package/lib/js/js_string.js +197 -0
  314. package/lib/js/js_string2.js +1 -0
  315. package/lib/js/js_typed_array.js +1731 -0
  316. package/lib/js/js_typed_array2.js +37 -0
  317. package/lib/js/js_types.js +75 -0
  318. package/lib/js/js_undefined.js +50 -0
  319. package/lib/js/js_vector.js +132 -0
  320. package/lib/js/js_weakmap.js +1 -0
  321. package/lib/js/js_weakset.js +1 -0
  322. package/lib/js/jsx.js +1 -0
  323. package/lib/js/jsxDOM.js +1 -0
  324. package/lib/js/jsxDOMStyle.js +1 -0
  325. package/lib/js/jsxEvent.js +57 -0
  326. package/lib/js/lazy.js +42 -0
  327. package/lib/js/lexing.js +215 -0
  328. package/lib/js/list.js +1711 -0
  329. package/lib/js/listLabels.js +1711 -0
  330. package/lib/js/map.js +934 -0
  331. package/lib/js/mapLabels.js +949 -0
  332. package/lib/js/moreLabels.js +1929 -0
  333. package/lib/js/node.js +37 -0
  334. package/lib/js/node_buffer.js +1 -0
  335. package/lib/js/node_child_process.js +1 -0
  336. package/lib/js/node_fs.js +7 -0
  337. package/lib/js/node_module.js +1 -0
  338. package/lib/js/node_path.js +1 -0
  339. package/lib/js/node_process.js +16 -0
  340. package/lib/js/obj.js +9 -0
  341. package/lib/js/parsing.js +235 -0
  342. package/lib/js/pervasives.js +248 -0
  343. package/lib/js/printexc.js +100 -0
  344. package/lib/js/queue.js +179 -0
  345. package/lib/js/random.js +278 -0
  346. package/lib/js/set.js +953 -0
  347. package/lib/js/setLabels.js +986 -0
  348. package/lib/js/sort.js +166 -0
  349. package/lib/js/stack.js +86 -0
  350. package/lib/js/stdLabels.js +16 -0
  351. package/lib/js/stream.js +494 -0
  352. package/lib/js/string.js +335 -0
  353. package/lib/js/stringLabels.js +335 -0
  354. package/lib/js/sys.js +180 -0
  355. package/lib/js/uchar.js +131 -0
  356. package/lib/minisocket.js +93 -0
  357. package/lib/ocaml/arg.cmi +0 -0
  358. package/lib/ocaml/arg.cmt +0 -0
  359. package/lib/ocaml/arg.cmti +0 -0
  360. package/lib/ocaml/arg.ml +359 -0
  361. package/lib/ocaml/arg.mli +185 -0
  362. package/lib/ocaml/array.cmi +0 -0
  363. package/lib/ocaml/array.cmt +0 -0
  364. package/lib/ocaml/array.cmti +0 -0
  365. package/lib/ocaml/array.ml +307 -0
  366. package/lib/ocaml/array.mli +275 -0
  367. package/lib/ocaml/arrayLabels.cmi +0 -0
  368. package/lib/ocaml/arrayLabels.cmt +0 -0
  369. package/lib/ocaml/arrayLabels.cmti +0 -0
  370. package/lib/ocaml/arrayLabels.ml +307 -0
  371. package/lib/ocaml/arrayLabels.mli +276 -0
  372. package/lib/ocaml/belt.cmi +0 -0
  373. package/lib/ocaml/belt.cmt +0 -0
  374. package/lib/ocaml/belt.ml +352 -0
  375. package/lib/ocaml/belt_Array.cmi +0 -0
  376. package/lib/ocaml/belt_Array.cmt +0 -0
  377. package/lib/ocaml/belt_Array.cmti +0 -0
  378. package/lib/ocaml/belt_Array.ml +525 -0
  379. package/lib/ocaml/belt_Array.mli +707 -0
  380. package/lib/ocaml/belt_Float.cmi +0 -0
  381. package/lib/ocaml/belt_Float.cmt +0 -0
  382. package/lib/ocaml/belt_Float.cmti +0 -0
  383. package/lib/ocaml/belt_Float.ml +50 -0
  384. package/lib/ocaml/belt_Float.mli +106 -0
  385. package/lib/ocaml/belt_HashMap.cmi +0 -0
  386. package/lib/ocaml/belt_HashMap.cmt +0 -0
  387. package/lib/ocaml/belt_HashMap.cmti +0 -0
  388. package/lib/ocaml/belt_HashMap.ml +226 -0
  389. package/lib/ocaml/belt_HashMap.mli +436 -0
  390. package/lib/ocaml/belt_HashMapInt.cmi +0 -0
  391. package/lib/ocaml/belt_HashMapInt.cmt +0 -0
  392. package/lib/ocaml/belt_HashMapInt.cmti +0 -0
  393. package/lib/ocaml/belt_HashMapInt.ml +206 -0
  394. package/lib/ocaml/belt_HashMapInt.mli +50 -0
  395. package/lib/ocaml/belt_HashMapString.cmi +0 -0
  396. package/lib/ocaml/belt_HashMapString.cmt +0 -0
  397. package/lib/ocaml/belt_HashMapString.cmti +0 -0
  398. package/lib/ocaml/belt_HashMapString.ml +206 -0
  399. package/lib/ocaml/belt_HashMapString.mli +50 -0
  400. package/lib/ocaml/belt_HashSet.cmi +0 -0
  401. package/lib/ocaml/belt_HashSet.cmt +0 -0
  402. package/lib/ocaml/belt_HashSet.cmti +0 -0
  403. package/lib/ocaml/belt_HashSet.ml +196 -0
  404. package/lib/ocaml/belt_HashSet.mli +125 -0
  405. package/lib/ocaml/belt_HashSetInt.cmi +0 -0
  406. package/lib/ocaml/belt_HashSetInt.cmt +0 -0
  407. package/lib/ocaml/belt_HashSetInt.cmti +0 -0
  408. package/lib/ocaml/belt_HashSetInt.ml +155 -0
  409. package/lib/ocaml/belt_HashSetInt.mli +74 -0
  410. package/lib/ocaml/belt_HashSetString.cmi +0 -0
  411. package/lib/ocaml/belt_HashSetString.cmt +0 -0
  412. package/lib/ocaml/belt_HashSetString.cmti +0 -0
  413. package/lib/ocaml/belt_HashSetString.ml +156 -0
  414. package/lib/ocaml/belt_HashSetString.mli +74 -0
  415. package/lib/ocaml/belt_Id.cmi +0 -0
  416. package/lib/ocaml/belt_Id.cmt +0 -0
  417. package/lib/ocaml/belt_Id.cmti +0 -0
  418. package/lib/ocaml/belt_Id.ml +133 -0
  419. package/lib/ocaml/belt_Id.mli +171 -0
  420. package/lib/ocaml/belt_Int.cmi +0 -0
  421. package/lib/ocaml/belt_Int.cmt +0 -0
  422. package/lib/ocaml/belt_Int.cmti +0 -0
  423. package/lib/ocaml/belt_Int.ml +50 -0
  424. package/lib/ocaml/belt_Int.mli +103 -0
  425. package/lib/ocaml/belt_List.cmi +0 -0
  426. package/lib/ocaml/belt_List.cmt +0 -0
  427. package/lib/ocaml/belt_List.cmti +0 -0
  428. package/lib/ocaml/belt_List.ml +803 -0
  429. package/lib/ocaml/belt_List.mli +844 -0
  430. package/lib/ocaml/belt_Map.cmi +0 -0
  431. package/lib/ocaml/belt_Map.cmt +0 -0
  432. package/lib/ocaml/belt_Map.cmti +0 -0
  433. package/lib/ocaml/belt_Map.ml +170 -0
  434. package/lib/ocaml/belt_Map.mli +496 -0
  435. package/lib/ocaml/belt_MapDict.cmi +0 -0
  436. package/lib/ocaml/belt_MapDict.cmt +0 -0
  437. package/lib/ocaml/belt_MapDict.cmti +0 -0
  438. package/lib/ocaml/belt_MapDict.ml +278 -0
  439. package/lib/ocaml/belt_MapDict.mli +268 -0
  440. package/lib/ocaml/belt_MapInt.cmi +0 -0
  441. package/lib/ocaml/belt_MapInt.cmt +0 -0
  442. package/lib/ocaml/belt_MapInt.cmti +0 -0
  443. package/lib/ocaml/belt_MapInt.ml +169 -0
  444. package/lib/ocaml/belt_MapInt.mli +187 -0
  445. package/lib/ocaml/belt_MapString.cmi +0 -0
  446. package/lib/ocaml/belt_MapString.cmt +0 -0
  447. package/lib/ocaml/belt_MapString.cmti +0 -0
  448. package/lib/ocaml/belt_MapString.ml +169 -0
  449. package/lib/ocaml/belt_MapString.mli +187 -0
  450. package/lib/ocaml/belt_MutableMap.cmi +0 -0
  451. package/lib/ocaml/belt_MutableMap.cmt +0 -0
  452. package/lib/ocaml/belt_MutableMap.cmti +0 -0
  453. package/lib/ocaml/belt_MutableMap.ml +241 -0
  454. package/lib/ocaml/belt_MutableMap.mli +145 -0
  455. package/lib/ocaml/belt_MutableMapInt.cmi +0 -0
  456. package/lib/ocaml/belt_MutableMapInt.cmt +0 -0
  457. package/lib/ocaml/belt_MutableMapInt.cmti +0 -0
  458. package/lib/ocaml/belt_MutableMapInt.ml +172 -0
  459. package/lib/ocaml/belt_MutableMapInt.mli +135 -0
  460. package/lib/ocaml/belt_MutableMapString.cmi +0 -0
  461. package/lib/ocaml/belt_MutableMapString.cmt +0 -0
  462. package/lib/ocaml/belt_MutableMapString.cmti +0 -0
  463. package/lib/ocaml/belt_MutableMapString.ml +172 -0
  464. package/lib/ocaml/belt_MutableMapString.mli +135 -0
  465. package/lib/ocaml/belt_MutableQueue.cmi +0 -0
  466. package/lib/ocaml/belt_MutableQueue.cmt +0 -0
  467. package/lib/ocaml/belt_MutableQueue.cmti +0 -0
  468. package/lib/ocaml/belt_MutableQueue.ml +222 -0
  469. package/lib/ocaml/belt_MutableQueue.mli +116 -0
  470. package/lib/ocaml/belt_MutableSet.cmi +0 -0
  471. package/lib/ocaml/belt_MutableSet.cmt +0 -0
  472. package/lib/ocaml/belt_MutableSet.cmti +0 -0
  473. package/lib/ocaml/belt_MutableSet.ml +371 -0
  474. package/lib/ocaml/belt_MutableSet.mli +617 -0
  475. package/lib/ocaml/belt_MutableSetInt.cmi +0 -0
  476. package/lib/ocaml/belt_MutableSetInt.cmt +0 -0
  477. package/lib/ocaml/belt_MutableSetInt.cmti +0 -0
  478. package/lib/ocaml/belt_MutableSetInt.ml +342 -0
  479. package/lib/ocaml/belt_MutableSetInt.mli +124 -0
  480. package/lib/ocaml/belt_MutableSetString.cmi +0 -0
  481. package/lib/ocaml/belt_MutableSetString.cmt +0 -0
  482. package/lib/ocaml/belt_MutableSetString.cmti +0 -0
  483. package/lib/ocaml/belt_MutableSetString.ml +342 -0
  484. package/lib/ocaml/belt_MutableSetString.mli +124 -0
  485. package/lib/ocaml/belt_MutableStack.cmi +0 -0
  486. package/lib/ocaml/belt_MutableStack.cmt +0 -0
  487. package/lib/ocaml/belt_MutableStack.cmti +0 -0
  488. package/lib/ocaml/belt_MutableStack.ml +106 -0
  489. package/lib/ocaml/belt_MutableStack.mli +63 -0
  490. package/lib/ocaml/belt_Option.cmi +0 -0
  491. package/lib/ocaml/belt_Option.cmt +0 -0
  492. package/lib/ocaml/belt_Option.cmti +0 -0
  493. package/lib/ocaml/belt_Option.ml +93 -0
  494. package/lib/ocaml/belt_Option.mli +270 -0
  495. package/lib/ocaml/belt_Range.cmi +0 -0
  496. package/lib/ocaml/belt_Range.cmt +0 -0
  497. package/lib/ocaml/belt_Range.cmti +0 -0
  498. package/lib/ocaml/belt_Range.ml +76 -0
  499. package/lib/ocaml/belt_Range.mli +114 -0
  500. package/lib/ocaml/belt_Result.cmi +0 -0
  501. package/lib/ocaml/belt_Result.cmt +0 -0
  502. package/lib/ocaml/belt_Result.cmti +0 -0
  503. package/lib/ocaml/belt_Result.ml +75 -0
  504. package/lib/ocaml/belt_Result.mli +205 -0
  505. package/lib/ocaml/belt_Set.cmi +0 -0
  506. package/lib/ocaml/belt_Set.cmt +0 -0
  507. package/lib/ocaml/belt_Set.cmti +0 -0
  508. package/lib/ocaml/belt_Set.cppo.ml +205 -0
  509. package/lib/ocaml/belt_Set.cppo.mli +153 -0
  510. package/lib/ocaml/belt_Set.ml +164 -0
  511. package/lib/ocaml/belt_Set.mli +523 -0
  512. package/lib/ocaml/belt_SetDict.cmi +0 -0
  513. package/lib/ocaml/belt_SetDict.cmt +0 -0
  514. package/lib/ocaml/belt_SetDict.cmti +0 -0
  515. package/lib/ocaml/belt_SetDict.ml +237 -0
  516. package/lib/ocaml/belt_SetDict.mli +567 -0
  517. package/lib/ocaml/belt_SetInt.cmi +0 -0
  518. package/lib/ocaml/belt_SetInt.cmt +0 -0
  519. package/lib/ocaml/belt_SetInt.cmti +0 -0
  520. package/lib/ocaml/belt_SetInt.ml +201 -0
  521. package/lib/ocaml/belt_SetInt.mli +151 -0
  522. package/lib/ocaml/belt_SetString.cmi +0 -0
  523. package/lib/ocaml/belt_SetString.cmt +0 -0
  524. package/lib/ocaml/belt_SetString.cmti +0 -0
  525. package/lib/ocaml/belt_SetString.ml +201 -0
  526. package/lib/ocaml/belt_SetString.mli +151 -0
  527. package/lib/ocaml/belt_SortArray.cmi +0 -0
  528. package/lib/ocaml/belt_SortArray.cmt +0 -0
  529. package/lib/ocaml/belt_SortArray.cmti +0 -0
  530. package/lib/ocaml/belt_SortArray.ml +322 -0
  531. package/lib/ocaml/belt_SortArray.mli +146 -0
  532. package/lib/ocaml/belt_SortArrayInt.cmi +0 -0
  533. package/lib/ocaml/belt_SortArrayInt.cmt +0 -0
  534. package/lib/ocaml/belt_SortArrayInt.cmti +0 -0
  535. package/lib/ocaml/belt_SortArrayInt.ml +263 -0
  536. package/lib/ocaml/belt_SortArrayInt.mli +93 -0
  537. package/lib/ocaml/belt_SortArrayString.cmi +0 -0
  538. package/lib/ocaml/belt_SortArrayString.cmt +0 -0
  539. package/lib/ocaml/belt_SortArrayString.cmti +0 -0
  540. package/lib/ocaml/belt_SortArrayString.ml +263 -0
  541. package/lib/ocaml/belt_SortArrayString.mli +93 -0
  542. package/lib/ocaml/belt_internalAVLset.cmt +0 -0
  543. package/lib/ocaml/belt_internalAVLset.cmti +0 -0
  544. package/lib/ocaml/belt_internalAVLset.ml +665 -0
  545. package/lib/ocaml/belt_internalAVLset.mli +124 -0
  546. package/lib/ocaml/belt_internalAVLtree.cmt +0 -0
  547. package/lib/ocaml/belt_internalAVLtree.cmti +0 -0
  548. package/lib/ocaml/belt_internalAVLtree.ml +762 -0
  549. package/lib/ocaml/belt_internalAVLtree.mli +215 -0
  550. package/lib/ocaml/belt_internalBuckets.cmt +0 -0
  551. package/lib/ocaml/belt_internalBuckets.cmti +0 -0
  552. package/lib/ocaml/belt_internalBuckets.ml +218 -0
  553. package/lib/ocaml/belt_internalBuckets.mli +57 -0
  554. package/lib/ocaml/belt_internalBucketsType.cmt +0 -0
  555. package/lib/ocaml/belt_internalBucketsType.cmti +0 -0
  556. package/lib/ocaml/belt_internalBucketsType.ml +59 -0
  557. package/lib/ocaml/belt_internalBucketsType.mli +46 -0
  558. package/lib/ocaml/belt_internalMapInt.cmt +0 -0
  559. package/lib/ocaml/belt_internalMapInt.ml +227 -0
  560. package/lib/ocaml/belt_internalMapString.cmt +0 -0
  561. package/lib/ocaml/belt_internalMapString.ml +227 -0
  562. package/lib/ocaml/belt_internalSetBuckets.cmt +0 -0
  563. package/lib/ocaml/belt_internalSetBuckets.cmti +0 -0
  564. package/lib/ocaml/belt_internalSetBuckets.ml +157 -0
  565. package/lib/ocaml/belt_internalSetBuckets.mli +47 -0
  566. package/lib/ocaml/belt_internalSetInt.cmt +0 -0
  567. package/lib/ocaml/belt_internalSetInt.ml +129 -0
  568. package/lib/ocaml/belt_internalSetString.cmt +0 -0
  569. package/lib/ocaml/belt_internalSetString.ml +129 -0
  570. package/lib/ocaml/belt_internals.cmti +0 -0
  571. package/lib/ocaml/belt_internals.mli +79 -0
  572. package/lib/ocaml/buffer.cmi +0 -0
  573. package/lib/ocaml/buffer.cmt +0 -0
  574. package/lib/ocaml/buffer.cmti +0 -0
  575. package/lib/ocaml/buffer.ml +250 -0
  576. package/lib/ocaml/buffer.mli +149 -0
  577. package/lib/ocaml/bytes.cmi +0 -0
  578. package/lib/ocaml/bytes.cmt +0 -0
  579. package/lib/ocaml/bytes.cmti +0 -0
  580. package/lib/ocaml/bytes.ml +431 -0
  581. package/lib/ocaml/bytes.mli +430 -0
  582. package/lib/ocaml/bytesLabels.cmi +0 -0
  583. package/lib/ocaml/bytesLabels.cmt +0 -0
  584. package/lib/ocaml/bytesLabels.cmti +0 -0
  585. package/lib/ocaml/bytesLabels.ml +428 -0
  586. package/lib/ocaml/bytesLabels.mli +276 -0
  587. package/lib/ocaml/callback.cmi +0 -0
  588. package/lib/ocaml/callback.cmt +0 -0
  589. package/lib/ocaml/callback.cmti +0 -0
  590. package/lib/ocaml/callback.ml +20 -0
  591. package/lib/ocaml/callback.mli +34 -0
  592. package/lib/ocaml/camlinternalLazy.cmi +0 -0
  593. package/lib/ocaml/camlinternalLazy.cmt +0 -0
  594. package/lib/ocaml/camlinternalLazy.cmti +0 -0
  595. package/lib/ocaml/camlinternalLazy.ml +89 -0
  596. package/lib/ocaml/camlinternalLazy.mli +27 -0
  597. package/lib/ocaml/camlinternalMod.cmi +0 -0
  598. package/lib/ocaml/camlinternalMod.cmt +0 -0
  599. package/lib/ocaml/camlinternalMod.cmti +0 -0
  600. package/lib/ocaml/camlinternalMod.ml +21 -0
  601. package/lib/ocaml/camlinternalMod.mli +25 -0
  602. package/lib/ocaml/char.cmi +0 -0
  603. package/lib/ocaml/char.cmt +0 -0
  604. package/lib/ocaml/char.cmti +0 -0
  605. package/lib/ocaml/char.ml +76 -0
  606. package/lib/ocaml/char.mli +72 -0
  607. package/lib/ocaml/complex.cmi +0 -0
  608. package/lib/ocaml/complex.cmt +0 -0
  609. package/lib/ocaml/complex.cmti +0 -0
  610. package/lib/ocaml/complex.ml +87 -0
  611. package/lib/ocaml/complex.mli +86 -0
  612. package/lib/ocaml/digest.cmi +0 -0
  613. package/lib/ocaml/digest.cmt +0 -0
  614. package/lib/ocaml/digest.cmti +0 -0
  615. package/lib/ocaml/digest.ml +66 -0
  616. package/lib/ocaml/digest.mli +68 -0
  617. package/lib/ocaml/dom.cmi +0 -0
  618. package/lib/ocaml/dom.cmt +0 -0
  619. package/lib/ocaml/dom.ml +296 -0
  620. package/lib/ocaml/dom_storage.cmi +0 -0
  621. package/lib/ocaml/dom_storage.cmt +0 -0
  622. package/lib/ocaml/dom_storage.ml +22 -0
  623. package/lib/ocaml/dom_storage2.cmi +0 -0
  624. package/lib/ocaml/dom_storage2.cmt +0 -0
  625. package/lib/ocaml/dom_storage2.ml +11 -0
  626. package/lib/ocaml/filename.cmi +0 -0
  627. package/lib/ocaml/filename.cmt +0 -0
  628. package/lib/ocaml/filename.cmti +0 -0
  629. package/lib/ocaml/filename.ml +233 -0
  630. package/lib/ocaml/filename.mli +134 -0
  631. package/lib/ocaml/genlex.cmi +0 -0
  632. package/lib/ocaml/genlex.cmt +0 -0
  633. package/lib/ocaml/genlex.cmti +0 -0
  634. package/lib/ocaml/genlex.ml +201 -0
  635. package/lib/ocaml/genlex.mli +73 -0
  636. package/lib/ocaml/hashmap.cppo.ml +214 -0
  637. package/lib/ocaml/hashmap.cppo.mli +54 -0
  638. package/lib/ocaml/hashset.cppo.ml +165 -0
  639. package/lib/ocaml/hashset.cppo.mli +77 -0
  640. package/lib/ocaml/hashtbl.cmi +0 -0
  641. package/lib/ocaml/hashtbl.cmt +0 -0
  642. package/lib/ocaml/hashtbl.cmti +0 -0
  643. package/lib/ocaml/hashtbl.ml +541 -0
  644. package/lib/ocaml/hashtbl.mli +411 -0
  645. package/lib/ocaml/hashtblLabels.cmi +0 -0
  646. package/lib/ocaml/hashtblLabels.cmt +0 -0
  647. package/lib/ocaml/hashtblLabels.ml +130 -0
  648. package/lib/ocaml/int32.cmi +0 -0
  649. package/lib/ocaml/int32.cmt +0 -0
  650. package/lib/ocaml/int32.cmti +0 -0
  651. package/lib/ocaml/int32.ml +64 -0
  652. package/lib/ocaml/int32.mli +186 -0
  653. package/lib/ocaml/int64.cmi +0 -0
  654. package/lib/ocaml/int64.cmt +0 -0
  655. package/lib/ocaml/int64.cmti +0 -0
  656. package/lib/ocaml/int64.ml +72 -0
  657. package/lib/ocaml/int64.mli +197 -0
  658. package/lib/ocaml/internal_map.cppo.ml +230 -0
  659. package/lib/ocaml/internal_set.cppo.ml +134 -0
  660. package/lib/ocaml/js.cmi +0 -0
  661. package/lib/ocaml/js.cmt +0 -0
  662. package/lib/ocaml/js.ml +313 -0
  663. package/lib/ocaml/js_OO.cmi +0 -0
  664. package/lib/ocaml/js_OO.cmt +0 -0
  665. package/lib/ocaml/js_OO.ml +180 -0
  666. package/lib/ocaml/js_array.cmi +0 -0
  667. package/lib/ocaml/js_array.cmt +0 -0
  668. package/lib/ocaml/js_array.ml +970 -0
  669. package/lib/ocaml/js_array2.cmi +0 -0
  670. package/lib/ocaml/js_array2.cmt +0 -0
  671. package/lib/ocaml/js_array2.ml +1065 -0
  672. package/lib/ocaml/js_bigint.cmi +0 -0
  673. package/lib/ocaml/js_bigint.cmt +0 -0
  674. package/lib/ocaml/js_bigint.ml +3 -0
  675. package/lib/ocaml/js_cast.cmi +0 -0
  676. package/lib/ocaml/js_cast.cmt +0 -0
  677. package/lib/ocaml/js_cast.cmti +0 -0
  678. package/lib/ocaml/js_cast.ml +29 -0
  679. package/lib/ocaml/js_cast.mli +45 -0
  680. package/lib/ocaml/js_console.cmi +0 -0
  681. package/lib/ocaml/js_console.cmt +0 -0
  682. package/lib/ocaml/js_console.ml +51 -0
  683. package/lib/ocaml/js_date.cmi +0 -0
  684. package/lib/ocaml/js_date.cmt +0 -0
  685. package/lib/ocaml/js_date.ml +1263 -0
  686. package/lib/ocaml/js_dict.cmi +0 -0
  687. package/lib/ocaml/js_dict.cmt +0 -0
  688. package/lib/ocaml/js_dict.cmti +0 -0
  689. package/lib/ocaml/js_dict.ml +114 -0
  690. package/lib/ocaml/js_dict.mli +152 -0
  691. package/lib/ocaml/js_exn.cmi +0 -0
  692. package/lib/ocaml/js_exn.cmt +0 -0
  693. package/lib/ocaml/js_exn.cmti +0 -0
  694. package/lib/ocaml/js_exn.ml +102 -0
  695. package/lib/ocaml/js_exn.mli +79 -0
  696. package/lib/ocaml/js_float.cmi +0 -0
  697. package/lib/ocaml/js_float.cmt +0 -0
  698. package/lib/ocaml/js_float.ml +294 -0
  699. package/lib/ocaml/js_global.cmi +0 -0
  700. package/lib/ocaml/js_global.cmt +0 -0
  701. package/lib/ocaml/js_global.ml +185 -0
  702. package/lib/ocaml/js_int.cmi +0 -0
  703. package/lib/ocaml/js_int.cmt +0 -0
  704. package/lib/ocaml/js_int.ml +158 -0
  705. package/lib/ocaml/js_json.cmi +0 -0
  706. package/lib/ocaml/js_json.cmt +0 -0
  707. package/lib/ocaml/js_json.cmti +0 -0
  708. package/lib/ocaml/js_json.ml +195 -0
  709. package/lib/ocaml/js_json.mli +244 -0
  710. package/lib/ocaml/js_list.cmi +0 -0
  711. package/lib/ocaml/js_list.cmt +0 -0
  712. package/lib/ocaml/js_list.cmti +0 -0
  713. package/lib/ocaml/js_list.ml +174 -0
  714. package/lib/ocaml/js_list.mli +72 -0
  715. package/lib/ocaml/js_map.cmi +0 -0
  716. package/lib/ocaml/js_map.cmt +0 -0
  717. package/lib/ocaml/js_map.ml +3 -0
  718. package/lib/ocaml/js_mapperRt.cmi +0 -0
  719. package/lib/ocaml/js_mapperRt.cmt +0 -0
  720. package/lib/ocaml/js_mapperRt.cmti +0 -0
  721. package/lib/ocaml/js_mapperRt.ml +50 -0
  722. package/lib/ocaml/js_mapperRt.mli +44 -0
  723. package/lib/ocaml/js_math.cmi +0 -0
  724. package/lib/ocaml/js_math.cmt +0 -0
  725. package/lib/ocaml/js_math.ml +626 -0
  726. package/lib/ocaml/js_null.cmi +0 -0
  727. package/lib/ocaml/js_null.cmt +0 -0
  728. package/lib/ocaml/js_null.cmti +0 -0
  729. package/lib/ocaml/js_null.ml +57 -0
  730. package/lib/ocaml/js_null.mli +87 -0
  731. package/lib/ocaml/js_null_undefined.cmi +0 -0
  732. package/lib/ocaml/js_null_undefined.cmt +0 -0
  733. package/lib/ocaml/js_null_undefined.cmti +0 -0
  734. package/lib/ocaml/js_null_undefined.ml +50 -0
  735. package/lib/ocaml/js_null_undefined.mli +85 -0
  736. package/lib/ocaml/js_obj.cmi +0 -0
  737. package/lib/ocaml/js_obj.cmt +0 -0
  738. package/lib/ocaml/js_obj.ml +100 -0
  739. package/lib/ocaml/js_option.cmi +0 -0
  740. package/lib/ocaml/js_option.cmt +0 -0
  741. package/lib/ocaml/js_option.cmti +0 -0
  742. package/lib/ocaml/js_option.ml +203 -0
  743. package/lib/ocaml/js_option.mli +52 -0
  744. package/lib/ocaml/js_promise.cmi +0 -0
  745. package/lib/ocaml/js_promise.cmt +0 -0
  746. package/lib/ocaml/js_promise.ml +100 -0
  747. package/lib/ocaml/js_re.cmi +0 -0
  748. package/lib/ocaml/js_re.cmt +0 -0
  749. package/lib/ocaml/js_re.ml +184 -0
  750. package/lib/ocaml/js_result.cmi +0 -0
  751. package/lib/ocaml/js_result.cmt +0 -0
  752. package/lib/ocaml/js_result.cmti +0 -0
  753. package/lib/ocaml/js_result.ml +28 -0
  754. package/lib/ocaml/js_result.mli +28 -0
  755. package/lib/ocaml/js_set.cmi +0 -0
  756. package/lib/ocaml/js_set.cmt +0 -0
  757. package/lib/ocaml/js_set.ml +3 -0
  758. package/lib/ocaml/js_string.cmi +0 -0
  759. package/lib/ocaml/js_string.cmt +0 -0
  760. package/lib/ocaml/js_string.ml +914 -0
  761. package/lib/ocaml/js_string2.cmi +0 -0
  762. package/lib/ocaml/js_string2.cmt +0 -0
  763. package/lib/ocaml/js_string2.ml +912 -0
  764. package/lib/ocaml/js_typed_array.cmi +0 -0
  765. package/lib/ocaml/js_typed_array.cmt +0 -0
  766. package/lib/ocaml/js_typed_array.cppo.ml +429 -0
  767. package/lib/ocaml/js_typed_array.ml +1405 -0
  768. package/lib/ocaml/js_typed_array2.cmi +0 -0
  769. package/lib/ocaml/js_typed_array2.cmt +0 -0
  770. package/lib/ocaml/js_typed_array2.cppo.ml +296 -0
  771. package/lib/ocaml/js_typed_array2.ml +1269 -0
  772. package/lib/ocaml/js_types.cmi +0 -0
  773. package/lib/ocaml/js_types.cmt +0 -0
  774. package/lib/ocaml/js_types.cmti +0 -0
  775. package/lib/ocaml/js_types.ml +118 -0
  776. package/lib/ocaml/js_types.mli +78 -0
  777. package/lib/ocaml/js_undefined.cmi +0 -0
  778. package/lib/ocaml/js_undefined.cmt +0 -0
  779. package/lib/ocaml/js_undefined.cmti +0 -0
  780. package/lib/ocaml/js_undefined.ml +59 -0
  781. package/lib/ocaml/js_undefined.mli +92 -0
  782. package/lib/ocaml/js_vector.cmi +0 -0
  783. package/lib/ocaml/js_vector.cmt +0 -0
  784. package/lib/ocaml/js_vector.cmti +0 -0
  785. package/lib/ocaml/js_vector.ml +143 -0
  786. package/lib/ocaml/js_vector.mli +92 -0
  787. package/lib/ocaml/js_weakmap.cmi +0 -0
  788. package/lib/ocaml/js_weakmap.cmt +0 -0
  789. package/lib/ocaml/js_weakmap.ml +3 -0
  790. package/lib/ocaml/js_weakset.cmi +0 -0
  791. package/lib/ocaml/js_weakset.cmt +0 -0
  792. package/lib/ocaml/js_weakset.ml +3 -0
  793. package/lib/ocaml/jsx.cmi +0 -0
  794. package/lib/ocaml/jsx.cmt +0 -0
  795. package/lib/ocaml/jsx.ml +39 -0
  796. package/lib/ocaml/jsxDOM.cmi +0 -0
  797. package/lib/ocaml/jsxDOM.cmt +0 -0
  798. package/lib/ocaml/jsxDOM.ml +2087 -0
  799. package/lib/ocaml/jsxDOMStyle.cmi +0 -0
  800. package/lib/ocaml/jsxDOMStyle.cmt +0 -0
  801. package/lib/ocaml/jsxDOMStyle.ml +777 -0
  802. package/lib/ocaml/jsxEvent.cmi +0 -0
  803. package/lib/ocaml/jsxEvent.cmt +0 -0
  804. package/lib/ocaml/jsxEvent.ml +358 -0
  805. package/lib/ocaml/lazy.cmi +0 -0
  806. package/lib/ocaml/lazy.cmt +0 -0
  807. package/lib/ocaml/lazy.cmti +0 -0
  808. package/lib/ocaml/lazy.ml +70 -0
  809. package/lib/ocaml/lazy.mli +95 -0
  810. package/lib/ocaml/lexing.cmi +0 -0
  811. package/lib/ocaml/lexing.cmt +0 -0
  812. package/lib/ocaml/lexing.cmti +0 -0
  813. package/lib/ocaml/lexing.ml +230 -0
  814. package/lib/ocaml/lexing.mli +172 -0
  815. package/lib/ocaml/list.cmi +0 -0
  816. package/lib/ocaml/list.cmt +0 -0
  817. package/lib/ocaml/list.cmti +0 -0
  818. package/lib/ocaml/list.ml +485 -0
  819. package/lib/ocaml/list.mli +347 -0
  820. package/lib/ocaml/listLabels.cmi +0 -0
  821. package/lib/ocaml/listLabels.cmt +0 -0
  822. package/lib/ocaml/listLabels.cmti +0 -0
  823. package/lib/ocaml/listLabels.ml +485 -0
  824. package/lib/ocaml/listLabels.mli +353 -0
  825. package/lib/ocaml/map.cmi +0 -0
  826. package/lib/ocaml/map.cmt +0 -0
  827. package/lib/ocaml/map.cmti +0 -0
  828. package/lib/ocaml/map.cppo.ml +174 -0
  829. package/lib/ocaml/map.cppo.mli +191 -0
  830. package/lib/ocaml/map.ml +480 -0
  831. package/lib/ocaml/map.mli +315 -0
  832. package/lib/ocaml/mapLabels.cmi +0 -0
  833. package/lib/ocaml/mapLabels.cmt +0 -0
  834. package/lib/ocaml/mapLabels.ml +480 -0
  835. package/lib/ocaml/mapm.cppo.ml +177 -0
  836. package/lib/ocaml/mapm.cppo.mli +138 -0
  837. package/lib/ocaml/moreLabels.cmi +0 -0
  838. package/lib/ocaml/moreLabels.cmt +0 -0
  839. package/lib/ocaml/moreLabels.cmti +0 -0
  840. package/lib/ocaml/moreLabels.ml +22 -0
  841. package/lib/ocaml/moreLabels.mli +198 -0
  842. package/lib/ocaml/node.cmi +0 -0
  843. package/lib/ocaml/node.cmt +0 -0
  844. package/lib/ocaml/node.ml +84 -0
  845. package/lib/ocaml/node_buffer.cmi +0 -0
  846. package/lib/ocaml/node_buffer.cmt +0 -0
  847. package/lib/ocaml/node_buffer.ml +47 -0
  848. package/lib/ocaml/node_child_process.cmi +0 -0
  849. package/lib/ocaml/node_child_process.cmt +0 -0
  850. package/lib/ocaml/node_child_process.ml +50 -0
  851. package/lib/ocaml/node_fs.cmi +0 -0
  852. package/lib/ocaml/node_fs.cmt +0 -0
  853. package/lib/ocaml/node_fs.ml +153 -0
  854. package/lib/ocaml/node_module.cmi +0 -0
  855. package/lib/ocaml/node_module.cmt +0 -0
  856. package/lib/ocaml/node_module.ml +29 -0
  857. package/lib/ocaml/node_path.cmi +0 -0
  858. package/lib/ocaml/node_path.cmt +0 -0
  859. package/lib/ocaml/node_path.ml +71 -0
  860. package/lib/ocaml/node_process.cmi +0 -0
  861. package/lib/ocaml/node_process.cmt +0 -0
  862. package/lib/ocaml/node_process.cmti +0 -0
  863. package/lib/ocaml/node_process.ml +59 -0
  864. package/lib/ocaml/node_process.mli +48 -0
  865. package/lib/ocaml/obj.cmi +0 -0
  866. package/lib/ocaml/obj.cmt +0 -0
  867. package/lib/ocaml/obj.cmti +0 -0
  868. package/lib/ocaml/obj.ml +29 -0
  869. package/lib/ocaml/obj.mli +62 -0
  870. package/lib/ocaml/parsing.cmi +0 -0
  871. package/lib/ocaml/parsing.cmt +0 -0
  872. package/lib/ocaml/parsing.cmti +0 -0
  873. package/lib/ocaml/parsing.ml +212 -0
  874. package/lib/ocaml/parsing.mli +105 -0
  875. package/lib/ocaml/pervasives.cmi +0 -0
  876. package/lib/ocaml/pervasives.cmt +0 -0
  877. package/lib/ocaml/pervasives.cmti +0 -0
  878. package/lib/ocaml/pervasives.ml +297 -0
  879. package/lib/ocaml/pervasives.mli +771 -0
  880. package/lib/ocaml/printexc.cmi +0 -0
  881. package/lib/ocaml/printexc.cmt +0 -0
  882. package/lib/ocaml/printexc.cmti +0 -0
  883. package/lib/ocaml/printexc.ml +79 -0
  884. package/lib/ocaml/printexc.mli +57 -0
  885. package/lib/ocaml/queue.cmi +0 -0
  886. package/lib/ocaml/queue.cmt +0 -0
  887. package/lib/ocaml/queue.cmti +0 -0
  888. package/lib/ocaml/queue.ml +132 -0
  889. package/lib/ocaml/queue.mli +82 -0
  890. package/lib/ocaml/random.cmi +0 -0
  891. package/lib/ocaml/random.cmt +0 -0
  892. package/lib/ocaml/random.cmti +0 -0
  893. package/lib/ocaml/random.ml +273 -0
  894. package/lib/ocaml/random.mli +102 -0
  895. package/lib/ocaml/set.cmi +0 -0
  896. package/lib/ocaml/set.cmt +0 -0
  897. package/lib/ocaml/set.cmti +0 -0
  898. package/lib/ocaml/set.ml +526 -0
  899. package/lib/ocaml/set.mli +266 -0
  900. package/lib/ocaml/setLabels.cmi +0 -0
  901. package/lib/ocaml/setLabels.cmt +0 -0
  902. package/lib/ocaml/setLabels.ml +526 -0
  903. package/lib/ocaml/setm.cppo.ml +346 -0
  904. package/lib/ocaml/setm.cppo.mli +126 -0
  905. package/lib/ocaml/sort.cmi +0 -0
  906. package/lib/ocaml/sort.cmt +0 -0
  907. package/lib/ocaml/sort.cmti +0 -0
  908. package/lib/ocaml/sort.cppo.ml +267 -0
  909. package/lib/ocaml/sort.cppo.mli +96 -0
  910. package/lib/ocaml/sort.ml +99 -0
  911. package/lib/ocaml/sort.mli +44 -0
  912. package/lib/ocaml/stack.cmi +0 -0
  913. package/lib/ocaml/stack.cmt +0 -0
  914. package/lib/ocaml/stack.cmti +0 -0
  915. package/lib/ocaml/stack.ml +44 -0
  916. package/lib/ocaml/stack.mli +63 -0
  917. package/lib/ocaml/stdLabels.cmi +0 -0
  918. package/lib/ocaml/stdLabels.cmt +0 -0
  919. package/lib/ocaml/stdLabels.cmti +0 -0
  920. package/lib/ocaml/stdLabels.ml +24 -0
  921. package/lib/ocaml/stdLabels.mli +29 -0
  922. package/lib/ocaml/stream.cmi +0 -0
  923. package/lib/ocaml/stream.cmt +0 -0
  924. package/lib/ocaml/stream.cmti +0 -0
  925. package/lib/ocaml/stream.ml +213 -0
  926. package/lib/ocaml/stream.mli +108 -0
  927. package/lib/ocaml/string.cmi +0 -0
  928. package/lib/ocaml/string.cmt +0 -0
  929. package/lib/ocaml/string.cmti +0 -0
  930. package/lib/ocaml/string.ml +190 -0
  931. package/lib/ocaml/string.mli +286 -0
  932. package/lib/ocaml/stringLabels.cmi +0 -0
  933. package/lib/ocaml/stringLabels.cmt +0 -0
  934. package/lib/ocaml/stringLabels.cmti +0 -0
  935. package/lib/ocaml/stringLabels.ml +190 -0
  936. package/lib/ocaml/stringLabels.mli +241 -0
  937. package/lib/ocaml/sys.cmi +0 -0
  938. package/lib/ocaml/sys.cmt +0 -0
  939. package/lib/ocaml/sys.cmti +0 -0
  940. package/lib/ocaml/sys.ml +135 -0
  941. package/lib/ocaml/sys.mli +333 -0
  942. package/lib/ocaml/uchar.cmi +0 -0
  943. package/lib/ocaml/uchar.cmt +0 -0
  944. package/lib/ocaml/uchar.cmti +0 -0
  945. package/lib/ocaml/uchar.ml +58 -0
  946. package/lib/ocaml/uchar.mli +98 -0
  947. package/linux/bsb_helper.exe +0 -0
  948. package/linux/bsc.exe +0 -0
  949. package/linux/ninja.COPYING +202 -0
  950. package/linux/ninja.exe +0 -0
  951. package/linux/refmt.exe +0 -0
  952. package/linux/rescript.exe +0 -0
  953. package/openbsd/.keep +0 -0
  954. package/package.json +71 -0
  955. package/rescript +591 -0
  956. package/scripts/LICENSE.ml +27 -0
  957. package/scripts/bin_path.js +38 -0
  958. package/scripts/buckle_lto.js +55 -0
  959. package/scripts/build_sorted.ml +233 -0
  960. package/scripts/buildocaml.js +102 -0
  961. package/scripts/caml_oo_curry_gen.ml +71 -0
  962. package/scripts/checkUnused.js +63 -0
  963. package/scripts/ciTest.js +172 -0
  964. package/scripts/config.js +24 -0
  965. package/scripts/cover.sh +3 -0
  966. package/scripts/curry_gen.ml +167 -0
  967. package/scripts/dbg +13 -0
  968. package/scripts/dedupe.js +44 -0
  969. package/scripts/doc_gen.js +117 -0
  970. package/scripts/install.js +237 -0
  971. package/scripts/installUtils.js +61 -0
  972. package/scripts/js_internal_gen.js +135 -0
  973. package/scripts/jsconfig.json +12 -0
  974. package/scripts/littlecase.js +21 -0
  975. package/scripts/ninja.js +1980 -0
  976. package/scripts/ninjaFactory.js +36 -0
  977. package/scripts/pack.js +107 -0
  978. package/scripts/prebuilt.js +99 -0
  979. package/scripts/release.js +41 -0
  980. package/scripts/repl.js +151 -0
  981. package/scripts/rescript_arg.js +168 -0
  982. package/scripts/rescript_convert.js +128 -0
  983. package/scripts/rescript_dump.js +48 -0
  984. package/scripts/rescript_format.js +194 -0
  985. package/scripts/shake.js +138 -0
  986. package/scripts/tasks.js +149 -0
  987. package/scripts/test.sh +3 -0
  988. package/scripts/tmp.js +98 -0
  989. package/scripts/validate.js +41 -0
  990. package/vendor/ninja.tar.gz +0 -0
  991. package/vendor/ocaml.tar.gz +0 -0
  992. package/win32/bsb_helper.exe +0 -0
  993. package/win32/bsc.exe +0 -0
  994. package/win32/ninja.COPYING +202 -0
  995. package/win32/ninja.exe +0 -0
  996. package/win32/refmt.exe +0 -0
  997. package/win32/rescript.exe +0 -0
@@ -0,0 +1,359 @@
1
+ (**************************************************************************)
2
+ (* *)
3
+ (* OCaml *)
4
+ (* *)
5
+ (* Damien Doligez, projet Para, INRIA Rocquencourt *)
6
+ (* *)
7
+ (* Copyright 1996 Institut National de Recherche en Informatique et *)
8
+ (* en Automatique. *)
9
+ (* *)
10
+ (* All rights reserved. This file is distributed under the terms of *)
11
+ (* the GNU Lesser General Public License version 2.1, with the *)
12
+ (* special exception on linking described in the file LICENSE. *)
13
+ (* *)
14
+ (**************************************************************************)
15
+
16
+ type key = string
17
+ type doc = string
18
+ type usage_msg = string
19
+ type anon_fun = (string -> unit)
20
+
21
+ type spec =
22
+ | Unit of (unit -> unit) (* Call the function with unit argument *)
23
+ | Bool of (bool -> unit) (* Call the function with a bool argument *)
24
+ | Set of bool ref (* Set the reference to true *)
25
+ | Clear of bool ref (* Set the reference to false *)
26
+ | String of (string -> unit) (* Call the function with a string argument *)
27
+ | Set_string of string ref (* Set the reference to the string argument *)
28
+ | Int of (int -> unit) (* Call the function with an int argument *)
29
+ | Set_int of int ref (* Set the reference to the int argument *)
30
+ | Float of (float -> unit) (* Call the function with a float argument *)
31
+ | Set_float of float ref (* Set the reference to the float argument *)
32
+ | Tuple of spec list (* Take several arguments according to the
33
+ spec list *)
34
+ | Symbol of string list * (string -> unit)
35
+ (* Take one of the symbols as argument and
36
+ call the function with the symbol. *)
37
+ | Rest of (string -> unit) (* Stop interpreting keywords and call the
38
+ function with each remaining argument *)
39
+ | Expand of (string -> string array) (* If the remaining arguments to process
40
+ are of the form
41
+ [["-foo"; "arg"] @ rest] where "foo" is
42
+ registered as [Expand f], then the
43
+ arguments [f "arg" @ rest] are
44
+ processed. Only allowed in
45
+ [parse_and_expand_argv_dynamic]. *)
46
+
47
+ exception Bad of string
48
+ exception Help of string
49
+
50
+ type error =
51
+ | Unknown of string
52
+ | Wrong of string * string * string (* option, actual, expected *)
53
+ | Missing of string
54
+ | Message of string
55
+
56
+ exception Stop of error (* used internally *)
57
+
58
+
59
+
60
+ let rec assoc3 x l =
61
+ match l with
62
+ | [] -> raise Not_found
63
+ | (y1, y2, _) :: _ when y1 = x -> y2
64
+ | _ :: t -> assoc3 x t
65
+
66
+
67
+ let split s =
68
+ let i = String.index s '=' in
69
+ let len = String.length s in
70
+ String.sub s 0 i, String.sub s (i+1) (len-(i+1))
71
+
72
+
73
+ let make_symlist prefix sep suffix l =
74
+ match l with
75
+ | [] -> "<none>"
76
+ | h::t -> (List.fold_left (fun x y -> x ^ sep ^ y) (prefix ^ h) t) ^ suffix
77
+
78
+
79
+ let print_spec buf (key, spec, doc) =
80
+ if String.length doc > 0 then
81
+ match spec with
82
+ | Symbol (l, _) ->
83
+ let sym = make_symlist "{" "|" "}" l in
84
+ Buffer.add_string buf {j| $(key) $(sym)$(doc)\n|j}
85
+ | _ ->
86
+ Buffer.add_string buf {j| $(key) $(doc)\n|j}
87
+
88
+
89
+
90
+ let help_action () = raise (Stop (Unknown "-help"))
91
+
92
+ let add_help speclist =
93
+ let add1 =
94
+ try ignore (assoc3 "-help" speclist); []
95
+ with Not_found ->
96
+ ["-help", Unit help_action, " Display this list of options"]
97
+ and add2 =
98
+ try ignore (assoc3 "--help" speclist); []
99
+ with Not_found ->
100
+ ["--help", Unit help_action, " Display this list of options"]
101
+ in
102
+ speclist @ (add1 @ add2)
103
+
104
+
105
+ let usage_b buf speclist errmsg =
106
+ Buffer.add_string buf {j|$(errmsg)\n|j};
107
+ List.iter (print_spec buf) (add_help speclist)
108
+
109
+
110
+ let usage_string speclist errmsg =
111
+ let b = Buffer.create 200 in
112
+ usage_b b speclist errmsg;
113
+ Buffer.contents b
114
+
115
+
116
+ let usage speclist errmsg =
117
+ Js.log (usage_string speclist errmsg)
118
+
119
+
120
+ let current = ref 0
121
+
122
+ let bool_of_string_opt x =
123
+ try Some (bool_of_string x)
124
+ with Invalid_argument _ -> None
125
+
126
+ let int_of_string_opt x =
127
+ try Some (int_of_string x)
128
+ with Failure _ -> None
129
+
130
+ let float_of_string_opt x =
131
+ try Some (float_of_string x)
132
+ with Failure _ -> None
133
+
134
+ let parse_and_expand_argv_dynamic_aux allow_expand current argv speclist anonfun errmsg =
135
+ let initpos = !current in
136
+ let convert_error error =
137
+ (* convert an internal error to a Bad/Help exception
138
+ *or* add the program name as a prefix and the usage message as a suffix
139
+ to an user-raised Bad exception.
140
+ *)
141
+ let b = Buffer.create 200 in
142
+ let progname = if initpos < (Array.length !argv) then !argv.(initpos) else "(?)" in
143
+ begin match error with
144
+ | Unknown "-help" -> ()
145
+ | Unknown "--help" -> ()
146
+ | Unknown s ->
147
+ Buffer.add_string b {j|$(progname): unknown option '$(s)'.\n|j}
148
+ | Missing s ->
149
+ Buffer.add_string b {j|$(progname): option '$(s)' needs an argument.\n|j}
150
+ | Wrong (opt, arg, expected) ->
151
+ Buffer.add_string b {j|$(progname): wrong argument '$(arg)'; option '$(opt)' expects $(expected).\n|j}
152
+ | Message s -> (* user error message *)
153
+ Buffer.add_string b {j|$(progname): $(s).\n|j}
154
+ end;
155
+ usage_b b !speclist errmsg;
156
+ if error = Unknown "-help" || error = Unknown "--help"
157
+ then Help (Buffer.contents b)
158
+ else Bad (Buffer.contents b)
159
+ in
160
+ incr current;
161
+ while !current < (Array.length !argv) do
162
+ begin try
163
+ let s = !argv.(!current) in
164
+ if String.length s >= 1 && s.[0] = '-' then begin
165
+ let action, follow =
166
+ try assoc3 s !speclist, None
167
+ with Not_found ->
168
+ try
169
+ let keyword, arg = split s in
170
+ assoc3 keyword !speclist, Some arg
171
+ with Not_found -> raise (Stop (Unknown s))
172
+ in
173
+ let no_arg () =
174
+ match follow with
175
+ | None -> ()
176
+ | Some arg -> raise (Stop (Wrong (s, arg, "no argument"))) in
177
+ let get_arg () =
178
+ match follow with
179
+ | None ->
180
+ if !current + 1 < (Array.length !argv) then !argv.(!current + 1)
181
+ else raise (Stop (Missing s))
182
+ | Some arg -> arg
183
+ in
184
+ let consume_arg () =
185
+ match follow with
186
+ | None -> incr current
187
+ | Some _ -> ()
188
+ in
189
+ let rec treat_action = function
190
+ | Unit f -> f ();
191
+ | Bool f ->
192
+ let arg = get_arg () in
193
+ begin match bool_of_string_opt arg with
194
+ | None -> raise (Stop (Wrong (s, arg, "a boolean")))
195
+ | Some s -> f s
196
+ end;
197
+ consume_arg ();
198
+ | Set r -> no_arg (); r := true;
199
+ | Clear r -> no_arg (); r := false;
200
+ | String f ->
201
+ let arg = get_arg () in
202
+ f arg;
203
+ consume_arg ();
204
+ | Symbol (symb, f) ->
205
+ let arg = get_arg () in
206
+ if List.mem arg symb then begin
207
+ f arg;
208
+ consume_arg ();
209
+ end else begin
210
+ raise (Stop (Wrong (s, arg, "one of: "
211
+ ^ (make_symlist "" " " "" symb))))
212
+ end
213
+ | Set_string r ->
214
+ r := get_arg ();
215
+ consume_arg ();
216
+ | Int f ->
217
+ let arg = get_arg () in
218
+ begin match int_of_string_opt arg with
219
+ | None -> raise (Stop (Wrong (s, arg, "an integer")))
220
+ | Some x -> f x
221
+ end;
222
+ consume_arg ();
223
+ | Set_int r ->
224
+ let arg = get_arg () in
225
+ begin match int_of_string_opt arg with
226
+ | None -> raise (Stop (Wrong (s, arg, "an integer")))
227
+ | Some x -> r := x
228
+ end;
229
+ consume_arg ();
230
+ | Float f ->
231
+ let arg = get_arg () in
232
+ begin match float_of_string_opt arg with
233
+ | None -> raise (Stop (Wrong (s, arg, "a float")))
234
+ | Some x -> f x
235
+ end;
236
+ consume_arg ();
237
+ | Set_float r ->
238
+ let arg = get_arg () in
239
+ begin match float_of_string_opt arg with
240
+ | None -> raise (Stop (Wrong (s, arg, "a float")))
241
+ | Some x -> r := x
242
+ end;
243
+ consume_arg ();
244
+ | Tuple specs ->
245
+ List.iter treat_action specs;
246
+ | Rest f ->
247
+ while !current < (Array.length !argv) - 1 do
248
+ f !argv.(!current + 1);
249
+ consume_arg ();
250
+ done;
251
+ | Expand f ->
252
+ if not allow_expand then
253
+ raise (Invalid_argument "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic");
254
+ let arg = get_arg () in
255
+ let newarg = f arg in
256
+ consume_arg ();
257
+ let before = Array.sub !argv 0 (!current + 1)
258
+ and after = Array.sub !argv (!current + 1) ((Array.length !argv) - !current - 1) in
259
+ argv:= Array.concat [before;newarg;after];
260
+ in
261
+ treat_action action end
262
+ else anonfun s
263
+ with | Bad m -> raise (convert_error (Message m));
264
+ | Stop e -> raise (convert_error e);
265
+ end;
266
+ incr current
267
+ done
268
+
269
+ let parse_and_expand_argv_dynamic current argv speclist anonfun errmsg =
270
+ parse_and_expand_argv_dynamic_aux true current argv speclist anonfun errmsg
271
+
272
+ let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
273
+ parse_and_expand_argv_dynamic_aux false current (ref argv) speclist anonfun errmsg
274
+
275
+
276
+ let parse_argv ?(current=current) argv speclist anonfun errmsg =
277
+ parse_argv_dynamic ~current:current argv (ref speclist) anonfun errmsg
278
+
279
+
280
+ let parse l f msg =
281
+ try
282
+ parse_argv Sys.argv l f msg
283
+ with
284
+ | Bad msg -> Js.log msg; exit 2
285
+ | Help msg -> Js.log msg; exit 0
286
+
287
+
288
+ let parse_dynamic l f msg =
289
+ try
290
+ parse_argv_dynamic Sys.argv l f msg
291
+ with
292
+ | Bad msg -> Js.log msg; exit 2
293
+ | Help msg -> Js.log msg; exit 0
294
+
295
+ let parse_expand l f msg =
296
+ try
297
+ let argv = ref Sys.argv in
298
+ let spec = ref l in
299
+ let current = ref (!current) in
300
+ parse_and_expand_argv_dynamic current argv spec f msg
301
+ with
302
+ | Bad msg -> Js.log msg; exit 2
303
+ | Help msg -> Js.log msg; exit 0
304
+
305
+
306
+ let second_word s =
307
+ let len = String.length s in
308
+ let rec loop n =
309
+ if n >= len then len
310
+ else if s.[n] = ' ' then loop (n+1)
311
+ else n
312
+ in
313
+ match String.index s '\t' with
314
+ | n -> loop (n+1)
315
+ | exception Not_found ->
316
+ begin match String.index s ' ' with
317
+ | n -> loop (n+1)
318
+ | exception Not_found -> len
319
+ end
320
+
321
+
322
+ let max_arg_len cur (kwd, spec, doc) =
323
+ match spec with
324
+ | Symbol _ -> max cur (String.length kwd)
325
+ | _ -> max cur (String.length kwd + second_word doc)
326
+
327
+
328
+ let replace_leading_tab s =
329
+ let seen = ref false in
330
+ String.map (function '\t' when not !seen -> seen := true; ' ' | c -> c) s
331
+
332
+ let add_padding len ksd =
333
+ match ksd with
334
+ | (_, _, "") ->
335
+ (* Do not pad undocumented options, so that they still don't show up when
336
+ * run through [usage] or [parse]. *)
337
+ ksd
338
+ | (kwd, (Symbol _ as spec), msg) ->
339
+ let cutcol = second_word msg in
340
+ let spaces = String.make ((max 0 (len - cutcol)) + 3) ' ' in
341
+ (kwd, spec, "\n" ^ spaces ^ replace_leading_tab msg)
342
+ | (kwd, spec, msg) ->
343
+ let cutcol = second_word msg in
344
+ let kwd_len = String.length kwd in
345
+ let diff = len - kwd_len - cutcol in
346
+ if diff <= 0 then
347
+ (kwd, spec, replace_leading_tab msg)
348
+ else
349
+ let spaces = String.make diff ' ' in
350
+ let prefix = String.sub (replace_leading_tab msg) 0 cutcol in
351
+ let suffix = String.sub msg cutcol (String.length msg - cutcol) in
352
+ (kwd, spec, prefix ^ spaces ^ suffix)
353
+
354
+
355
+ let align ?(limit=max_int) speclist =
356
+ let completed = add_help speclist in
357
+ let len = List.fold_left max_arg_len 0 completed in
358
+ let len = min len limit in
359
+ List.map (add_padding len) completed
@@ -0,0 +1,185 @@
1
+ (**************************************************************************)
2
+ (* *)
3
+ (* OCaml *)
4
+ (* *)
5
+ (* Damien Doligez, projet Para, INRIA Rocquencourt *)
6
+ (* *)
7
+ (* Copyright 1996 Institut National de Recherche en Informatique et *)
8
+ (* en Automatique. *)
9
+ (* *)
10
+ (* All rights reserved. This file is distributed under the terms of *)
11
+ (* the GNU Lesser General Public License version 2.1, with the *)
12
+ (* special exception on linking described in the file LICENSE. *)
13
+ (* *)
14
+ (**************************************************************************)
15
+
16
+ (** Parsing of command line arguments.
17
+
18
+ This module provides a general mechanism for extracting options and
19
+ arguments from the command line to the program.
20
+
21
+ Syntax of command lines:
22
+ A keyword is a character string starting with a [-].
23
+ An option is a keyword alone or followed by an argument.
24
+ The types of keywords are: [Unit], [Bool], [Set], [Clear],
25
+ [String], [Set_string], [Int], [Set_int], [Float], [Set_float],
26
+ [Tuple], [Symbol], and [Rest].
27
+ [Unit], [Set] and [Clear] keywords take no argument. A [Rest]
28
+ keyword takes the remaining of the command line as arguments.
29
+ Every other keyword takes the following word on the command line
30
+ as argument. For compatibility with GNU getopt_long, [keyword=arg]
31
+ is also allowed.
32
+ Arguments not preceded by a keyword are called anonymous arguments.
33
+
34
+ Examples ([cmd] is assumed to be the command name):
35
+ - [cmd -flag ](a unit option)
36
+ - [cmd -int 1 ](an int option with argument [1])
37
+ - [cmd -string foobar ](a string option with argument ["foobar"])
38
+ - [cmd -float 12.34 ](a float option with argument [12.34])
39
+ - [cmd a b c ](three anonymous arguments: ["a"], ["b"], and ["c"])
40
+ - [cmd a b -- c d ](two anonymous arguments and a rest option with
41
+ two arguments)
42
+ *)
43
+
44
+ type spec =
45
+ | Unit of (unit -> unit) (** Call the function with unit argument *)
46
+ | Bool of (bool -> unit) (** Call the function with a bool argument *)
47
+ | Set of bool ref (** Set the reference to true *)
48
+ | Clear of bool ref (** Set the reference to false *)
49
+ | String of (string -> unit) (** Call the function with a string argument *)
50
+ | Set_string of string ref (** Set the reference to the string argument *)
51
+ | Int of (int -> unit) (** Call the function with an int argument *)
52
+ | Set_int of int ref (** Set the reference to the int argument *)
53
+ | Float of (float -> unit) (** Call the function with a float argument *)
54
+ | Set_float of float ref (** Set the reference to the float argument *)
55
+ | Tuple of spec list (** Take several arguments according to the
56
+ spec list *)
57
+ | Symbol of string list * (string -> unit)
58
+ (** Take one of the symbols as argument and
59
+ call the function with the symbol *)
60
+ | Rest of (string -> unit) (** Stop interpreting keywords and call the
61
+ function with each remaining argument *)
62
+ | Expand of (string -> string array) (** If the remaining arguments to process
63
+ are of the form
64
+ [["-foo"; "arg"] @ rest] where "foo" is
65
+ registered as [Expand f], then the
66
+ arguments [f "arg" @ rest] are
67
+ processed. Only allowed in
68
+ [parse_and_expand_argv_dynamic]. *)
69
+ (** The concrete type describing the behavior associated
70
+ with a keyword. *)
71
+
72
+ type key = string
73
+ type doc = string
74
+ type usage_msg = string
75
+ type anon_fun = (string -> unit)
76
+
77
+ val parse :
78
+ (key * spec * doc) list -> anon_fun -> usage_msg -> unit
79
+ (** [Arg.parse speclist anon_fun usage_msg] parses the command line.
80
+ [speclist] is a list of triples [(key, spec, doc)].
81
+ [key] is the option keyword, it must start with a ['-'] character.
82
+ [spec] gives the option type and the function to call when this option
83
+ is found on the command line.
84
+ [doc] is a one-line description of this option.
85
+ [anon_fun] is called on anonymous arguments.
86
+ The functions in [spec] and [anon_fun] are called in the same order
87
+ as their arguments appear on the command line.
88
+
89
+ If an error occurs, [Arg.parse] exits the program, after printing
90
+ to standard error an error message as follows:
91
+ - The reason for the error: unknown option, invalid or missing argument, etc.
92
+ - [usage_msg]
93
+ - The list of options, each followed by the corresponding [doc] string.
94
+ Beware: options that have an empty [doc] string will not be included in the
95
+ list.
96
+
97
+ For the user to be able to specify anonymous arguments starting with a
98
+ [-], include for example [("-", String anon_fun, doc)] in [speclist].
99
+
100
+ By default, [parse] recognizes two unit options, [-help] and [--help],
101
+ which will print to standard output [usage_msg] and the list of
102
+ options, and exit the program. You can override this behaviour
103
+ by specifying your own [-help] and [--help] options in [speclist].
104
+ *)
105
+
106
+ val parse_dynamic :
107
+ (key * spec * doc) list ref -> anon_fun -> usage_msg -> unit
108
+ (** Same as {!Arg.parse}, except that the [speclist] argument is a reference
109
+ and may be updated during the parsing. A typical use for this feature
110
+ is to parse command lines of the form:
111
+ - command subcommand [options]
112
+ where the list of options depends on the value of the subcommand argument.
113
+ @since 4.01.0
114
+ *)
115
+
116
+ val parse_argv : ?current: int ref -> string array ->
117
+ (key * spec * doc) list -> anon_fun -> usage_msg -> unit
118
+ (** [Arg.parse_argv ~current args speclist anon_fun usage_msg] parses
119
+ the array [args] as if it were the command line. It uses and updates
120
+ the value of [~current] (if given), or {!Arg.current}. You must set
121
+ it before calling [parse_argv]. The initial value of [current]
122
+ is the index of the program name (argument 0) in the array.
123
+ If an error occurs, [Arg.parse_argv] raises {!Arg.Bad} with
124
+ the error message as argument. If option [-help] or [--help] is
125
+ given, [Arg.parse_argv] raises {!Arg.Help} with the help message
126
+ as argument.
127
+ *)
128
+
129
+ val parse_argv_dynamic : ?current:int ref -> string array ->
130
+ (key * spec * doc) list ref -> anon_fun -> string -> unit
131
+ (** Same as {!Arg.parse_argv}, except that the [speclist] argument is a
132
+ reference and may be updated during the parsing.
133
+ See {!Arg.parse_dynamic}.
134
+ @since 4.01.0
135
+ *)
136
+
137
+ val parse_and_expand_argv_dynamic : int ref -> string array ref ->
138
+ (key * spec * doc) list ref -> anon_fun -> string -> unit
139
+ (** Same as {!Arg.parse_argv_dynamic}, except that the [argv] argument is a
140
+ reference and may be updated during the parsing of [Expand] arguments.
141
+ See {!Arg.parse_argv_dynamic}.
142
+ @since 4.05.0
143
+ *)
144
+
145
+ val parse_expand:
146
+ (key * spec * doc) list -> anon_fun -> usage_msg -> unit
147
+ (** Same as {!Arg.parse}, except that the [Expand] arguments are allowed and
148
+ the {!current} reference is not updated.
149
+ @since 4.05.0
150
+ *)
151
+
152
+ exception Help of string
153
+ (** Raised by [Arg.parse_argv] when the user asks for help. *)
154
+
155
+ exception Bad of string
156
+ (** Functions in [spec] or [anon_fun] can raise [Arg.Bad] with an error
157
+ message to reject invalid arguments.
158
+ [Arg.Bad] is also raised by {!Arg.parse_argv} in case of an error. *)
159
+
160
+ val usage : (key * spec * doc) list -> usage_msg -> unit
161
+ (** [Arg.usage speclist usage_msg] prints to standard error
162
+ an error message that includes the list of valid options. This is
163
+ the same message that {!Arg.parse} prints in case of error.
164
+ [speclist] and [usage_msg] are the same as for {!Arg.parse}. *)
165
+
166
+ val usage_string : (key * spec * doc) list -> usage_msg -> string
167
+ (** Returns the message that would have been printed by {!Arg.usage},
168
+ if provided with the same parameters. *)
169
+
170
+ val align: ?limit: int -> (key * spec * doc) list -> (key * spec * doc) list
171
+ (** Align the documentation strings by inserting spaces at the first alignment
172
+ separator (tab or, if tab is not found, space), according to the length of
173
+ the keyword. Use a alignment separator as the first character in a doc
174
+ string if you want to align the whole string. The doc strings corresponding
175
+ to [Symbol] arguments are aligned on the next line.
176
+ @param limit options with keyword and message longer than [limit] will not
177
+ be used to compute the alignment. *)
178
+
179
+ val current : int ref
180
+ (** Position (in {!Sys.argv}) of the argument being processed. You can
181
+ change this value, e.g. to force {!Arg.parse} to skip some arguments.
182
+ {!Arg.parse} uses the initial value of {!Arg.current} as the index of
183
+ argument 0 (the program name) and starts parsing arguments
184
+ at the next element. *)
185
+
Binary file
Binary file
Binary file