Skip to content

Commit b0869d1

Browse files
committed
Simplify logic to have GO terminate a statement
1 parent f02867c commit b0869d1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/parser/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,6 @@ impl<'a> Parser<'a> {
495495
if expecting_statement_delimiter && word.keyword == Keyword::END {
496496
break;
497497
}
498-
// Treat batch delimiter as an end of statement
499-
if expecting_statement_delimiter && dialect_of!(self is MsSqlDialect) {
500-
if let Some(Statement::Go(GoStatement { count: _ })) = stmts.last() {
501-
expecting_statement_delimiter = false;
502-
}
503-
}
504498
}
505499
_ => {}
506500
}
@@ -517,6 +511,8 @@ impl<'a> Parser<'a> {
517511
// parsing the statement sequence consumes the statement delimiter, so it shouldn't be expected here
518512
ConditionalStatements::Sequence { .. } => false,
519513
},
514+
// Treat batch delimiter as an end of statement, so no additional statement delimiter expected here
515+
Statement::Go(_) => false,
520516
_ => true,
521517
};
522518
stmts.push(statement);

0 commit comments

Comments
 (0)