File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
crates/pgt_statement_splitter/src/splitter Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ pub fn source(p: &mut Splitter) -> Result<(), SplitterException> {
4646pub ( 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}
You can’t perform that action at this time.
0 commit comments