ML Basis annotations control options that affect the elaboration of SML source files. Conceptually, a basis file is elaborated in a default annotation environment (just as it is elaborated in an empty basis). The declaration
merges the annotation ann
with the "current" annotation
environment for the elaboration of basdec
. To allow for future
expansion, "ann"
is lexed as a single SML string constant. To
conveniently specify multiple annotations, the following derived form
is provided:
Here are the available annotations. In the explanation below, for annotations that take an argument, the first value listed is the default.
-
allowFFI {false|true}
If
true
, allow_address
,_export
,_import
, and_symbol
expressions to appear in source files. See ForeignFunctionInterface. -
allowSuccessorML {false|true}
Allow or disallow all of the SuccessorML features. This is a proxy for all of the following annotations.
-
allowDoDecls {false|true}
If
true
, allow ado exp
declaration form. -
allowExtendedConsts {false|true}
Allow or disallow all of the extended constants features. This is a proxy for all of the following annotations.
-
allowExtendedNumConsts {false|true}
If
true
, allow extended numeric constants. -
allowExtendedTextConsts {false|true}
If
true
, allow extended text constants.
-
-
allowLineComments {false|true}
If
true
, allow line comments beginning with the token(*)
. -
allowOptBar {false|true}
If
true
, allow a bar to appear before the first match rule of acase
,fn
, orhandle
expression, allow a bar to appear before the first function-value binding of afun
declaration, and allow a bar to appear before the first constructor binding or description of adatatype
declaration or specification. -
allowOptSemicolon {false|true}
If
true
, allows a semicolon to appear after the last expression in a sequence expression orlet
body. -
allowOrPats {false|true}
If
true
, allows disjunctive (a.k.a., "or") patterns of the formpat | pat
. -
allowRecordPunExps {false|true}
If
true
, allows record punning expressions. -
allowSigWithtype {false|true}
If
true
, allowswithtype
to modify adatatype
specification in a signature. -
allowVectorExpsAndPats {false|true}
Allow or disallow vector expressions and vector patterns. This is a proxy for all of the following annotations.
-
allowVectorExps {false|true}
If
true
, allow vector expressions. -
allowVectorPats {false|true}
If
true
, allow vector patterns.
-
-
-
forceUsed
Force all identifiers in the basis denoted by the body of the
ann
to be considered used; use in conjunction withwarnUnused true
. -
nonexhaustiveBind {warn|error|ignore}
If
error
orwarn
, report nonexhaustive patterns inval
declarations (i.e., pattern-match failures that raise theBind
exception). An error will abort a compile, while a warning will not. -
nonexhaustiveExnBind {default|ignore}
If
ignore
, suppress errors and warnings about nonexhaustive matches inval
declarations that arise solely from unmatched exceptions. Ifdefault
, follow the behavior ofnonexhaustiveBind
. -
nonexhaustiveExnMatch {default|ignore}
If
ignore
, suppress errors and warnings about nonexhaustive matches infn
expressions,case
expressions, andfun
declarations that arise solely from unmatched exceptions. Ifdefault
, follow the behavior ofnonexhaustiveMatch
. -
nonexhaustiveExnRaise {ignore|default}
If
ignore
, suppress errors and warnings about nonexhaustive matches inhandle
expressions that arise solely from unmatched exceptions. Ifdefault
, follow the behavior ofnonexhaustiveRaise
. -
nonexhaustiveMatch {warn|error|ignore}
If
error
orwarn
, report nonexhaustive patterns infn
expressions,case
expressions, andfun
declarations (i.e., pattern-match failures that raise theMatch
exception). An error will abort a compile, while a warning will not. -
nonexhaustiveRaise {ignore|warn|error}
If
error
orwarn
, report nonexhaustive patterns inhandle
expressions (i.e., pattern-match failures that implicitly (re)raise the unmatched exception). An error will abort a compile, while a warning will not. -
redundantBind {warn|error|ignore}
If
error
orwarn
, report redundant patterns inval
declarations. An error will abort a compile, while a warning will not. -
redundantMatch {warn|error|ignore}
If
error
orwarn
, report redundant patterns infn
expressions,case
expressions, andfun
declarations. An error will abort a compile, while a warning will not. -
redundantRaise {warn|error|ignore}
If
error
orwarn
, report redundant patterns inhandle
expressions. An error will abort a compile, while a warning will not. -
resolveScope {strdec|dec|topdec|program}
Used to control the scope at which overload constraints are resolved to default types (if not otherwise resolved by type inference) and the scope at which unresolved flexible record constraints are reported.
The syntactic-class argument means to perform resolution checks at the smallest enclosing syntactic form of the given class. The default behavior is to resolve at the smallest enclosing strdec (which is equivalent to the largest enclosing dec). Other useful behaviors are to resolve at the smallest enclosing topdec (which is equivalent to the largest enclosing strdec) and at the smallest enclosing program (which corresponds to a single
.sml
file and does not correspond to the whole.mlb
program). -
sequenceNonUnit {ignore|error|warn}
If
error
orwarn
, report whene1
is not of typeunit
in the sequence expression(e1; e2)
. This can be helpful in detecting curried applications that are mistakenly not fully applied. To silence spurious messages, you can useignore e1
. -
valrecConstr {warn|error|ignore}
If
error
orwarn
, report when aval rec
(orfun
) declaration redefines an identifier that previously had constructor status. An error will abort a compile, while a warning will not. -
warnUnused {false|true}
Report unused identifiers.