This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Printf | |
(* Regular expressions *) | |
type regexp = | |
| Empty | |
| Epsilon | |
| Charclass of char * char | |
| Seq of regexp * regexp | |
| Alt of regexp * regexp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import re, argparse | |
def transform(filename, ocamldoc): | |
"""Preprocess MODULE_ALIASES section and @since tags in the given file. | |
Put the MODULE_ALIASES section at end of file in the form that the | |
compiler expects (module Foo = Stdlib__Bar). | |
Add @canonical tags unless ocamldoc argument is true. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
def add_stdlib_prefix(name): | |
""" "stdlib" and names beginning "camlinternal" are returned unchanged. | |
All other names are prefixed "stdlib__" with the original name capitalized | |
(i.e. "foo" becomes "stdlib__Foo"). """ | |
if name == "stdlib" or name.startswith("camlinternal"): | |
return name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type tree = | |
| Leaf | |
| Node of tree * int * tree | |
type itree = | |
| ILeaf | |
| INode of { mutable left: itree; mutable data: int; mutable right: itree } | |
let rec maketree depth = | |
if depth <= 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
external camlstate: int -> unit = "camlstate" | |
let _ = | |
camlstate (int_of_string Sys.argv.(1)) |