Skip to content

Commit 06c3c63

Browse files
aljazerzenmsullivan
authored andcommitted
Tweak parser recovery (#8819)
Closes #8722 Fixes error message for: ``` START TRANSACTION ISOLATION REPEATABLEREAD, NOT DEFERRABLE; ^ Expected "SERIALIZABLE" ```
1 parent d52ae25 commit 06c3c63

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

edb/edgeql-parser/src/parser/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ fn injection_cost(kind: &Kind) -> u16 {
586586
// Manual keyword tweaks to encourage some error messages and discourage others.
587587
Keyword(keywords::Keyword(
588588
"delete" | "update" | "migration" | "role" | "global" | "administer" | "future"
589-
| "database", // | "if" | "group",
589+
| "database" | "serializable" | "REPEATABLE" | "NOT", // | "if" | "group",
590590
)) => 100,
591591
Keyword(keywords::Keyword("insert" | "module" | "extension" | "branch")) => 20,
592592
Keyword(keywords::Keyword("select" | "property" | "type")) => 10,

tests/test_edgeql_syntax.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6433,6 +6433,14 @@ def test_edgeql_syntax_transaction_06(self):
64336433
START TRANSACTION ISOLATION SERIALIZABLE, READ WRITE, NOT DEFERRABLE;
64346434
"""
64356435

6436+
@tb.must_fail(errors.EdgeQLSyntaxError,
6437+
r"Unexpected 'REPEATABLEREAD'",
6438+
line=2, col=37)
6439+
def test_edgeql_syntax_transaction_07(self):
6440+
"""
6441+
START TRANSACTION ISOLATION REPEATABLEREAD, NOT DEFERRABLE;
6442+
"""
6443+
64366444
def test_edgeql_syntax_describe_01(self):
64376445
"""
64386446
DESCRIBE SCHEMA AS DDL;

0 commit comments

Comments
 (0)