2017-08-18 08:30:39 -07:00
|
|
|
#**************************************************************************
|
|
|
|
#* *
|
|
|
|
#* OCaml *
|
|
|
|
#* *
|
|
|
|
#* Jeremie Dimino, Jane Street Europe *
|
|
|
|
#* *
|
|
|
|
#* Copyright 2017 Jane Street Group LLC *
|
|
|
|
#* *
|
|
|
|
#* All rights reserved. This file is distributed under the terms of *
|
|
|
|
#* the GNU Lesser General Public License version 2.1, with the *
|
|
|
|
#* special exception on linking described in the file LICENSE. *
|
|
|
|
#* *
|
|
|
|
#**************************************************************************
|
|
|
|
|
2017-01-12 03:56:24 -08:00
|
|
|
# This script adds the Stdlib__ prefixes to the module aliases in
|
|
|
|
# stdlib.ml and stdlib.mli
|
|
|
|
BEGIN { state=0 }
|
|
|
|
NR == 1 { printf ("# 1 \"%s\"\n", FILENAME) }
|
2017-06-08 01:33:58 -07:00
|
|
|
/\(\*MODULE_ALIASES\*\)\r?/ { state=1 }
|
2017-01-12 03:56:24 -08:00
|
|
|
{ if (state==0)
|
|
|
|
print;
|
|
|
|
else if (state==1)
|
|
|
|
state=2;
|
|
|
|
else if ($1 == "module")
|
2018-08-23 14:16:32 -07:00
|
|
|
{ if (ocamldoc!="true") printf("\n(** @canonical %s *)", $2);
|
2018-10-10 08:16:00 -07:00
|
|
|
first_letter=substr($4,1,1);
|
|
|
|
if (dune_wrapped!="true")
|
|
|
|
first_letter=tolower(first_letter);
|
|
|
|
printf("\nmodule %s = Stdlib__%s%s\n", $2, first_letter, substr($4,2));
|
2018-08-23 14:16:32 -07:00
|
|
|
}
|
2018-08-27 04:42:14 -07:00
|
|
|
else
|
|
|
|
print
|
2017-01-12 03:56:24 -08:00
|
|
|
}
|