@@ -648,18 +648,18 @@ invalid_named_expression:
648648 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
649649 a, "cannot use assignment expressions with %s", _PyPegen_get_expr_name(a)) }
650650invalid_assignment:
651- | a=list ':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not list) can be annotated") }
652- | a=tuple ':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not tuple) can be annotated") }
653- | a=star_named_expression ',' star_named_expressions* ':' {
651+ | a=list ':' expression { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not list) can be annotated") }
652+ | a=tuple ':' expression { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not tuple) can be annotated") }
653+ | a=star_named_expression ',' star_named_expressions* ':' expression {
654654 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "only single target (not tuple) can be annotated") }
655- | a=expression ':' expression ['=' annotated_rhs] {
655+ | a=expression ':' expression {
656656 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "illegal target for annotation") }
657657 | (star_targets '=')* a=star_expressions '=' {
658658 RAISE_SYNTAX_ERROR_INVALID_TARGET(STAR_TARGETS, a) }
659659 | (star_targets '=')* a=yield_expr '=' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "assignment to yield expression not possible") }
660660 | a=star_expressions augassign (yield_expr | star_expressions) {
661661 RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
662- a,
662+ a,
663663 "'%s' is an illegal expression for augmented assignment",
664664 _PyPegen_get_expr_name(a)
665665 )}
0 commit comments