mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
Rename Arguments
to Parameters
in the AST (#6253)
## Summary This PR renames a few AST nodes for clarity: - `Arguments` is now `Parameters` - `Arg` is now `Parameter` - `ArgWithDefault` is now `ParameterWithDefault` For now, the attribute names that reference `Parameters` directly are changed (e.g., on `StmtFunctionDef`), but the attributes on `Parameters` itself are not (e.g., `vararg`). We may revisit that decision in the future. For context, the AST node formerly known as `Arguments` is used in function definitions. Formally (outside of the Python context), "arguments" typically refers to "the values passed to a function", while "parameters" typically refers to "the variables used in a function definition". E.g., if you Google "arguments vs parameters", you'll get some explanation like: > A parameter is a variable in a function definition. It is a placeholder and hence does not have a concrete value. An argument is a value passed during function invocation. We're thus deviating from Python's nomenclature in favor of a scheme that we find to be more precise.
This commit is contained in:
parent
a82eb9544c
commit
adc8bb7821
102 changed files with 2585 additions and 2529 deletions
|
@ -12,7 +12,7 @@ pub(crate) struct ArgumentList {
|
|||
}
|
||||
|
||||
// Perform validation of function/lambda arguments in a function definition.
|
||||
pub(crate) fn validate_arguments(arguments: &ast::Arguments) -> Result<(), LexicalError> {
|
||||
pub(crate) fn validate_arguments(arguments: &ast::Parameters) -> Result<(), LexicalError> {
|
||||
let mut all_arg_names = FxHashSet::with_capacity_and_hasher(
|
||||
arguments.posonlyargs.len()
|
||||
+ arguments.args.len()
|
||||
|
@ -26,8 +26,8 @@ pub(crate) fn validate_arguments(arguments: &ast::Arguments) -> Result<(), Lexic
|
|||
let args = arguments.args.iter();
|
||||
let kwonlyargs = arguments.kwonlyargs.iter();
|
||||
|
||||
let vararg: Option<&ast::Arg> = arguments.vararg.as_deref();
|
||||
let kwarg: Option<&ast::Arg> = arguments.kwarg.as_deref();
|
||||
let vararg: Option<&ast::Parameter> = arguments.vararg.as_deref();
|
||||
let kwarg: Option<&ast::Parameter> = arguments.kwarg.as_deref();
|
||||
|
||||
for arg in posonlyargs
|
||||
.chain(args)
|
||||
|
@ -50,7 +50,10 @@ pub(crate) fn validate_arguments(arguments: &ast::Arguments) -> Result<(), Lexic
|
|||
}
|
||||
|
||||
pub(crate) fn validate_pos_params(
|
||||
args: &(Vec<ast::ArgWithDefault>, Vec<ast::ArgWithDefault>),
|
||||
args: &(
|
||||
Vec<ast::ParameterWithDefault>,
|
||||
Vec<ast::ParameterWithDefault>,
|
||||
),
|
||||
) -> Result<(), LexicalError> {
|
||||
let (posonlyargs, args) = args;
|
||||
#[allow(clippy::skip_while_next)]
|
||||
|
|
|
@ -1015,9 +1015,9 @@ FuncDef: ast::Stmt = {
|
|||
let returns = r.map(Box::new);
|
||||
let end_location = body.last().unwrap().end();
|
||||
if is_async.is_some() {
|
||||
ast::StmtAsyncFunctionDef { name, args, body, decorator_list, returns, type_params: type_params.unwrap_or_default(), range: (location..end_location).into() }.into()
|
||||
ast::StmtAsyncFunctionDef { name, parameters:args, body, decorator_list, returns, type_params: type_params.unwrap_or_default(), range: (location..end_location).into() }.into()
|
||||
} else {
|
||||
ast::StmtFunctionDef { name, args, body, decorator_list, returns, type_params: type_params.unwrap_or_default(), range: (location..end_location).into() }.into()
|
||||
ast::StmtFunctionDef { name, parameters:args, body, decorator_list, returns, type_params: type_params.unwrap_or_default(), range: (location..end_location).into() }.into()
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1041,13 +1041,13 @@ TypeAliasStatement: ast::Stmt = {
|
|||
},
|
||||
};
|
||||
|
||||
Parameters: ast::Arguments = {
|
||||
Parameters: ast::Parameters = {
|
||||
<location:@L> "(" <a: (ParameterList<TypedParameter, StarTypedParameter, DoubleStarTypedParameter>)?> ")" <end_location:@R> =>? {
|
||||
a.as_ref().map(validate_arguments).transpose()?;
|
||||
|
||||
let range = (location..end_location).into();
|
||||
let args = a
|
||||
.map_or_else(|| ast::Arguments::empty(range), |mut arguments| {
|
||||
.map_or_else(|| ast::Parameters::empty(range), |mut arguments| {
|
||||
arguments.range = range;
|
||||
arguments
|
||||
});
|
||||
|
@ -1058,15 +1058,15 @@ Parameters: ast::Arguments = {
|
|||
|
||||
// Note that this is a macro which is used once for function defs, and
|
||||
// once for lambda defs.
|
||||
ParameterList<ArgType, StarArgType, DoubleStarArgType>: ast::Arguments = {
|
||||
<location:@L> <param1:ParameterDefs<ArgType>> <args2:("," <ParameterListStarArgs<ArgType, StarArgType, DoubleStarArgType>>)?> ","? <end_location:@R> =>? {
|
||||
ParameterList<ParameterType, StarParameterType, DoubleStarParameterType>: ast::Parameters = {
|
||||
<location:@L> <param1:ParameterDefs<ParameterType>> <args2:("," <ParameterListStarArgs<ParameterType, StarParameterType, DoubleStarParameterType>>)?> ","? <end_location:@R> =>? {
|
||||
validate_pos_params(¶m1)?;
|
||||
let (posonlyargs, args) = param1;
|
||||
|
||||
// Now gather rest of parameters:
|
||||
let (vararg, kwonlyargs, kwarg) = args2.unwrap_or((None, vec![], None));
|
||||
|
||||
Ok(ast::Arguments {
|
||||
Ok(ast::Parameters {
|
||||
posonlyargs,
|
||||
args,
|
||||
kwonlyargs,
|
||||
|
@ -1075,7 +1075,7 @@ ParameterList<ArgType, StarArgType, DoubleStarArgType>: ast::Arguments = {
|
|||
range: (location..end_location).into()
|
||||
})
|
||||
},
|
||||
<location:@L> <param1:ParameterDefs<ArgType>> <kw:("," <KwargParameter<DoubleStarArgType>>)> ","? <end_location:@R> =>? {
|
||||
<location:@L> <param1:ParameterDefs<ParameterType>> <kw:("," <KwargParameter<DoubleStarParameterType>>)> ","? <end_location:@R> =>? {
|
||||
validate_pos_params(¶m1)?;
|
||||
let (posonlyargs, args) = param1;
|
||||
|
||||
|
@ -1084,7 +1084,7 @@ ParameterList<ArgType, StarArgType, DoubleStarArgType>: ast::Arguments = {
|
|||
let kwonlyargs = vec![];
|
||||
let kwarg = kw;
|
||||
|
||||
Ok(ast::Arguments {
|
||||
Ok(ast::Parameters {
|
||||
posonlyargs,
|
||||
args,
|
||||
kwonlyargs,
|
||||
|
@ -1093,9 +1093,9 @@ ParameterList<ArgType, StarArgType, DoubleStarArgType>: ast::Arguments = {
|
|||
range: (location..end_location).into()
|
||||
})
|
||||
},
|
||||
<location:@L> <params:ParameterListStarArgs<ArgType, StarArgType, DoubleStarArgType>> ","? <end_location:@R> => {
|
||||
<location:@L> <params:ParameterListStarArgs<ParameterType, StarParameterType, DoubleStarParameterType>> ","? <end_location:@R> => {
|
||||
let (vararg, kwonlyargs, kwarg) = params;
|
||||
ast::Arguments {
|
||||
ast::Parameters {
|
||||
posonlyargs: vec![],
|
||||
args: vec![],
|
||||
kwonlyargs,
|
||||
|
@ -1104,8 +1104,8 @@ ParameterList<ArgType, StarArgType, DoubleStarArgType>: ast::Arguments = {
|
|||
range: (location..end_location).into()
|
||||
}
|
||||
},
|
||||
<location:@L> <kwarg:KwargParameter<DoubleStarArgType>> ","? <end_location:@R> => {
|
||||
ast::Arguments {
|
||||
<location:@L> <kwarg:KwargParameter<DoubleStarParameterType>> ","? <end_location:@R> => {
|
||||
ast::Parameters {
|
||||
posonlyargs: vec![],
|
||||
args: vec![],
|
||||
kwonlyargs: vec![],
|
||||
|
@ -1118,61 +1118,61 @@ ParameterList<ArgType, StarArgType, DoubleStarArgType>: ast::Arguments = {
|
|||
|
||||
// Use inline here to make sure the "," is not creating an ambiguity.
|
||||
#[inline]
|
||||
ParameterDefs<ArgType>: (Vec<ast::ArgWithDefault>, Vec<ast::ArgWithDefault>) = {
|
||||
<args:OneOrMore<ParameterDef<ArgType>>> => {
|
||||
ParameterDefs<ParameterType>: (Vec<ast::ParameterWithDefault>, Vec<ast::ParameterWithDefault>) = {
|
||||
<args:OneOrMore<ParameterDef<ParameterType>>> => {
|
||||
(vec![], args)
|
||||
},
|
||||
<posonlyargs:OneOrMore<ParameterDef<ArgType>>> "," "/" <args:("," <ParameterDef<ArgType>>)*> => {
|
||||
<posonlyargs:OneOrMore<ParameterDef<ParameterType>>> "," "/" <args:("," <ParameterDef<ParameterType>>)*> => {
|
||||
(posonlyargs, args)
|
||||
},
|
||||
};
|
||||
|
||||
ParameterDef<ArgType>: ast::ArgWithDefault = {
|
||||
<i:ArgType> => i,
|
||||
<mut i:ArgType> "=" <e:Test<"all">> <end_location:@R> => {
|
||||
ParameterDef<ParameterType>: ast::ParameterWithDefault = {
|
||||
<i:ParameterType> => i,
|
||||
<mut i:ParameterType> "=" <e:Test<"all">> <end_location:@R> => {
|
||||
i.default = Some(Box::new(e));
|
||||
i.range = (i.range.start()..end_location).into();
|
||||
i
|
||||
},
|
||||
};
|
||||
|
||||
UntypedParameter: ast::ArgWithDefault = {
|
||||
UntypedParameter: ast::ParameterWithDefault = {
|
||||
<location:@L> <arg:Identifier> <end_location:@R> => {
|
||||
let def = ast::Arg { arg, annotation: None, range: (location..end_location).into() };
|
||||
ast::ArgWithDefault { def, default: None, range: (location..end_location).into() }
|
||||
let def = ast::Parameter { arg, annotation: None, range: (location..end_location).into() };
|
||||
ast::ParameterWithDefault { def, default: None, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
StarUntypedParameter: ast::Arg = {
|
||||
<location:@L> <arg:Identifier> <end_location:@R> => ast::Arg { arg, annotation: 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() },
|
||||
};
|
||||
|
||||
TypedParameter: ast::ArgWithDefault = {
|
||||
TypedParameter: ast::ParameterWithDefault = {
|
||||
<location:@L> <arg:Identifier> <a:(":" <Test<"all">>)?> <end_location:@R> => {
|
||||
let annotation = a.map(Box::new);
|
||||
let def = ast::Arg { arg, annotation, range: (location..end_location).into() };
|
||||
ast::ArgWithDefault { def, default: None, range: (location..end_location).into() }
|
||||
let def = ast::Parameter { arg, annotation, range: (location..end_location).into() };
|
||||
ast::ParameterWithDefault { def, default: None, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
|
||||
StarTypedParameter: ast::Arg = {
|
||||
StarTypedParameter: ast::Parameter = {
|
||||
<location:@L> <arg:Identifier> <a:(":" <TestOrStarExpr>)?> <end_location:@R> => {
|
||||
let annotation = a.map(Box::new);
|
||||
ast::Arg { arg, annotation, range: (location..end_location).into() }
|
||||
ast::Parameter { arg, annotation, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
|
||||
DoubleStarTypedParameter: ast::Arg = {
|
||||
DoubleStarTypedParameter: ast::Parameter = {
|
||||
<location:@L> <arg:Identifier> <a:(":" <Test<"all">>)?> <end_location:@R> => {
|
||||
let annotation = a.map(Box::new);
|
||||
ast::Arg { arg, annotation, range: (location..end_location).into() }
|
||||
ast::Parameter { arg, annotation, range: (location..end_location).into() }
|
||||
},
|
||||
};
|
||||
|
||||
// Use inline here to make sure the "," is not creating an ambiguity.
|
||||
// TODO: figure out another grammar that makes this inline no longer required.
|
||||
#[inline]
|
||||
ParameterListStarArgs<ArgType, StarArgType, DoubleStarArgType>: (Option<Box<ast::Arg>>, Vec<ast::ArgWithDefault>, Option<Box<ast::Arg>>) = {
|
||||
<location:@L> "*" <va:StarArgType?> <kwonlyargs:("," <ParameterDef<ArgType>>)*> <kwarg:("," <KwargParameter<DoubleStarArgType>>)?> =>? {
|
||||
ParameterListStarArgs<ParameterType, StarParameterType, DoubleStarParameterType>: (Option<Box<ast::Parameter>>, Vec<ast::ParameterWithDefault>, Option<Box<ast::Parameter>>) = {
|
||||
<location:@L> "*" <va:StarParameterType?> <kwonlyargs:("," <ParameterDef<ParameterType>>)*> <kwarg:("," <KwargParameter<DoubleStarParameterType>>)?> =>? {
|
||||
if va.is_none() && kwonlyargs.is_empty() && kwarg.is_none() {
|
||||
return Err(LexicalError {
|
||||
error: LexicalErrorType::OtherError("named arguments must follow bare *".to_string()),
|
||||
|
@ -1187,8 +1187,8 @@ ParameterListStarArgs<ArgType, StarArgType, DoubleStarArgType>: (Option<Box<ast:
|
|||
}
|
||||
};
|
||||
|
||||
KwargParameter<ArgType>: Option<Box<ast::Arg>> = {
|
||||
"**" <kwarg:ArgType?> => {
|
||||
KwargParameter<ParameterType>: Option<Box<ast::Parameter>> = {
|
||||
"**" <kwarg:ParameterType?> => {
|
||||
kwarg.map(Box::new)
|
||||
}
|
||||
};
|
||||
|
@ -1291,11 +1291,11 @@ LambdaDef: ast::Expr = {
|
|||
<location:@L> "lambda" <location_args:@L> <p:ParameterList<UntypedParameter, StarUntypedParameter, StarUntypedParameter>?> <end_location_args:@R> ":" <body:Test<"all">> <end_location:@R> =>? {
|
||||
p.as_ref().map(validate_arguments).transpose()?;
|
||||
let p = p
|
||||
.unwrap_or_else(|| ast::Arguments::empty((location_args..end_location_args).into()));
|
||||
.unwrap_or_else(|| ast::Parameters::empty((location_args..end_location_args).into()));
|
||||
|
||||
Ok(ast::Expr::Lambda(
|
||||
ast::ExprLambda {
|
||||
args: Box::new(p),
|
||||
parameters: Box::new(p),
|
||||
body: Box::new(body),
|
||||
range: (location..end_location).into()
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -11,15 +11,15 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..17,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -29,9 +29,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -41,9 +41,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 15..16,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 15..16,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -11,15 +11,15 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..23,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -29,9 +29,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..16,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -51,9 +51,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 18..22,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 18..19,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -11,7 +11,7 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..7,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -11,7 +11,7 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..7,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..26,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -39,9 +39,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
@ -54,9 +54,9 @@ Ok(
|
|||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 18..19,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 18..19,
|
||||
arg: Identifier {
|
||||
id: "d",
|
||||
|
@ -66,9 +66,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 21..22,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 21..22,
|
||||
arg: Identifier {
|
||||
id: "e",
|
||||
|
@ -78,9 +78,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 24..25,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 24..25,
|
||||
arg: Identifier {
|
||||
id: "f",
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..32,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -39,9 +39,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
@ -54,9 +54,9 @@ Ok(
|
|||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 18..19,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 18..19,
|
||||
arg: Identifier {
|
||||
id: "d",
|
||||
|
@ -66,9 +66,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 21..25,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 21..22,
|
||||
arg: Identifier {
|
||||
id: "e",
|
||||
|
@ -88,9 +88,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 27..31,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 27..28,
|
||||
arg: Identifier {
|
||||
id: "f",
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..36,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -39,9 +39,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
@ -53,7 +53,7 @@ Ok(
|
|||
},
|
||||
],
|
||||
vararg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 16..20,
|
||||
arg: Identifier {
|
||||
id: "args",
|
||||
|
@ -63,9 +63,9 @@ Ok(
|
|||
},
|
||||
),
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 22..23,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 22..23,
|
||||
arg: Identifier {
|
||||
id: "d",
|
||||
|
@ -75,9 +75,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 25..29,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 25..26,
|
||||
arg: Identifier {
|
||||
id: "e",
|
||||
|
@ -97,9 +97,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 31..35,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 31..32,
|
||||
arg: Identifier {
|
||||
id: "f",
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..46,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -39,9 +39,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
@ -53,7 +53,7 @@ Ok(
|
|||
},
|
||||
],
|
||||
vararg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 16..20,
|
||||
arg: Identifier {
|
||||
id: "args",
|
||||
|
@ -63,9 +63,9 @@ Ok(
|
|||
},
|
||||
),
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 22..23,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 22..23,
|
||||
arg: Identifier {
|
||||
id: "d",
|
||||
|
@ -75,9 +75,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 25..29,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 25..26,
|
||||
arg: Identifier {
|
||||
id: "e",
|
||||
|
@ -97,9 +97,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 31..35,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 31..32,
|
||||
arg: Identifier {
|
||||
id: "f",
|
||||
|
@ -121,7 +121,7 @@ Ok(
|
|||
},
|
||||
],
|
||||
kwarg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 39..45,
|
||||
arg: Identifier {
|
||||
id: "kwargs",
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..14,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -39,9 +39,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..20,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -49,9 +49,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 15..19,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 15..16,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -11,13 +11,13 @@ Ok(
|
|||
id: "f",
|
||||
range: 4..5,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 5..14,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 6..7,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 6..7,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -27,9 +27,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -39,9 +39,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 12..13,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 12..13,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -10,15 +10,15 @@ Ok(
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..20,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 7..17,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 10..11,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 10..11,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -28,9 +28,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 13..14,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 13..14,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -40,9 +40,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 16..17,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 16..17,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -10,15 +10,15 @@ Ok(
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..26,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 7..23,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 10..11,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 10..11,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -28,9 +28,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 13..17,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 13..14,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -50,9 +50,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 19..23,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 19..20,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -10,7 +10,7 @@ Ok(
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..9,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 6..6,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -10,13 +10,13 @@ Ok(
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..26,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 7..23,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 7..8,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 7..8,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -26,9 +26,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 10..11,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 10..11,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -38,9 +38,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 13..14,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 13..14,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
@ -53,9 +53,9 @@ Ok(
|
|||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 19..20,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 19..20,
|
||||
arg: Identifier {
|
||||
id: "d",
|
||||
|
@ -65,9 +65,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 22..23,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 22..23,
|
||||
arg: Identifier {
|
||||
id: "e",
|
||||
|
|
|
@ -10,13 +10,13 @@ Ok(
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..17,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 7..14,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 7..8,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 7..8,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -26,9 +26,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 10..11,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 10..11,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -38,9 +38,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 13..14,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 13..14,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -10,13 +10,13 @@ Ok(
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..23,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 7..20,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 7..8,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 7..8,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -26,9 +26,9 @@ Ok(
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 10..14,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 10..11,
|
||||
arg: Identifier {
|
||||
id: "b",
|
||||
|
@ -48,9 +48,9 @@ Ok(
|
|||
),
|
||||
),
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 16..20,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 16..17,
|
||||
arg: Identifier {
|
||||
id: "c",
|
||||
|
|
|
@ -10,7 +10,7 @@ expression: parse_ast
|
|||
id: "test",
|
||||
range: 18..22,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 22..24,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -129,7 +129,7 @@ Module(
|
|||
id: "foo",
|
||||
range: 570..573,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 573..575,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: crates/ruff_python_parser/src/parser.rs
|
||||
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
||||
expression: "parse_suite(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
Expr(
|
||||
|
@ -709,13 +709,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 591..619,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 598..603,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 598..603,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 598..603,
|
||||
arg: Identifier {
|
||||
id: "query",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: crates/ruff_python_parser/src/parser.rs
|
||||
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
||||
expression: "parse_suite(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
ClassDef(
|
||||
|
@ -35,13 +35,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "__init__",
|
||||
range: 22..30,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 30..36,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 31..35,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 31..35,
|
||||
arg: Identifier {
|
||||
id: "self",
|
||||
|
@ -75,13 +75,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "method_with_default",
|
||||
range: 50..69,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 69..90,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 70..74,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 70..74,
|
||||
arg: Identifier {
|
||||
id: "self",
|
||||
|
@ -91,9 +91,9 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 76..89,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 76..79,
|
||||
arg: Identifier {
|
||||
id: "arg",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: crates/ruff_python_parser/src/parser.rs
|
||||
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
||||
expression: "parse_suite(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
FunctionDef(
|
||||
|
@ -10,13 +10,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 4..8,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 8..11,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 9..10,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 9..10,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -57,13 +57,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 26..30,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 33..39,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 34..38,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 34..38,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -131,13 +131,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 59..63,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 71..77,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 72..76,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 72..76,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -213,13 +213,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 97..101,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 118..124,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 119..123,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 119..123,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -310,12 +310,12 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 144..148,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 153..162,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 155..161,
|
||||
arg: Identifier {
|
||||
id: "a",
|
||||
|
@ -377,12 +377,12 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 177..181,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 186..221,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 188..200,
|
||||
arg: Identifier {
|
||||
id: "args",
|
||||
|
@ -411,7 +411,7 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
),
|
||||
kwonlyargs: [],
|
||||
kwarg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 204..220,
|
||||
arg: Identifier {
|
||||
id: "kwargs",
|
||||
|
@ -475,7 +475,7 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
id: "func",
|
||||
range: 236..240,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 261..263,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -9,13 +9,13 @@ expression: parse_ast
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..18,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 7..11,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 7..8,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 7..8,
|
||||
arg: Identifier {
|
||||
id: "x",
|
||||
|
@ -25,9 +25,9 @@ expression: parse_ast
|
|||
},
|
||||
default: None,
|
||||
},
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 10..11,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 10..11,
|
||||
arg: Identifier {
|
||||
id: "y",
|
||||
|
|
|
@ -9,7 +9,7 @@ expression: parse_ast
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 0..9,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 6..6,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
source: crates/ruff_python_parser/src/parser.rs
|
||||
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
||||
expression: "parse_suite(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
Expr(
|
||||
|
@ -645,13 +645,13 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
value: Lambda(
|
||||
ExprLambda {
|
||||
range: 507..535,
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 514..519,
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
ArgWithDefault {
|
||||
ParameterWithDefault {
|
||||
range: 514..519,
|
||||
def: Arg {
|
||||
def: Parameter {
|
||||
range: 514..519,
|
||||
arg: Identifier {
|
||||
id: "query",
|
||||
|
|
|
@ -10,12 +10,12 @@ expression: parse_ast
|
|||
id: "args_to_tuple",
|
||||
range: 5..18,
|
||||
},
|
||||
args: Arguments {
|
||||
parameters: Parameters {
|
||||
range: 18..30,
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: Some(
|
||||
Arg {
|
||||
Parameter {
|
||||
range: 20..29,
|
||||
arg: Identifier {
|
||||
id: "args",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue