Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / ShowBasisDirective.adoc
CommitLineData
7f918cf1
CE
1ShowBasisDirective
2==================
3
4A comment of the form `(*#showBasis "<file>"*)` is recognized as a directive to
5save the current basis (i.e., environment) to `<file>` (in the same format as
6the `-show-basis <file>` <:CompileTimeOptions: compile-time option>). The
7`<file>` is interpreted relative to the source file in which it appears. The
8comment is lexed as a distinct token and is parsed as a structure-level
9declaration. [Note that treating the directive as a top-level declaration would
10prohibit using it inside a functor body, which would make the feature
11significantly less useful in the context of the MLton compiler sources (with its
12nearly fully functorial style).]
13
14This feature is meant to facilitate auto-completion via
15https://github.com/MatthewFluet/company-mlton[`company-mlton`] and similar
16tools.