mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-11 12:56:38 +00:00
Rename Parameter#arg
and ParameterWithDefault#def
fields (#6255)
## Summary This PR renames... - `Parameter#arg` to `Parameter#name` - `ParameterWithDefault#def` to `ParameterWithDefault#parameter` (such that `ParameterWithDefault` has a `default` and a `parameter`) ## Test Plan `cargo test`
This commit is contained in:
parent
adc8bb7821
commit
9c708d8fc1
56 changed files with 268 additions and 260 deletions
|
@ -1138,33 +1138,33 @@ ParameterDef<ParameterType>: ast::ParameterWithDefault = {
|
|||
|
||||
UntypedParameter: ast::ParameterWithDefault = {
|
||||
<location:@L> <arg:Identifier> <end_location:@R> => {
|
||||
let def = ast::Parameter { arg, annotation: None, range: (location..end_location).into() };
|
||||
ast::ParameterWithDefault { def, default: None, range: (location..end_location).into() }
|
||||
let def = ast::Parameter { name:arg, annotation: None, range: (location..end_location).into() };
|
||||
ast::ParameterWithDefault { parameter:def, default: None, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
StarUntypedParameter: ast::Parameter = {
|
||||
<location:@L> <arg:Identifier> <end_location:@R> => ast::Parameter { arg, annotation: None, range: (location..end_location).into() },
|
||||
<location:@L> <arg:Identifier> <end_location:@R> => ast::Parameter { name:arg, annotation: None, range: (location..end_location).into() },
|
||||
};
|
||||
|
||||
TypedParameter: ast::ParameterWithDefault = {
|
||||
<location:@L> <arg:Identifier> <a:(":" <Test<"all">>)?> <end_location:@R> => {
|
||||
let annotation = a.map(Box::new);
|
||||
let def = ast::Parameter { arg, annotation, range: (location..end_location).into() };
|
||||
ast::ParameterWithDefault { def, default: None, range: (location..end_location).into() }
|
||||
let def = ast::Parameter { name:arg, annotation, range: (location..end_location).into() };
|
||||
ast::ParameterWithDefault { parameter:def, default: None, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
|
||||
StarTypedParameter: ast::Parameter = {
|
||||
<location:@L> <arg:Identifier> <a:(":" <TestOrStarExpr>)?> <end_location:@R> => {
|
||||
let annotation = a.map(Box::new);
|
||||
ast::Parameter { arg, annotation, range: (location..end_location).into() }
|
||||
ast::Parameter { name:arg, annotation, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
|
||||
DoubleStarTypedParameter: ast::Parameter = {
|
||||
<location:@L> <arg:Identifier> <a:(":" <Test<"all">>)?> <end_location:@R> => {
|
||||
let annotation = a.map(Box::new);
|
||||
ast::Parameter { arg, annotation, range: (location..end_location).into() }
|
||||
ast::Parameter { name:arg, annotation, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue