Skip to content

Commit d902de2

Browse files
committed
Fix regression with BEGIN..END and BigQuery
1 parent b984abe commit d902de2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/parser.pegjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ program
6464

6565
statement
6666
= non_transaction_statement
67-
/ transaction_statement // math BEGIN transaction after BEGIN..END block
67+
/ transaction_statement // match BEGIN transaction after BEGIN..END block
6868
/ &{ return isAcceptUnsupportedGrammar(); } x:unsupported_grammar_stmt { return x; }
6969

7070
// This is referenced by BEGIN..END blocks of FUNCTION definitions,
@@ -198,8 +198,10 @@ inner_program
198198
});
199199
}
200200

201+
// BigQuery allows transactions inside BEGIN..END blocks, Postgres doesn't allow it.
201202
inner_program_statement
202-
= non_transaction_statement
203+
= &postgres x:non_transaction_statement { return x; }
204+
/ &bigquery x:statement { return x; }
203205
/ &postgres x:return_stmt { return x; }
204206

205207
/**

0 commit comments

Comments
 (0)