Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/pgt_statement_splitter/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down