Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit 126652b

Browse files
committed
Fix decorator ranges
Incorrectly merged LALRPOP file
1 parent 57e8712 commit 126652b

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

parser/src/python.lalrpop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ WithItem<Goal>: ast::WithItem = {
966966
};
967967

968968
FuncDef: ast::Stmt = {
969-
<decorator_list:Decorator*> <location:@L> <is_async:"async"?> "def" <name:Identifier> <type_params:TypeParamList?> <args:Parameters> <r:("->" <Test<"all">>)?> ":" <body:Suite> => {
969+
<location:@L> <decorator_list:Decorator*> <is_async:"async"?> "def" <name:Identifier> <type_params:TypeParamList?> <args:Parameters> <r:("->" <Test<"all">>)?> ":" <body:Suite> => {
970970
let args = Box::new(args);
971971
let returns = r.map(|x| Box::new(x));
972972
let end_location = body.last().unwrap().end();
@@ -1152,7 +1152,7 @@ KwargParameter<ArgType>: Option<Box<ast::Arg>> = {
11521152
};
11531153

11541154
ClassDef: ast::Stmt = {
1155-
<decorator_list:Decorator*> <location:@L> "class" <name:Identifier> <type_params:TypeParamList?> <a:("(" ArgumentList ")")?> ":" <body:Suite> => {
1155+
<location:@L> <decorator_list:Decorator*> "class" <name:Identifier> <type_params:TypeParamList?> <a:("(" ArgumentList ")")?> ":" <body:Suite> => {
11561156
let (bases, keywords) = match a {
11571157
Some((_, arg, _)) => (arg.args, arg.keywords),
11581158
None => (vec![], vec![]),

parser/src/python.rs

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

parser/src/snapshots/rustpython_parser__parser__tests__decorator_ranges.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)