diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2020-05-06 18:11:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 18:11:04 (GMT) |
commit | 999ec9ab6af536cc2666a0847ec02331aaf00416 (patch) | |
tree | ee895da1c75a6887f0c8b305ea0704acc3537c54 /Parser | |
parent | b7aa23d29fa48238dab3692d02e1f0a7e8a5af9c (diff) | |
download | cpython-999ec9ab6af536cc2666a0847ec02331aaf00416.zip cpython-999ec9ab6af536cc2666a0847ec02331aaf00416.tar.gz cpython-999ec9ab6af536cc2666a0847ec02331aaf00416.tar.bz2 |
bpo-40334: Add type to the assignment rule in the grammar file (GH-19963)
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/pegen/parse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index 55605d5..3b518ee 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -378,7 +378,7 @@ static asdl_seq* statement_newline_rule(Parser *p); static asdl_seq* simple_stmt_rule(Parser *p); static stmt_ty small_stmt_rule(Parser *p); static stmt_ty compound_stmt_rule(Parser *p); -static void *assignment_rule(Parser *p); +static stmt_ty assignment_rule(Parser *p); static AugOperator* augassign_rule(Parser *p); static stmt_ty global_stmt_rule(Parser *p); static stmt_ty nonlocal_stmt_rule(Parser *p); @@ -1256,7 +1256,7 @@ small_stmt_rule(Parser *p) int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro { // assignment - void *assignment_var; + stmt_ty assignment_var; if ( (assignment_var = assignment_rule(p)) ) @@ -1586,13 +1586,13 @@ compound_stmt_rule(Parser *p) // | ((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT? // | target augassign (yield_expr | star_expressions) // | invalid_assignment -static void * +static stmt_ty assignment_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + stmt_ty res = NULL; int mark = p->mark; if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { p->error_indicator = 1; |