feat(py) Add *args and **kwargs support (#71)
This commit is contained in:
@@ -30,7 +30,6 @@ return {
|
||||
node_type = "parameters",
|
||||
subtree = {
|
||||
{ retrieve = "all", node_type = "identifier", extract = true },
|
||||
|
||||
{
|
||||
retrieve = "all",
|
||||
node_type = "default_parameter",
|
||||
@@ -48,6 +47,18 @@ return {
|
||||
extract = true,
|
||||
subtree = { { retrieve = "all", node_type = "identifier", extract = true } },
|
||||
},
|
||||
{
|
||||
retrieve = "first",
|
||||
node_type = "list_splat_pattern",
|
||||
extract = true,
|
||||
as = i.ArbitraryArgs,
|
||||
},
|
||||
{
|
||||
retrieve = "first",
|
||||
node_type = "dictionary_splat_pattern",
|
||||
extract = true,
|
||||
as = i.ArbitraryArgs,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -120,6 +131,8 @@ return {
|
||||
results[i.HasReturn] = (res.return_statement or res.anonymous_return or res[i.ReturnTypeHint])
|
||||
and { true }
|
||||
or nil
|
||||
results[i.ArbitraryArgs] = res[i.ArbitraryArgs]
|
||||
results[i.Kwargs] = res[i.Kwargs]
|
||||
return results
|
||||
end,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user