diff options
-rwxr-xr-x | tools/sync_stdlib_docs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/sync_stdlib_docs b/tools/sync_stdlib_docs index 083c6f0fb7..6ac3c39b45 100755 --- a/tools/sync_stdlib_docs +++ b/tools/sync_stdlib_docs @@ -37,6 +37,14 @@ TILDEREGEX="s/ ~([a-z_]+(?=[ \]]))/ \1/g" #Indent a non-blank line by two characters, for moreLabels templates INDENTREGEX="s/^(.+)$/ \1/m" +#Remove Labels suffix in examples + + +LABELSDOTARGREGEX="s/([A-Z][a-z_]*)Labels\.(.*)~[a-z]+:/\1Labels.\2/g" +LABELSDOTREGEX="s/([A-Z][a-z_]*)Labels\./\1./g" + + + #Stdlib perl -p -e "$LABREGEX" stdlib/listLabels.mli > stdlib/list.temp.mli perl -p -e "$LABREGEX" stdlib/arrayLabels.mli > stdlib/array.temp.mli @@ -45,19 +53,29 @@ perl -p -e "$LABREGEX" stdlib/bytesLabels.mli > stdlib/bytes.temp.mli #Stdlib tildes perl -p -e "$TILDEREGEX" stdlib/list.temp.mli > stdlib/list.mli -perl -p -e "$TILDEREGEX" stdlib/array.temp.mli > stdlib/array.mli +perl -p -e "$TILDEREGEX" stdlib/array.temp.mli > stdlib/array.2temp.mli perl -p -e "$TILDEREGEX" stdlib/string.temp.mli > stdlib/string.mli perl -p -e "$TILDEREGEX" stdlib/bytes.temp.mli > stdlib/bytes.mli +# Array + +perl -p -e "$LABELSDOTARGREGEX" stdlib/array.2temp.mli > stdlib/array.3temp.mli +perl -p -e "$LABELSDOTREGEX" stdlib/array.3temp.mli > stdlib/array.mli + #FloatArrayLabels perl -p -e "$LABREGEX" \ stdlib/templates/floatarraylabeled.template.mli > \ stdlib/templates/floatarrayunlabeled.temp.mli perl -p -e "$TILDEREGEX" stdlib/templates/floatarrayunlabeled.temp.mli > \ stdlib/templates/floatarrayunlabeled.2temp.mli +perl -p -e "$LABELSDOTARGREGEX" \ + stdlib/templates/floatarrayunlabeled.2temp.mli > \ + stdlib/templates/floatarrayunlabeled.3temp.mli +perl -p -e "$LABELSDOTREGEX" stdlib/templates/floatarrayunlabeled.3temp.mli > \ + stdlib/templates/floatarrayunlabeled.4temp.mli perl -p -e "$INDENTREGEX" stdlib/templates/floatarraylabeled.template.mli > \ stdlib/templates/fal.indented.temp.mli -perl -p -e "$INDENTREGEX" stdlib/templates/floatarrayunlabeled.2temp.mli > \ +perl -p -e "$INDENTREGEX" stdlib/templates/floatarrayunlabeled.4temp.mli > \ stdlib/templates/fau.indented.temp.mli perl -p -e\ 's/FLOATARRAYLAB/`tail -n +17 stdlib\/templates\/fal.indented.temp.mli`/e' \ |