4 <:ImplementSuffix:> is a pass for the <:SXML:>
5 <:IntermediateLanguage:>, invoked from <:SXMLSimplify:>.
9 This pass implements the `TopLevel_setSuffix` primitive, which
10 installs a function to exit the program.
14 * <!ViewGitFile(mlton,master,mlton/xml/implement-suffix.fun)>
16 == Details and Notes ==
18 <:ImplementSuffix:> works by introducing a new `ref` cell to contain
19 the function of type `unit -> unit` that should be called on program
22 * The following code (appropriately alpha-converted) is appended to the beginning of the <:SXML:> program:
30 "toplevel suffix not installed"
36 val topLevelSuffixCell =
45 TopLevel_setSuffix (f_0)
53 Ref_assign (topLevelSuffixCell, f_0)
56 * The following code (appropriately alpha-converted) is appended to the end of the <:SXML:> program:
61 Ref_deref (topLevelSuffixCell)