bpo-40903: Handle multiple '=' in invalid assignment rules in the PEG parser (GH-20697)



Automerge-Triggered-By: @pablogsal
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 4df5535..f41426a 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -63,6 +63,10 @@
 Traceback (most recent call last):
 SyntaxError: cannot assign to function call
 
+>>> yield = 1
+Traceback (most recent call last):
+SyntaxError: assignment to yield expression not possible
+
 >>> del f()
 Traceback (most recent call last):
 SyntaxError: cannot delete function call
@@ -136,6 +140,18 @@
 Traceback (most recent call last):
 SyntaxError: cannot assign to conditional expression
 
+>>> True = True = 3
+Traceback (most recent call last):
+SyntaxError: cannot assign to True
+
+>>> x = y = True = z = 3
+Traceback (most recent call last):
+SyntaxError: cannot assign to True
+
+>>> x = y = yield = 1
+Traceback (most recent call last):
+SyntaxError: assignment to yield expression not possible
+
 >>> a, b += 1, 2
 Traceback (most recent call last):
 SyntaxError: 'tuple' is an illegal expression for augmented assignment
@@ -148,6 +164,10 @@
 Traceback (most recent call last):
 SyntaxError: 'list' is an illegal expression for augmented assignment
 
+>>> p = p =
+Traceback (most recent call last):
+SyntaxError: invalid syntax
+
 From compiler_complex_args():
 
 >>> def f(None=1):
@@ -155,7 +175,6 @@
 Traceback (most recent call last):
 SyntaxError: invalid syntax
 
-
 From ast_for_arguments():
 
 >>> def f(x, y=1, z):