Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 1994da2

Browse files
author
Juanjo Alvarez
committed
Set the boolean on variadic arguments
Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent 36e1194 commit 1994da2

13 files changed

+26
-29
lines changed

driver/normalizer/normalizer.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ func funcDefMap(typ string, async bool) Mapping {
3535
uast.KeyPos: Var("_pos"),
3636
uast.KeyType: Var("_type"),
3737
},
38-
//"decorator_list": Var("_decorators"),
39-
// XXX handle this
40-
//"returns": Var("returns"),
4138
},
4239
Obj{
4340
"Nodes": Arr(

fixtures/funcdef_kwonlyargs.py.native

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{
2727
'@token': "c",
2828
annotation: ~,
29-
'ast_type': "arg",
29+
'ast_type': "kwonly_arg",
3030
'col_offset': 23,
3131
default: {
3232
'ast_type': "Num",

fixtures/funcdef_kwonlyargs.py.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
},
5858
annotation: ~,
5959
},
60-
{ '@type': "arg",
60+
{ '@type': "kwonly_arg",
6161
'@token': "c",
62-
'@role': [Argument, Declaration, Function, Name],
62+
'@role': [Argument, Declaration, Function, Incomplete, Name],
6363
'@pos': { '@type': "uast:Positions",
6464
start: { '@type': "uast:Position",
6565
offset: 22,

fixtures/u2_func_params_kwonlyargs.py.native

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
'@token': "a",
1010
annotation: ~,
11-
'ast_type': "arg",
11+
'ast_type': "kwonly_arg",
1212
'col_offset': 17,
1313
default: {
1414
LiteralValue: "None",
@@ -21,7 +21,7 @@
2121
{
2222
'@token': "b",
2323
annotation: ~,
24-
'ast_type': "arg",
24+
'ast_type': "kwonly_arg",
2525
'col_offset': 20,
2626
default: {
2727
LiteralValue: "None",

fixtures/u2_func_params_kwonlyargs.py.uast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
'@pos': { '@type': "uast:Positions",
2424
},
2525
args: [
26-
{ '@type': "arg",
26+
{ '@type': "kwonly_arg",
2727
'@token': "a",
28-
'@role': [Argument, Declaration, Function, Name],
28+
'@role': [Argument, Declaration, Function, Incomplete, Name],
2929
'@pos': { '@type': "uast:Positions",
3030
start: { '@type': "uast:Position",
3131
offset: 16,
@@ -47,9 +47,9 @@
4747
LiteralValue: "None",
4848
},
4949
},
50-
{ '@type': "arg",
50+
{ '@type': "kwonly_arg",
5151
'@token': "b",
52-
'@role': [Argument, Declaration, Function, Name],
52+
'@role': [Argument, Declaration, Function, Incomplete, Name],
5353
'@pos': { '@type': "uast:Positions",
5454
start: { '@type': "uast:Position",
5555
offset: 19,

fixtures/u2_func_params_kwonlyargs_default.py.native

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
'@token': "a",
1010
annotation: ~,
11-
'ast_type': "arg",
11+
'ast_type': "kwonly_arg",
1212
'col_offset': 17,
1313
default: {
1414
LiteralValue: "None",
@@ -21,7 +21,7 @@
2121
{
2222
'@token': "b",
2323
annotation: ~,
24-
'ast_type': "arg",
24+
'ast_type': "kwonly_arg",
2525
'col_offset': 20,
2626
default: {
2727
'ast_type': "Num",
@@ -38,7 +38,7 @@
3838
{
3939
'@token': "c",
4040
annotation: ~,
41-
'ast_type': "arg",
41+
'ast_type': "kwonly_arg",
4242
'col_offset': 25,
4343
default: {
4444
'ast_type': "Num",

fixtures/u2_func_params_kwonlyargs_default.py.uast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
'@pos': { '@type': "uast:Positions",
2424
},
2525
args: [
26-
{ '@type': "arg",
26+
{ '@type': "kwonly_arg",
2727
'@token': "a",
28-
'@role': [Argument, Declaration, Function, Name],
28+
'@role': [Argument, Declaration, Function, Incomplete, Name],
2929
'@pos': { '@type': "uast:Positions",
3030
start: { '@type': "uast:Position",
3131
offset: 16,
@@ -47,9 +47,9 @@
4747
LiteralValue: "None",
4848
},
4949
},
50-
{ '@type': "arg",
50+
{ '@type': "kwonly_arg",
5151
'@token': "b",
52-
'@role': [Argument, Declaration, Function, Name],
52+
'@role': [Argument, Declaration, Function, Incomplete, Name],
5353
'@pos': { '@type': "uast:Positions",
5454
start: { '@type': "uast:Position",
5555
offset: 19,
@@ -80,9 +80,9 @@
8080
},
8181
},
8282
},
83-
{ '@type': "arg",
83+
{ '@type': "kwonly_arg",
8484
'@token': "c",
85-
'@role': [Argument, Declaration, Function, Name],
85+
'@role': [Argument, Declaration, Function, Incomplete, Name],
8686
'@pos': { '@type': "uast:Positions",
8787
start: { '@type': "uast:Position",
8888
offset: 24,

fixtures/u2_func_params_variadic_list.py.native

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
'@token': "a",
1010
annotation: ~,
11-
'ast_type': "arg",
11+
'ast_type': "vararg",
1212
'col_offset': 15,
1313
'end_col_offset': 15,
1414
'end_lineno': 1,

fixtures/u2_func_params_variadic_list.py.sem.uast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
},
6868
Receiver: false,
6969
Type: ~,
70-
Variadic: false,
70+
Variadic: true,
7171
},
7272
],
7373
Returns: ~,

fixtures/u2_func_params_variadic_list.py.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
'@pos': { '@type': "uast:Positions",
2424
},
2525
args: [
26-
{ '@type': "arg",
26+
{ '@type': "vararg",
2727
'@token': "a",
28-
'@role': [Argument, Declaration, Function, Name],
28+
'@role': [ArgsList, Declaration, Function, List, Name],
2929
'@pos': { '@type': "uast:Positions",
3030
start: { '@type': "uast:Position",
3131
offset: 14,

0 commit comments

Comments
 (0)