diff --git a/crates/pgt_statement_splitter/src/parser.rs b/crates/pgt_statement_splitter/src/parser.rs index c94fe245..58c0f976 100644 --- a/crates/pgt_statement_splitter/src/parser.rs +++ b/crates/pgt_statement_splitter/src/parser.rs @@ -162,18 +162,20 @@ impl Parser { } #[cfg(windows)] -/// Returns true if the token is relevant for the paring process +/// Returns true if the token is relevant for the parsing process /// /// On windows, a newline is represented by `\r\n` which is two characters. fn is_irrelevant_token(t: &Token) -> bool { WHITESPACE_TOKENS.contains(&t.kind) + // double new lines are relevant, single ones are not && (t.kind != SyntaxKind::Newline || t.text == "\r\n" || t.text.chars().count() == 1) } #[cfg(not(windows))] -/// Returns true if the token is relevant for the paring process +/// Returns true if the token is relevant for the parsing process fn is_irrelevant_token(t: &Token) -> bool { WHITESPACE_TOKENS.contains(&t.kind) + // double new lines are relevant, single ones are not && (t.kind != SyntaxKind::Newline || t.text.chars().count() == 1) }