diff options
author | 2021-06-24 08:34:28 -0700 | |
---|---|---|
committer | 2021-06-24 08:34:28 -0700 | |
commit | 11f1a30cdb59f9da0209798d2057f7afacbd9547 (patch) | |
tree | 7c9d8daaf844edde533e5d19744f64c258df4ad4 /Parser/pegen.c | |
parent | bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) (diff) | |
download | cpython-11f1a30cdb59f9da0209798d2057f7afacbd9547.tar.gz cpython-11f1a30cdb59f9da0209798d2057f7afacbd9547.tar.bz2 cpython-11f1a30cdb59f9da0209798d2057f7afacbd9547.zip |
bpo-44456: Improve the syntax error when mixing keyword and positional patterns (GH-26793)
(cherry picked from commit 0acc258fe6f0ec200ca2f6f9294adbf52a244802)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r-- | Parser/pegen.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c index 615047c1b6a..3472d489e06 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -1557,6 +1557,13 @@ _PyPegen_seq_last_item(asdl_seq *seq) return asdl_seq_GET_UNTYPED(seq, len - 1); } +void * +_PyPegen_seq_first_item(asdl_seq *seq) +{ + return asdl_seq_GET_UNTYPED(seq, 0); +} + + /* Creates a new name of the form <first_name>.<second_name> */ expr_ty _PyPegen_join_names_with_dot(Parser *p, expr_ty first_name, expr_ty second_name) |