summaryrefslogtreecommitdiffstats
path: root/Grammar/python.gram
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-07-16 12:20:09 (GMT)
committerGitHub <noreply@github.com>2021-07-16 12:20:09 (GMT)
commita283ef116ba909f133a8e16bb8d17d9e613831d8 (patch)
treecacad715248c7ca2b4a7a04fff470763653e0864 /Grammar/python.gram
parent000e70ad5246732fcbd27cf59268185cbd5ad734 (diff)
downloadcpython-a283ef116ba909f133a8e16bb8d17d9e613831d8.zip
cpython-a283ef116ba909f133a8e16bb8d17d9e613831d8.tar.gz
cpython-a283ef116ba909f133a8e16bb8d17d9e613831d8.tar.bz2
Remove unnecessary 'invalid_primary' rule in the parser (GH-27186)
Diffstat (limited to 'Grammar/python.gram')
-rw-r--r--Grammar/python.gram3
1 files changed, 0 insertions, 3 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 6b2fa6a..70d0912 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -666,7 +666,6 @@ await_primary[expr_ty] (memo):
| AWAIT a=primary { CHECK_VERSION(expr_ty, 5, "Await expressions are", _PyAST_Await(a, EXTRA)) }
| primary
primary[expr_ty]:
- | invalid_primary # must be before 'primay genexp' because of invalid_genexp
| a=primary '.' b=NAME { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) }
| a=primary b=genexp { _PyAST_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) }
| a=primary '(' b=[arguments] ')' {
@@ -893,8 +892,6 @@ invalid_del_stmt:
RAISE_SYNTAX_ERROR_INVALID_TARGET(DEL_TARGETS, a) }
invalid_block:
| NEWLINE !INDENT { RAISE_INDENTATION_ERROR("expected an indented block") }
-invalid_primary:
- | primary a='{' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "invalid syntax") }
invalid_comprehension:
| ('[' | '(' | '{') a=starred_expression for_if_clauses {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "iterable unpacking cannot be used in comprehension") }