canTripleQuote

private fnbool canTripleQuote(string s, char q) @safe pure

Checks whether content can be written verbatim as a triple-quoted string.

The lexer requires a newline between the delimiters, an embedded delimiter run (or a trailing quote) would terminate the literal early, and `${...}` would be substituted on re-parse.

Parameters

sThe string content
qThe quote character of the style

Returns

true if the content is safe for triple-quoting.