Skip to content

Commit c6001fe

Browse files
chore: add double newline comment (#341)
1 parent 37137bc commit c6001fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/pgt_statement_splitter/src/parser.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,20 @@ impl Parser {
165165
}
166166

167167
#[cfg(windows)]
168-
/// Returns true if the token is relevant for the paring process
168+
/// Returns true if the token is relevant for the parsing process
169169
///
170170
/// On windows, a newline is represented by `\r\n` which is two characters.
171171
fn is_irrelevant_token(t: &Token) -> bool {
172172
WHITESPACE_TOKENS.contains(&t.kind)
173+
// double new lines are relevant, single ones are not
173174
&& (t.kind != SyntaxKind::Newline || t.text == "\r\n" || t.text.chars().count() == 1)
174175
}
175176

176177
#[cfg(not(windows))]
177-
/// Returns true if the token is relevant for the paring process
178+
/// Returns true if the token is relevant for the parsing process
178179
fn is_irrelevant_token(t: &Token) -> bool {
179180
WHITESPACE_TOKENS.contains(&t.kind)
181+
// double new lines are relevant, single ones are not
180182
&& (t.kind != SyntaxKind::Newline || t.text.chars().count() == 1)
181183
}
182184

0 commit comments

Comments
 (0)