Skip to content

Commit 926de5d

Browse files
readied
1 parent 4b87786 commit 926de5d

File tree

1 file changed

+5
-7
lines changed
  • crates/pgt_statement_splitter/src/splitter

1 file changed

+5
-7
lines changed

crates/pgt_statement_splitter/src/splitter/common.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ pub fn source(p: &mut Splitter) -> Result<(), SplitterException> {
4646
pub(crate) fn statement(p: &mut Splitter) -> Result<(), SplitterException> {
4747
p.start_stmt();
4848

49-
let result = match p.current() {
49+
// Currently, Err means that we reached EOF.
50+
// Regardless of whether we reach EOF or we complete the statement, we want to close it.
51+
// We might want to handle other kinds of errors differently in the future.
52+
let _ = match p.current() {
5053
SyntaxKind::WITH_KW => cte(p),
5154
SyntaxKind::SELECT_KW => select(p),
5255
SyntaxKind::INSERT_KW => insert(p),
@@ -57,12 +60,7 @@ pub(crate) fn statement(p: &mut Splitter) -> Result<(), SplitterException> {
5760
_ => unknown(p, &[]),
5861
};
5962

60-
// Currently, Err means that we reached EOF.
61-
// Regardless of whether we reach EOF or we complete the statement, we want to close it.
62-
// We might want to handle other kinds of errors differently in the future.
63-
match result {
64-
_ => p.close_stmt(),
65-
};
63+
p.close_stmt();
6664

6765
Ok(())
6866
}

0 commit comments

Comments
 (0)