summaryrefslogtreecommitdiffstats
path: root/Parser/pegen.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-06-24 15:09:57 (GMT)
committerGitHub <noreply@github.com>2021-06-24 15:09:57 (GMT)
commit0acc258fe6f0ec200ca2f6f9294adbf52a244802 (patch)
treecf584ea88a0cbe1c7518fe7436ad3521335b7554 /Parser/pegen.c
parentb19f45533942e4ad7ddf9d2d94f8b87c6f746bce (diff)
downloadcpython-0acc258fe6f0ec200ca2f6f9294adbf52a244802.zip
cpython-0acc258fe6f0ec200ca2f6f9294adbf52a244802.tar.gz
cpython-0acc258fe6f0ec200ca2f6f9294adbf52a244802.tar.bz2
bpo-44456: Improve the syntax error when mixing keyword and positional patterns (GH-26793)
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r--Parser/pegen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 615047c..3472d48 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)