summaryrefslogtreecommitdiff
path: root/ocamldoc/stdlib_non_prefixed/extract_pervasives.awk
diff options
context:
space:
mode:
Diffstat (limited to 'ocamldoc/stdlib_non_prefixed/extract_pervasives.awk')
-rw-r--r--ocamldoc/stdlib_non_prefixed/extract_pervasives.awk9
1 files changed, 9 insertions, 0 deletions
diff --git a/ocamldoc/stdlib_non_prefixed/extract_pervasives.awk b/ocamldoc/stdlib_non_prefixed/extract_pervasives.awk
new file mode 100644
index 0000000000..a8c2550f7e
--- /dev/null
+++ b/ocamldoc/stdlib_non_prefixed/extract_pervasives.awk
@@ -0,0 +1,9 @@
+# This script extract the Pervasives submodule from stdlib.mli into
+# pervasives.mli, for ocamldoc
+BEGIN { state=0 }
+$0 == "module Pervasives : sig" && state == 0 { state=1 }
+$0 == "end" && state == 2 { state=3 }
+{
+ if (state == 1) state=2;
+ else if (state == 2) print
+}