Skip to main content

has_blank_line_between

Function has_blank_line_between 

Source
pub fn has_blank_line_between(source: &str, from: usize, to: usize) -> bool
Expand description

Returns true if there is a blank line (a line containing only whitespace) in source strictly between byte offsets from (inclusive) and to (exclusive). Used by the parser to detect orphan doc blocks.

A doc-block token’s span ends just past the closing-marker line’s terminating newline. So if the next declaration begins on the immediately following line, the substring between contains no newline (only optional indentation). Any newline in the substring therefore implies at least one entirely-blank line separating the doc from the declaration.