Conventional Module Names
is_library s is true if and only the string s matches the MlFront convention for library names.
Example libraries:
"DkHello_Std"
Example non-libraries:
"DkHello""DkHello_Std__A__B".
Inaccurate. Missing full fuzz-testing to get it accurate. The rules are:
- the name must match
"[A-Z][a-z0-9]+[A-Z][A-Za-z0-9]+_[A-Z]_?([A-Za-z0-9]+_)*"
is_standard_namespace_term s is true if and only the string s matches the MlFront convention for standard module names.
Example standard modules:
"DkHello"
Example that are not standard modules:
"DkHello_Std""DkHello_Std__A__B"
Inaccurate. Missing full fuzz-testing to get it accurate. The rules are:
- the name must match
"[A-Z]([A-Za-z0-9]+_?|[A-Za-z0-9]*_[a-z0-9][A-Za-z0-9]*(_[A-Za-z0-9]+)*_?|[A-Z]*[a-z0-9]*(_[A-Za-z0-9]+)*_?)"
Reserved Modules
The special module basename lib__ for a library control module.
The special module basename open__ for a library open module.
The suffix of the proxy special module.
Whether or not the module name is reserved for a library control module, library open module, proxy module, or for internal MlFront use.
Parsers
parse_library s parses the string s and returns the (vendor, qualifier, unit) of the library if s is a valid library name.
val parse_library_and_namespace :
[ `PackageId | `ModuleId ] ->
string ->
(string * string list, [> `Msg of string ]) Stdlib.result
