Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / LineDirective.adoc
CommitLineData
7f918cf1
CE
1LineDirective
2=============
3
4To aid in the debugging of code produced by program generators such
5as http://www.eecs.harvard.edu/%7Enr/noweb/[Noweb], MLton supports
6comments with line directives of the form
7[source,sml]
8----
9(*#line l.c "f"*)
10----
11Here, _l_ and _c_ are sequences of decimal digits and _f_ is the
12source file. The first character of a source file has the position
131.1. A line directive causes the front end to believe that the
14character following the right parenthesis is at the line and column of
15the specified file. A line directive only affects the reporting of
16error messages and does not affect program semantics (except for
17functions like `MLton.Exn.history` that report source file positions).
18Syntactically invalid line directives are ignored. To prevent
19incompatibilities with SML, the file name may not contain the
20character sequence `*)`.