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>
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 @@
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)