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

Commit

Permalink
fix alias versus the name in imports; fixes #197
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <[email protected]>
  • Loading branch information
Denys Smirnov authored and dennwc committed May 23, 2019
1 parent e6bf9a6 commit 6622d6d
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions driver/normalizer/normalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ var Normalizers = []Mapping{
},
Obj{
"Name": UASTType(uast.Identifier{}, Obj{
"Name": Var("name"),
"Name": Var("alias"),
}),
"Node": UASTType(uast.Identifier{},
Obj{"Name": Var("alias")},
Obj{"Name": Var("name")},
),
},
)),
Expand Down
4 changes: 2 additions & 2 deletions fixtures/bench_javaobs.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "StringIO",
Name: "BytesIO",
},
Node: { '@type': "uast:Identifier",
Name: "BytesIO",
Name: "StringIO",
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions fixtures/issue62.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "numpy",
Name: "np",
},
Node: { '@type': "uast:Identifier",
Name: "np",
Name: "numpy",
},
},
Target: ~,
Expand Down
8 changes: 4 additions & 4 deletions fixtures/issue94.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "lib3",
Name: "lib3_alias",
},
Node: { '@type': "uast:Identifier",
Name: "lib3_alias",
Name: "lib3",
},
},
Target: ~,
Expand Down Expand Up @@ -125,10 +125,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "lib61",
Name: "lib611",
},
Node: { '@type': "uast:Identifier",
Name: "lib611",
Name: "lib61",
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions fixtures/issue96.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "lib3",
Name: "lib3_alias",
},
Node: { '@type': "uast:Identifier",
Name: "lib3_alias",
Name: "lib3",
},
},
Target: ~,
Expand Down Expand Up @@ -125,10 +125,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "lib61",
Name: "lib611",
},
Node: { '@type': "uast:Identifier",
Name: "lib611",
Name: "lib61",
},
},
],
Expand Down
16 changes: 8 additions & 8 deletions fixtures/issue_server101.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -54341,10 +54341,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "InterfaceClass",
Name: "_ZopeInterfaceClass",
},
Node: { '@type': "uast:Identifier",
Name: "_ZopeInterfaceClass",
Name: "InterfaceClass",
},
},
],
Expand Down Expand Up @@ -54480,10 +54480,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "ExtensionClass",
Name: "_ExtensionClass",
},
Node: { '@type': "uast:Identifier",
Name: "_ExtensionClass",
Name: "ExtensionClass",
},
},
],
Expand Down Expand Up @@ -54834,10 +54834,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "PythonMethodType",
Name: "_ZopeMethodType",
},
Node: { '@type': "uast:Identifier",
Name: "_ZopeMethodType",
Name: "PythonMethodType",
},
},
],
Expand Down Expand Up @@ -54865,10 +54865,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "ExtensionMethodType",
Name: "_ZopeCMethodType",
},
Node: { '@type': "uast:Identifier",
Name: "_ZopeCMethodType",
Name: "ExtensionMethodType",
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions fixtures/u2_import_module_alias.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "x",
Name: "y",
},
Node: { '@type': "uast:Identifier",
Name: "y",
Name: "x",
},
},
Target: ~,
Expand Down
8 changes: 4 additions & 4 deletions fixtures/u2_import_rename.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "a",
Name: "b",
},
Node: { '@type': "uast:Identifier",
Name: "b",
Name: "a",
},
},
Target: ~,
Expand All @@ -44,10 +44,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "e",
Name: "f",
},
Node: { '@type': "uast:Identifier",
Name: "f",
Name: "e",
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions fixtures/u2_import_subsymbol_alias.py.sem.uast
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "x.y",
Name: "z",
},
Node: { '@type': "uast:Identifier",
Name: "z",
Name: "x.y",
},
},
Target: ~,
Expand All @@ -44,10 +44,10 @@
'@pos': { '@type': "uast:Positions",
},
Name: { '@type': "uast:Identifier",
Name: "b",
Name: "c",
},
Node: { '@type': "uast:Identifier",
Name: "c",
Name: "b",
},
},
],
Expand Down

0 comments on commit 6622d6d

Please sign in to comment.