From 55f79a3233eecca5b61e1734c7a3165723c702d2 Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 15 Apr 2025 09:30:37 +0200 Subject: [PATCH] chore: add double newline comment --- crates/pgt_statement_splitter/src/parser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) }