Skip to content

Commit 7101e92

Browse files
committed
Update python.lalrpop
1 parent 385c522 commit 7101e92

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

parser/src/python.lalrpop

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,19 +1174,19 @@ TypeParamList: Vec<ast::TypeParam> = {
11741174
};
11751175

11761176
TypeParam: ast::TypeParam = {
1177-
<location:@L> <name:Identifier> <bound:(":" <Test<"all">>)?> <end_location:@R> => {
1177+
<location:@L> <name:Identifier> <bound:(":" <Test<"all">>)?> <default:("=" <Test<"all">>)?> <end_location:@R> => {
11781178
ast::TypeParam::TypeVar(
1179-
ast::TypeParamTypeVar { name, bound: bound.map(Box::new), range: (location..end_location).into() }
1179+
ast::TypeParamTypeVar { name, bound: bound.map(Box::new), default_value: default.map(Box::new), range: (location..end_location).into() }
11801180
)
11811181
},
1182-
<location:@L> "*" <name:Identifier> <end_location:@R> => {
1182+
<location:@L> "*" <name:Identifier> <default:("=" <Test<"all">>)?> <end_location:@R> => {
11831183
ast::TypeParam::TypeVarTuple(
1184-
ast::TypeParamTypeVarTuple { name, range: (location..end_location).into() }
1184+
ast::TypeParamTypeVarTuple { name, default_value: default.map(Box::new), range: (location..end_location).into() }
11851185
)
11861186
},
1187-
<location:@L> "**" <name:Identifier> <end_location:@R> => {
1187+
<location:@L> "**" <name:Identifier> <default:("=" <Test<"all">>)?> <end_location:@R> => {
11881188
ast::TypeParam::ParamSpec(
1189-
ast::TypeParamParamSpec { name, range: (location..end_location).into() }
1189+
ast::TypeParamParamSpec { name, default_value: default.map(Box::new), range: (location..end_location).into() }
11901190
)
11911191
}
11921192
};

0 commit comments

Comments
 (0)