summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>2022-08-12 17:27:50 (GMT)
committerGitHub <noreply@github.com>2022-08-12 17:27:50 (GMT)
commitb5e3ea286289fcad12be78480daf3756e350f69f (patch)
treecbe1dd02a951509837c0136cfc78d9f0f0332931 /Grammar
parentd2373fcb498888e3faa47747a57791f0ed82c91e (diff)
downloadcpython-b5e3ea286289fcad12be78480daf3756e350f69f.zip
cpython-b5e3ea286289fcad12be78480daf3756e350f69f.tar.gz
cpython-b5e3ea286289fcad12be78480daf3756e350f69f.tar.bz2
gh-94996: Disallow parsing pos only params with feature_version < (3, 8) (GH-94997)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram4
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 6a81e14..afae85d 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -287,9 +287,9 @@ params[arguments_ty]:
parameters[arguments_ty]:
| a=slash_no_default b[asdl_arg_seq*]=param_no_default* c=param_with_default* d=[star_etc] {
- _PyPegen_make_arguments(p, a, NULL, b, c, d) }
+ CHECK_VERSION(arguments_ty, 8, "Positional-only parameters are", _PyPegen_make_arguments(p, a, NULL, b, c, d)) }
| a=slash_with_default b=param_with_default* c=[star_etc] {
- _PyPegen_make_arguments(p, NULL, a, NULL, b, c) }
+ CHECK_VERSION(arguments_ty, 8, "Positional-only parameters are", _PyPegen_make_arguments(p, NULL, a, NULL, b, c)) }
| a[asdl_arg_seq*]=param_no_default+ b=param_with_default* c=[star_etc] {
_PyPegen_make_arguments(p, NULL, NULL, a, b, c) }
| a=param_with_default+ b=[star_etc] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)}