bpo-40334: Improve column offsets for thrown syntax errors by Pegen (GH-19782)

This commit is contained in:
Batuhan Taskaya 2020-05-01 16:13:43 +03:00 committed by GitHub
parent 719e14d283
commit 76c1b4d5c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 112 deletions

View file

@ -609,7 +609,7 @@ invalid_assignment:
| expression ':' expression ['=' annotated_rhs] {
RAISE_SYNTAX_ERROR("illegal target for annotation") }
| a=expression ('=' | augassign) (yield_expr | star_expressions) {
RAISE_SYNTAX_ERROR("cannot assign to %s", _PyPegen_get_expr_name(a)) }
RAISE_SYNTAX_ERROR_NO_COL_OFFSET("cannot assign to %s", _PyPegen_get_expr_name(a)) }
invalid_block:
| NEWLINE !INDENT { RAISE_INDENTATION_ERROR("expected an indented block") }
invalid_comprehension: