Skip to content

Commit ba0675d

Browse files
committed
Simplify logic to have GO terminate a statement
1 parent 3e4df37 commit ba0675d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/parser/mod.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,6 @@ impl<'a> Parser<'a> {
475475
if expecting_statement_delimiter && word.keyword == Keyword::END {
476476
break;
477477
}
478-
// Treat batch delimiter as an end of statement
479-
if expecting_statement_delimiter && dialect_of!(self is MsSqlDialect) {
480-
if let Some(Statement::Go(GoStatement { count: _ })) = stmts.last() {
481-
expecting_statement_delimiter = false;
482-
}
483-
}
484478
}
485479
_ => {}
486480
}
@@ -497,6 +491,8 @@ impl<'a> Parser<'a> {
497491
// parsing the statement sequence consumes the statement delimiter, so it shouldn't be expected here
498492
ConditionalStatements::Sequence { .. } => false,
499493
},
494+
// Treat batch delimiter as an end of statement, so no additional statement delimiter expected here
495+
Statement::Go(_) => false,
500496
_ => true,
501497
};
502498
stmts.push(statement);

0 commit comments

Comments
 (0)