@@ -646,18 +646,18 @@ invalid_named_expression:
646646 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
647647 a, "cannot use assignment expressions with %s", _PyPegen_get_expr_name(a)) }
648648invalid_assignment:
649- | a=list ':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not list) can be annotated") }
650- | a=tuple ':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not tuple) can be annotated") }
651- | a=star_named_expression ',' star_named_expressions* ':' {
649+ | a=list ':' expression { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not list) can be annotated") }
650+ | a=tuple ':' expression { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not tuple) can be annotated") }
651+ | a=star_named_expression ',' star_named_expressions* ':' expression {
652652 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not tuple) can be annotated") }
653- | a=expression ':' expression ['=' annotated_rhs] {
653+ | a=expression ':' expression {
654654 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "illegal target for annotation") }
655655 | (star_targets '=')* a=star_expressions '=' {
656656 RAISE_SYNTAX_ERROR_INVALID_TARGET(STAR_TARGETS, a) }
657657 | (star_targets '=')* a=yield_expr '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "assignment to yield expression not possible") }
658658 | a=star_expressions augassign (yield_expr | star_expressions) {
659659 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
660- a,
660+ a,
661661 "'%s' is an illegal expression for augmented assignment",
662662 _PyPegen_get_expr_name(a)
663663 )}
0 commit comments