Skip to content

Commit 514b141

Browse files
authored
Merge pull request #179 from codefori/fix/parser_delcare_block
Fix issue with DECLARE blocks not being considered
2 parents 6c89ac0 + b68a359 commit 514b141

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/language/sql/statement.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export default class Statement {
4141
return true;
4242
}
4343

44-
if (this.type === StatementType.Create) {
44+
// These statements can end with BEGIN, which signifies a block starter
45+
if ([StatementType.Create, StatementType.Declare].includes(this.type)) {
4546
const last = this.tokens[this.tokens.length-1];
4647
if (tokenIs(last, `keyword`, `BEGIN`)) {
4748
return true;

0 commit comments

Comments
 (0)