I am trying to document a function as below,
val f : string -> int
(** [val f s] converts [s] to [int]
{[ let i = f "234asdfas" (* Converts to int *) ]}
*)
How do I escape the *)
in code section, i.e. (* Convert ...
*) ?
I am trying to document a function as below,
val f : string -> int
(** [val f s] converts [s] to [int]
{[ let i = f "234asdfas" (* Converts to int *) ]}
*)
How do I escape the *)
in code section, i.e. (* Convert ...
*) ?
If your comments are nested, like in your example, you don’t need to escape them at all. The lexer keeps a stack of opened comments that allows it to support exactly what you’re doing here. If, for some reason, you really need to have only the closing part, I believe it’s not possible without either separating the two characters (something like *\)
or * )
or making the lexer see it as part of a string ("*)"
or {|*)|}}
).