diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2021-04-29 05:58:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 05:58:44 (GMT) |
commit | 1e7b858575d0ad782939f86aae4a2fa1c29e9f14 (patch) | |
tree | 9445a7a82905c5bb253564853f33dacfceac6e93 /Parser/pegen.h | |
parent | e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f (diff) | |
download | cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.zip cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.tar.gz cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.tar.bz2 |
bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Diffstat (limited to 'Parser/pegen.h')
-rw-r--r-- | Parser/pegen.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Parser/pegen.h b/Parser/pegen.h index a8142a0..2af551b 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -87,6 +87,11 @@ typedef struct { } KeyValuePair; typedef struct { + expr_ty key; + pattern_ty pattern; +} KeyPatternPair; + +typedef struct { arg_ty arg; expr_ty value; } NameDefaultPair; @@ -259,6 +264,9 @@ expr_ty _PyPegen_set_expr_context(Parser *, expr_ty, expr_context_ty); KeyValuePair *_PyPegen_key_value_pair(Parser *, expr_ty, expr_ty); asdl_expr_seq *_PyPegen_get_keys(Parser *, asdl_seq *); asdl_expr_seq *_PyPegen_get_values(Parser *, asdl_seq *); +KeyPatternPair *_PyPegen_key_pattern_pair(Parser *, expr_ty, pattern_ty); +asdl_expr_seq *_PyPegen_get_pattern_keys(Parser *, asdl_seq *); +asdl_pattern_seq *_PyPegen_get_patterns(Parser *, asdl_seq *); NameDefaultPair *_PyPegen_name_default_pair(Parser *, arg_ty, expr_ty, Token *); SlashWithDefault *_PyPegen_slash_with_default(Parser *, asdl_arg_seq *, asdl_seq *); StarEtc *_PyPegen_star_etc(Parser *, arg_ty, asdl_seq *, arg_ty); @@ -275,6 +283,7 @@ expr_ty _PyPegen_collect_call_seqs(Parser *, asdl_expr_seq *, asdl_seq *, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena); expr_ty _PyPegen_concatenate_strings(Parser *p, asdl_seq *); +expr_ty _PyPegen_ensure_imaginary(Parser *p, expr_ty); asdl_seq *_PyPegen_join_sequences(Parser *, asdl_seq *, asdl_seq *); int _PyPegen_check_barry_as_flufl(Parser *, Token *); mod_ty _PyPegen_make_module(Parser *, asdl_stmt_seq *); |