Skip to main content

block_comment

Function block_comment 

Source
pub fn block_comment(text: &str) -> String
Expand description

A comment in the block form, ready to stand on its own lines.

One line of text is written /* text */. Several lines are written with the first after the opening /* , each line after it indented three spaces so it lines up under the first, and the closing */ at the end of the last. An empty line of text stays empty.

The text cannot end the comment early or open another. */ in it is written * /, and /* is written / *, because SQL Server and PostgreSQL nest block comments and a stray /* would hide the rest of the script. Every comment opens with /* and a space, so it is never read as MySQL’s /*! or an optimizer hint’s /*+.

Trailing spaces are dropped from each line, and so are empty lines at the start and the end.