Skip to main content

sql_comment_spans

Function sql_comment_spans 

Source
pub fn sql_comment_spans(sql: &str) -> Vec<(usize, usize)>
Expand description

(start, end) of every -- and /* */ comment in SQL.

Dataform leaves a ${...} inside these as text. A # comment is not one of them, nor is a -- inside a string. Quotes inside a comment do not open a string, and comment markers inside a string or a ${...} do not open a comment. An unterminated block comment runs to the end.