File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,10 @@ impl MsSqlDialect {
169169 }
170170 } ;
171171
172+ let mut prior_statement_ended_with_semi_colon = false ;
172173 while let Token :: SemiColon = parser. peek_token_ref ( ) . token {
173174 parser. advance_token ( ) ;
175+ prior_statement_ended_with_semi_colon = true ;
174176 }
175177
176178 let mut else_block = None ;
@@ -201,6 +203,8 @@ impl MsSqlDialect {
201203 } ,
202204 } ) ;
203205 }
206+ } else if prior_statement_ended_with_semi_colon {
207+ parser. prev_token ( ) ;
204208 }
205209
206210 Ok ( Statement :: If ( IfStatement {
Original file line number Diff line number Diff line change @@ -4454,16 +4454,7 @@ impl<'a> Parser<'a> {
44544454 }
44554455 }
44564456 values.push(self.parse_statement()?);
4457-
4458- let semi_colon_expected = match values.last() {
4459- Some(Statement::If(if_statement)) => if_statement.end_token.is_some(),
4460- Some(_) => true,
4461- None => false,
4462- };
4463-
4464- if semi_colon_expected {
4465- self.expect_token(&Token::SemiColon)?;
4466- }
4457+ self.expect_token(&Token::SemiColon)?;
44674458 }
44684459 Ok(values)
44694460 }
You can’t perform that action at this time.
0 commit comments