Skip to content

Commit 7516c42

Browse files
committed
Move type_param stubs into LALRPOP definition
1 parent 3617a6c commit 7516c42

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

parser/src/python.lalrpop

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,10 +970,11 @@ FuncDef: ast::Stmt = {
970970
let returns = r.map(|x| Box::new(x));
971971
let end_location = body.last().unwrap().end();
972972
let type_comment = None;
973+
let type_params = Vec::new();
973974
if is_async.is_some() {
974-
ast::StmtAsyncFunctionDef { name, args, body, decorator_list, returns, type_comment, range: (location..end_location).into() }.into()
975+
ast::StmtAsyncFunctionDef { name, args, body, decorator_list, returns, type_comment, type_params, range: (location..end_location).into() }.into()
975976
} else {
976-
ast::StmtFunctionDef { name, args, body, decorator_list, returns, type_comment, range: (location..end_location).into() }.into()
977+
ast::StmtFunctionDef { name, args, body, decorator_list, returns, type_comment, type_params, range: (location..end_location).into() }.into()
977978
}
978979
},
979980
};
@@ -1131,13 +1132,15 @@ ClassDef: ast::Stmt = {
11311132
None => (vec![], vec![]),
11321133
};
11331134
let end_location = body.last().unwrap().end();
1135+
let type_params = Vec::new();
11341136
ast::Stmt::ClassDef(
11351137
ast::StmtClassDef {
11361138
name,
11371139
bases,
11381140
keywords,
11391141
body,
11401142
decorator_list,
1143+
type_params,
11411144
range: (location..end_location).into()
11421145
},
11431146
)

parser/src/python.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)