mirror of https://github.com/python/cpython
bpo-40334: Correct return value of func_type_comment (GH-19833)
This commit is contained in:
parent
ea7297cf8f
commit
d955241469
|
@ -210,7 +210,7 @@ function_def_raw[stmt_ty]:
|
||||||
(params) ? params : CHECK(_PyPegen_empty_arguments(p)),
|
(params) ? params : CHECK(_PyPegen_empty_arguments(p)),
|
||||||
b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA)
|
b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA)
|
||||||
) }
|
) }
|
||||||
func_type_comment[PyObject*]:
|
func_type_comment[Token*]:
|
||||||
| NEWLINE t=TYPE_COMMENT &(NEWLINE INDENT) { t } # Must be followed by indented block
|
| NEWLINE t=TYPE_COMMENT &(NEWLINE INDENT) { t } # Must be followed by indented block
|
||||||
| invalid_double_type_comments
|
| invalid_double_type_comments
|
||||||
| TYPE_COMMENT
|
| TYPE_COMMENT
|
||||||
|
|
|
@ -408,7 +408,7 @@ static stmt_ty return_stmt_rule(Parser *p);
|
||||||
static stmt_ty raise_stmt_rule(Parser *p);
|
static stmt_ty raise_stmt_rule(Parser *p);
|
||||||
static stmt_ty function_def_rule(Parser *p);
|
static stmt_ty function_def_rule(Parser *p);
|
||||||
static stmt_ty function_def_raw_rule(Parser *p);
|
static stmt_ty function_def_raw_rule(Parser *p);
|
||||||
static PyObject* func_type_comment_rule(Parser *p);
|
static Token* func_type_comment_rule(Parser *p);
|
||||||
static arguments_ty params_rule(Parser *p);
|
static arguments_ty params_rule(Parser *p);
|
||||||
static arguments_ty parameters_rule(Parser *p);
|
static arguments_ty parameters_rule(Parser *p);
|
||||||
static asdl_seq* slash_no_default_rule(Parser *p);
|
static asdl_seq* slash_no_default_rule(Parser *p);
|
||||||
|
@ -3679,13 +3679,13 @@ function_def_raw_rule(Parser *p)
|
||||||
// | NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
|
// | NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
|
||||||
// | invalid_double_type_comments
|
// | invalid_double_type_comments
|
||||||
// | TYPE_COMMENT
|
// | TYPE_COMMENT
|
||||||
static PyObject*
|
static Token*
|
||||||
func_type_comment_rule(Parser *p)
|
func_type_comment_rule(Parser *p)
|
||||||
{
|
{
|
||||||
if (p->error_indicator) {
|
if (p->error_indicator) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
PyObject* res = NULL;
|
Token* res = NULL;
|
||||||
int mark = p->mark;
|
int mark = p->mark;
|
||||||
{ // NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
|
{ // NEWLINE TYPE_COMMENT &(NEWLINE INDENT)
|
||||||
Token * newline_var;
|
Token * newline_var;
|
||||||
|
|
Loading…
Reference in New Issue