From f99a03eb5296e03b4bb6cb0a3d25ee6587854d73 Mon Sep 17 00:00:00 2001 From: Juanjo Alvarez Date: Wed, 4 Oct 2017 13:46:04 +0200 Subject: [PATCH 1/3] Handle NoneTypes that can be found by the main visit() method Signed-off-by: Juanjo Alvarez --- .../python_driver/astimprove.py | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/native/python_package/python_driver/astimprove.py b/native/python_package/python_driver/astimprove.py index 5d4bf70d..f4caca14 100644 --- a/native/python_package/python_driver/astimprove.py +++ b/native/python_package/python_driver/astimprove.py @@ -189,9 +189,9 @@ def _create_astmissing_lines(self): self._current_line = len(lines) return lines - def add_noops(self, node, visit_dict, root): - if not isinstance(visit_dict, dict): - return visit_dict + def add_noops(self, node, root): + if not isinstance(node, dict): + return node def _create_nooplines_list(startline, noops_previous): nooplines = [] @@ -208,10 +208,9 @@ def _create_nooplines_list(startline, noops_previous): # Add all the noop (whitespace and comments) lines between the # last node and this one - noops_previous, startline, endline, endcol =\ - self.previous_nooplines(node) + noops_previous, startline, endline, endcol = self.previous_nooplines(node) if noops_previous: - visit_dict['noops_previous'] = { + node['noops_previous'] = { "ast_type": "PreviousNoops", "lineno": startline, "col_offset": 1, @@ -225,7 +224,7 @@ def _create_nooplines_list(startline, noops_previous): noops_sameline = self.sameline_remainder_noops(node) joined_sameline = ''.join([x['value'] for x in noops_sameline]) if noops_sameline: - visit_dict['noops_sameline'] = { + node['noops_sameline'] = { "ast_type": "SameLineNoops", "lineno": node.get("lineno", 0), "col_offset": noops_sameline[0]["colstart"], @@ -239,7 +238,7 @@ def _create_nooplines_list(startline, noops_previous): noops_remainder, startline, endline, endcol =\ self.remainder_noops() if noops_remainder: - visit_dict['noops_remainder'] = { + node['noops_remainder'] = { "ast_type": "RemainderNoops", "lineno": startline, "col_offset": 1, @@ -423,14 +422,16 @@ def visit(self, node, root=False): # the ctx property always has a "Load"/"Store"/etc dictionary that # can be perfectly converted to a string value since they don't # hold anything more than the name - node_type = node["ast_type"] if isinstance(node, dict) else node.__class__.__name__ - ctx = node.get("ctx") - if ctx: - node["ctx"] = ctx["ast_type"] + if isinstance(node, dict): + node_type = node["ast_type"] + if "ctx" in node: + node["ctx"] = node["ctx"]["ast_type"] + else: + node_type = node.__class__.__name__ meth = getattr(self, "visit_" + node_type, self.visit_other) visit_result = meth(node) - self.noops_sync.add_noops(node, visit_result, root) + self.noops_sync.add_noops(node, root) self.pos_sync.sync_node_pos(visit_result) if not self.codestr: @@ -489,8 +490,7 @@ def visit_NameConstant(self, node): node.update({"LiteralValue": "True" if node["value"] else "False", "ast_type": "BoolLiteral"}) elif repr_val == "None": - node.update({"LiteralValue": "None", - "ast_type": "NoneLiteral"}) + node = self.visit_NoneType(node) else: node["ast_type"] = "NameConstant" return node @@ -502,6 +502,14 @@ def visit_Num(self, node): "imag": node["n"].imag}}) return node + def visit_NoneType(self, node): + if node: + ret = node + + ret.update({"LiteralValue": "None", + "ast_type": "NoneLiteral"}) + return ret + def visit_other(self, node): for field in node.get("_fields", []): meth = getattr(self, "visit_" + node["ast_type"], self.visit_other_field) From 2ad531fe78ea4929b2cef89f6cc1c07aa42432c6 Mon Sep 17 00:00:00 2001 From: Juanjo Alvarez Date: Wed, 4 Oct 2017 15:03:10 +0200 Subject: [PATCH 2/3] Added test for this issue and some previous ones Signed-off-by: Juanjo Alvarez --- fixtures/issue119.py.native | 156 ++ fixtures/issue119.py.source | 4 + fixtures/issue119.py.uast | 274 ++++ fixtures/issue94.py.native | 716 +++++++++ fixtures/issue94.py.source | 36 + fixtures/issue94.py.uast | 1391 +++++++++++++++++ fixtures/issue96.py.source | 0 fixtures/issue96.py.uast | 1391 +++++++++++++++++ .../python_driver/astimprove.py | 4 +- 9 files changed, 3969 insertions(+), 3 deletions(-) create mode 100644 fixtures/issue119.py.native create mode 100644 fixtures/issue119.py.source create mode 100644 fixtures/issue119.py.uast create mode 100644 fixtures/issue94.py.native create mode 100644 fixtures/issue94.py.source create mode 100644 fixtures/issue94.py.uast create mode 100644 fixtures/issue96.py.source create mode 100644 fixtures/issue96.py.uast diff --git a/fixtures/issue119.py.native b/fixtures/issue119.py.native new file mode 100644 index 00000000..cf908fec --- /dev/null +++ b/fixtures/issue119.py.native @@ -0,0 +1,156 @@ +{ + "status": "ok", + "errors": [], + "ast": { + "PY3AST": { + "ast_type": "Module", + "body": [ + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Assign", + "col_offset": 5, + "lineno": 2, + "targets": [ + { + "ast_type": "Name", + "col_offset": 5, + "ctx": "Store", + "end_col_offset": 5, + "end_lineno": 2, + "id": "a", + "lineno": 2 + } + ], + "value": { + "ast_type": "Dict", + "col_offset": 9, + "keys": [ + { + "ast_type": "Str", + "col_offset": 10, + "end_col_offset": 12, + "end_lineno": 2, + "lineno": 2, + "s": "1" + } + ], + "lineno": 2, + "values": [ + { + "ast_type": "Num", + "col_offset": 15, + "end_col_offset": 15, + "end_lineno": 2, + "lineno": 2, + "n": 1 + } + ] + } + }, + { + "ast_type": "Assign", + "col_offset": 5, + "lineno": 3, + "targets": [ + { + "ast_type": "Name", + "col_offset": 5, + "ctx": "Store", + "end_col_offset": 5, + "end_lineno": 3, + "id": "b", + "lineno": 3 + } + ], + "value": { + "ast_type": "Dict", + "col_offset": 9, + "keys": [ + { + "ast_type": "Str", + "col_offset": 10, + "end_col_offset": 12, + "end_lineno": 3, + "lineno": 3, + "s": "2" + } + ], + "lineno": 3, + "values": [ + { + "ast_type": "Num", + "col_offset": 15, + "end_col_offset": 15, + "end_lineno": 3, + "lineno": 3, + "n": 2 + } + ] + } + }, + { + "ast_type": "Return", + "col_offset": 5, + "end_col_offset": 10, + "end_lineno": 4, + "lineno": 4, + "value": { + "ast_type": "Dict", + "col_offset": 12, + "keys": [ + { + "LiteralValue": "None", + "ast_type": "NoneLiteral" + }, + { + "LiteralValue": "None", + "ast_type": "NoneLiteral" + } + ], + "lineno": 4, + "values": [ + { + "ast_type": "Name", + "col_offset": 15, + "ctx": "Load", + "end_col_offset": 15, + "end_lineno": 4, + "id": "a", + "lineno": 4 + }, + { + "ast_type": "Name", + "col_offset": 20, + "ctx": "Load", + "end_col_offset": 20, + "end_lineno": 4, + "id": "b", + "lineno": 4 + } + ] + } + } + ], + "col_offset": 5, + "decorator_list": [], + "end_col_offset": 7, + "end_lineno": 1, + "lineno": 1, + "name": "foo", + "returns": null + } + ] + } + } +} diff --git a/fixtures/issue119.py.source b/fixtures/issue119.py.source new file mode 100644 index 00000000..e0c6daf3 --- /dev/null +++ b/fixtures/issue119.py.source @@ -0,0 +1,4 @@ +def foo(): + a = {'1': 1} + b = {'2': 2} + return {**a, **b} diff --git a/fixtures/issue119.py.uast b/fixtures/issue119.py.uast new file mode 100644 index 00000000..3297658b --- /dev/null +++ b/fixtures/issue119.py.uast @@ -0,0 +1,274 @@ +Status: ok +Errors: +UAST: +Module { +. Roles: File,Module +. Children: { +. . 0: FunctionDef { +. . . Roles: Function,Declaration,Name,Identifier +. . . TOKEN "foo" +. . . StartPosition: { +. . . . Offset: 4 +. . . . Line: 1 +. . . . Col: 5 +. . . } +. . . EndPosition: { +. . . . Offset: 6 +. . . . Line: 1 +. . . . Col: 7 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . . returns: +. . . } +. . . Children: { +. . . . 0: FunctionDef.body { +. . . . . Roles: Function,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Assign { +. . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . StartPosition: { +. . . . . . . . Offset: 15 +. . . . . . . . Line: 2 +. . . . . . . . Col: 5 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Name { +. . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . TOKEN "a" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 15 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 5 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 15 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 5 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . ctx: Store +. . . . . . . . . . internalRole: targets +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: Dict { +. . . . . . . . . Roles: Literal,Map,Expression,Primitive,Right +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 19 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 9 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Str { +. . . . . . . . . . . Roles: Literal,String,Expression,Primitive,Map,Key +. . . . . . . . . . . TOKEN "1" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 20 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 10 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 22 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 12 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: keys +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: Num { +. . . . . . . . . . . Roles: Literal,Number,Expression,Primitive,Map,Value +. . . . . . . . . . . TOKEN "1" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 25 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 25 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: values +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 1: Assign { +. . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . StartPosition: { +. . . . . . . . Offset: 32 +. . . . . . . . Line: 3 +. . . . . . . . Col: 5 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Name { +. . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . TOKEN "b" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 32 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 5 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 32 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 5 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . ctx: Store +. . . . . . . . . . internalRole: targets +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: Dict { +. . . . . . . . . Roles: Literal,Map,Expression,Primitive,Right +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 36 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 9 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Str { +. . . . . . . . . . . Roles: Literal,String,Expression,Primitive,Map,Key +. . . . . . . . . . . TOKEN "2" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 37 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 10 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 39 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 12 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: keys +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: Num { +. . . . . . . . . . . Roles: Literal,Number,Expression,Primitive,Map,Value +. . . . . . . . . . . TOKEN "2" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 42 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 42 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: values +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 2: Return { +. . . . . . . Roles: Return,Statement +. . . . . . . TOKEN "return" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 49 +. . . . . . . . Line: 4 +. . . . . . . . Col: 5 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 54 +. . . . . . . . Line: 4 +. . . . . . . . Col: 10 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Dict { +. . . . . . . . . Roles: Literal,Map,Expression,Primitive +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 56 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 12 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Name { +. . . . . . . . . . . Roles: Map,Value,Identifier,Expression +. . . . . . . . . . . TOKEN "a" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 59 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 59 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . internalRole: values +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: Name { +. . . . . . . . . . . Roles: Map,Value,Identifier,Expression +. . . . . . . . . . . TOKEN "b" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 64 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 20 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 64 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 20 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . internalRole: values +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 2: NoneLiteral { +. . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Map,Key +. . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: keys +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 3: NoneLiteral { +. . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Map,Key +. . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: keys +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . . 1: arguments { +. . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . Properties: { +. . . . . . internalRole: args +. . . . . . kwarg: +. . . . . . vararg: +. . . . . } +. . . . } +. . . } +. . } +. } +} + diff --git a/fixtures/issue94.py.native b/fixtures/issue94.py.native new file mode 100644 index 00000000..752a63c4 --- /dev/null +++ b/fixtures/issue94.py.native @@ -0,0 +1,716 @@ +{ + "status": "ok", + "errors": [], + "ast": { + "PY3AST": { + "ast_type": "Module", + "body": [ + { + "ast_type": "Import", + "col_offset": 1, + "lineno": 1, + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib1" + } + ] + }, + { + "ast_type": "Import", + "col_offset": 1, + "lineno": 2, + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib2.lib21" + } + ] + }, + { + "ast_type": "Import", + "col_offset": 1, + "lineno": 3, + "names": [ + { + "asname": "lib3_alias", + "ast_type": "alias", + "name": "lib3" + } + ] + }, + { + "ast_type": "ImportFrom", + "col_offset": 6, + "end_col_offset": 9, + "end_lineno": 4, + "level": 0, + "lineno": 4, + "module": "lib4", + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib41" + } + ] + }, + { + "ast_type": "ImportFrom", + "col_offset": 1, + "level": 0, + "lineno": 5, + "module": "lib5.lib51", + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib511" + } + ] + }, + { + "ast_type": "ImportFrom", + "col_offset": 6, + "end_col_offset": 9, + "end_lineno": 6, + "level": 0, + "lineno": 6, + "module": "lib6", + "names": [ + { + "asname": "lib611", + "ast_type": "alias", + "name": "lib61" + } + ] + }, + { + "ast_type": "Assign", + "col_offset": 1, + "lineno": 8, + "targets": [ + { + "ast_type": "Name", + "col_offset": 1, + "ctx": "Store", + "end_col_offset": 4, + "end_lineno": 8, + "id": "var1", + "lineno": 8, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 7, + "lineno": 7, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 7, + "noop_line": "\n" + } + ] + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 8, + "end_col_offset": 11, + "end_lineno": 8, + "lineno": 8, + "value": null + } + }, + { + "ast_type": "Assign", + "col_offset": 1, + "lineno": 9, + "targets": [ + { + "ast_type": "Name", + "col_offset": 1, + "ctx": "Store", + "end_col_offset": 4, + "end_lineno": 9, + "id": "var2", + "lineno": 9 + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 8, + "end_col_offset": 11, + "end_lineno": 9, + "lineno": 9, + "value": null + } + }, + { + "ast_type": "ClassDef", + "bases": [], + "body": [ + { + "ast_type": "Assign", + "col_offset": 2, + "lineno": 12, + "targets": [ + { + "ast_type": "Name", + "col_offset": 2, + "ctx": "Store", + "end_col_offset": 6, + "end_lineno": 12, + "id": "var11", + "lineno": 12, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 10, + "lineno": 10, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 10, + "noop_line": "\n" + } + ] + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 10, + "end_col_offset": 13, + "end_lineno": 12, + "lineno": 12, + "value": null + } + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 15, + "end_col_offset": 18, + "end_lineno": 14, + "lineno": 14, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 13, + "lineno": 13, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 13, + "noop_line": "\n" + } + ] + } + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 15, + "targets": [ + { + "ast_type": "Attribute", + "attr": "var101", + "col_offset": 8, + "ctx": "Store", + "end_col_offset": 13, + "end_lineno": 15, + "lineno": 15, + "value": { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Load", + "end_col_offset": 6, + "end_lineno": 15, + "id": "self", + "lineno": 15 + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 17, + "end_col_offset": 20, + "end_lineno": 15, + "lineno": 15, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 13, + "end_lineno": 14, + "lineno": 14, + "name": "__init__", + "returns": null + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 13, + "end_col_offset": 16, + "end_lineno": 17, + "lineno": 17, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 16, + "lineno": 16, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 16, + "noop_line": "\n" + } + ] + } + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 18, + "targets": [ + { + "ast_type": "Attribute", + "attr": "var111", + "col_offset": 10, + "ctx": "Store", + "end_col_offset": 15, + "end_lineno": 18, + "lineno": 18, + "value": { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Load", + "end_col_offset": 8, + "end_lineno": 18, + "id": "class1", + "lineno": 18 + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 19, + "end_col_offset": 22, + "end_lineno": 18, + "lineno": 18, + "value": null + } + }, + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 19, + "targets": [ + { + "ast_type": "Attribute", + "attr": "var112", + "col_offset": 8, + "ctx": "Store", + "end_col_offset": 13, + "end_lineno": 19, + "lineno": 19, + "value": { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Load", + "end_col_offset": 6, + "end_lineno": 19, + "id": "self", + "lineno": 19 + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 17, + "end_col_offset": 20, + "end_lineno": 19, + "lineno": 19, + "value": null + } + }, + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 20, + "targets": [ + { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Store", + "end_col_offset": 8, + "end_lineno": 20, + "id": "var113", + "lineno": 20 + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 12, + "end_col_offset": 15, + "end_lineno": 20, + "lineno": 20, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 17, + "lineno": 17, + "name": "func11", + "returns": null + }, + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Pass", + "col_offset": 4, + "end_col_offset": 7, + "end_lineno": 24, + "lineno": 24, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 21, + "lineno": 21, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 21, + "noop_line": "\n" + } + ] + } + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 13, + "end_lineno": 23, + "lineno": 23, + "name": "func121", + "returns": null + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 22, + "lineno": 22, + "name": "func12", + "returns": null + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 12, + "end_lineno": 11, + "keywords": [], + "lineno": 11, + "name": "class1" + }, + { + "ast_type": "ClassDef", + "bases": [], + "body": [ + { + "ast_type": "Assign", + "col_offset": 2, + "lineno": 27, + "targets": [ + { + "ast_type": "Name", + "col_offset": 2, + "ctx": "Store", + "end_col_offset": 6, + "end_lineno": 27, + "id": "var21", + "lineno": 27, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 25, + "lineno": 25, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 25, + "noop_line": "\n" + } + ] + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 10, + "end_col_offset": 13, + "end_lineno": 27, + "lineno": 27, + "value": null + } + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 13, + "end_col_offset": 16, + "end_lineno": 28, + "lineno": 28 + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Expr", + "col_offset": 3, + "lineno": 29, + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 3, + "end_col_offset": 6, + "end_lineno": 29, + "lineno": 29, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 28, + "lineno": 28, + "name": "func21", + "returns": null + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 13, + "end_col_offset": 16, + "end_lineno": 30, + "lineno": 30 + }, + { + "annotation": null, + "arg": "arg1", + "ast_type": "arg", + "col_offset": 19, + "end_col_offset": 22, + "end_lineno": 30, + "lineno": 30 + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Expr", + "col_offset": 3, + "lineno": 31, + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 3, + "end_col_offset": 6, + "end_lineno": 31, + "lineno": 31, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 30, + "lineno": 30, + "name": "func22", + "returns": null + }, + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Expr", + "col_offset": 3, + "lineno": 33, + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 3, + "end_col_offset": 6, + "end_lineno": 33, + "lineno": 33, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 32, + "lineno": 32, + "name": "func23", + "returns": null + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 12, + "end_lineno": 26, + "keywords": [], + "lineno": 26, + "name": "class2" + }, + { + "ast_type": "ClassDef", + "bases": [], + "body": [ + { + "ast_type": "Pass", + "col_offset": 2, + "end_col_offset": 5, + "end_lineno": 36, + "lineno": 36, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 34, + "lineno": 34, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 34, + "noop_line": "\n" + } + ] + } + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 12, + "end_lineno": 35, + "keywords": [], + "lineno": 35, + "name": "class3" + } + ] + } + } +} diff --git a/fixtures/issue94.py.source b/fixtures/issue94.py.source new file mode 100644 index 00000000..c72e0f04 --- /dev/null +++ b/fixtures/issue94.py.source @@ -0,0 +1,36 @@ +import lib1 +import lib2.lib21 +import lib3 as lib3_alias +from lib4 import lib41 +from lib5.lib51 import lib511 +from lib6 import lib61 as lib611 + +var1 = None +var2 = None + +class class1: + var11 = None + + def __init__(self): + self.var101 = None + + def func11(self): + class1.var111 = None + self.var112 = None + var113 = None + + def func12(): + def func121(): + pass + +class class2: + var21 = None + def func21(self): + None + def func22(self, arg1): + None + def func23(): + None + +class class3: + pass diff --git a/fixtures/issue94.py.uast b/fixtures/issue94.py.uast new file mode 100644 index 00000000..841c99e8 --- /dev/null +++ b/fixtures/issue94.py.uast @@ -0,0 +1,1391 @@ +Status: ok +Errors: +UAST: +Module { +. Roles: File,Module +. Children: { +. . 0: Import { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 0 +. . . . Line: 1 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib1" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 1: Import { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 12 +. . . . Line: 2 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib2.lib21" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 2: Import { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 30 +. . . . Line: 3 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib3" +. . . . . Properties: { +. . . . . . alias.asname: lib3_alias +. . . . . . internalRole: names +. . . . . } +. . . . . Children: { +. . . . . . 0: alias.asname { +. . . . . . . Roles: Import,Alias,Identifier +. . . . . . . TOKEN "lib3_alias" +. . . . . . . Properties: { +. . . . . . . . promotedPropertyString: true +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 3: ImportFrom { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 61 +. . . . Line: 4 +. . . . Col: 6 +. . . } +. . . EndPosition: { +. . . . Offset: 64 +. . . . Line: 4 +. . . . Col: 9 +. . . } +. . . Properties: { +. . . . ImportFrom.module: lib4 +. . . . internalRole: body +. . . . level: 0 +. . . } +. . . Children: { +. . . . 0: ImportFrom.module { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib4" +. . . . . Properties: { +. . . . . . promotedPropertyString: true +. . . . . } +. . . . } +. . . . 1: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib41" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 4: ImportFrom { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 79 +. . . . Line: 5 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . ImportFrom.module: lib5.lib51 +. . . . internalRole: body +. . . . level: 0 +. . . } +. . . Children: { +. . . . 0: ImportFrom.module { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib5.lib51" +. . . . . Properties: { +. . . . . . promotedPropertyString: true +. . . . . } +. . . . } +. . . . 1: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib511" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 5: ImportFrom { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 114 +. . . . Line: 6 +. . . . Col: 6 +. . . } +. . . EndPosition: { +. . . . Offset: 117 +. . . . Line: 6 +. . . . Col: 9 +. . . } +. . . Properties: { +. . . . ImportFrom.module: lib6 +. . . . internalRole: body +. . . . level: 0 +. . . } +. . . Children: { +. . . . 0: ImportFrom.module { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib6" +. . . . . Properties: { +. . . . . . promotedPropertyString: true +. . . . . } +. . . . } +. . . . 1: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib61" +. . . . . Properties: { +. . . . . . alias.asname: lib611 +. . . . . . internalRole: names +. . . . . } +. . . . . Children: { +. . . . . . 0: alias.asname { +. . . . . . . Roles: Import,Alias,Identifier +. . . . . . . TOKEN "lib611" +. . . . . . . Properties: { +. . . . . . . . promotedPropertyString: true +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 6: Assign { +. . . Roles: Binary,Assignment,Expression +. . . StartPosition: { +. . . . Offset: 143 +. . . . Line: 8 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: Name { +. . . . . Roles: Left,Identifier,Expression +. . . . . TOKEN "var1" +. . . . . StartPosition: { +. . . . . . Offset: 143 +. . . . . . Line: 8 +. . . . . . Col: 1 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 146 +. . . . . . Line: 8 +. . . . . . Col: 4 +. . . . . } +. . . . . Properties: { +. . . . . . ctx: Store +. . . . . . internalRole: targets +. . . . . } +. . . . . Children: { +. . . . . . 0: PreviousNoops { +. . . . . . . Roles: Whitespace +. . . . . . . StartPosition: { +. . . . . . . . Offset: 142 +. . . . . . . . Line: 7 +. . . . . . . . Col: 1 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 142 +. . . . . . . . Line: 7 +. . . . . . . . Col: 1 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . internalRole: noops_previous +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: NoopLine { +. . . . . . . . . Roles: Comment +. . . . . . . . . TOKEN " +" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 142 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: lines +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . . 1: NoneLiteral { +. . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . TOKEN "None" +. . . . . StartPosition: { +. . . . . . Offset: 150 +. . . . . . Line: 8 +. . . . . . Col: 8 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 153 +. . . . . . Line: 8 +. . . . . . Col: 11 +. . . . . } +. . . . . Properties: { +. . . . . . internalRole: value +. . . . . . value: +. . . . . } +. . . . } +. . . } +. . } +. . 7: Assign { +. . . Roles: Binary,Assignment,Expression +. . . StartPosition: { +. . . . Offset: 155 +. . . . Line: 9 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: Name { +. . . . . Roles: Left,Identifier,Expression +. . . . . TOKEN "var2" +. . . . . StartPosition: { +. . . . . . Offset: 155 +. . . . . . Line: 9 +. . . . . . Col: 1 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 158 +. . . . . . Line: 9 +. . . . . . Col: 4 +. . . . . } +. . . . . Properties: { +. . . . . . ctx: Store +. . . . . . internalRole: targets +. . . . . } +. . . . } +. . . . 1: NoneLiteral { +. . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . TOKEN "None" +. . . . . StartPosition: { +. . . . . . Offset: 162 +. . . . . . Line: 9 +. . . . . . Col: 8 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 165 +. . . . . . Line: 9 +. . . . . . Col: 11 +. . . . . } +. . . . . Properties: { +. . . . . . internalRole: value +. . . . . . value: +. . . . . } +. . . . } +. . . } +. . } +. . 8: ClassDef { +. . . Roles: Type,Declaration,Identifier,Statement +. . . TOKEN "class1" +. . . StartPosition: { +. . . . Offset: 174 +. . . . Line: 11 +. . . . Col: 7 +. . . } +. . . EndPosition: { +. . . . Offset: 179 +. . . . Line: 11 +. . . . Col: 12 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: ClassDef.body { +. . . . . Roles: Type,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Assign { +. . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . StartPosition: { +. . . . . . . . Offset: 183 +. . . . . . . . Line: 12 +. . . . . . . . Col: 2 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Name { +. . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . TOKEN "var11" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 183 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 2 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 187 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 6 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . ctx: Store +. . . . . . . . . . internalRole: targets +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 167 +. . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 167 +. . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 167 +. . . . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: NoneLiteral { +. . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . TOKEN "None" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 191 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 10 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 194 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 13 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . . value: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 1: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "__init__" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 202 +. . . . . . . . Line: 14 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 209 +. . . . . . . . Line: 14 +. . . . . . . . Col: 13 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 211 +. . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 214 +. . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . Col: 18 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 196 +. . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 196 +. . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 196 +. . . . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 220 +. . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Attribute { +. . . . . . . . . . . . . Roles: Identifier,Expression,Left +. . . . . . . . . . . . . TOKEN "var101" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 225 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 230 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 13 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . . . Roles: Identifier,Qualified,Identifier,Expression +. . . . . . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 220 +. . . . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 223 +. . . . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 234 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 17 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 237 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 20 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 2: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func11" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 245 +. . . . . . . . Line: 17 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 250 +. . . . . . . . Line: 17 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 252 +. . . . . . . . . . . . Line: 17 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 255 +. . . . . . . . . . . . Line: 17 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 239 +. . . . . . . . . . . . . . Line: 16 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 239 +. . . . . . . . . . . . . . Line: 16 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 239 +. . . . . . . . . . . . . . . . Line: 16 +. . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 261 +. . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Attribute { +. . . . . . . . . . . . . Roles: Identifier,Expression,Left +. . . . . . . . . . . . . TOKEN "var111" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 268 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 10 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 273 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 15 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . . . Roles: Identifier,Qualified,Identifier,Expression +. . . . . . . . . . . . . . . TOKEN "class1" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 261 +. . . . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 266 +. . . . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 277 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 19 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 280 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 22 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 284 +. . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Attribute { +. . . . . . . . . . . . . Roles: Identifier,Expression,Left +. . . . . . . . . . . . . TOKEN "var112" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 289 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 294 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 13 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . . . Roles: Identifier,Qualified,Identifier,Expression +. . . . . . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 284 +. . . . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 287 +. . . . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 298 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 17 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 301 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 20 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 2: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 305 +. . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . . . . . TOKEN "var113" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 305 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 310 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 314 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 12 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 317 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 15 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 3: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func12" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 325 +. . . . . . . . Line: 22 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 330 +. . . . . . . . Line: 22 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: FunctionDef { +. . . . . . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . . . . . TOKEN "func121" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 341 +. . . . . . . . . . . . Line: 23 +. . . . . . . . . . . . Col: 7 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 347 +. . . . . . . . . . . . Line: 23 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . returns: +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: FunctionDef.body { +. . . . . . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . promotedPropertyList: true +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Pass { +. . . . . . . . . . . . . . . Roles: Noop,Statement +. . . . . . . . . . . . . . . TOKEN "pass" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 355 +. . . . . . . . . . . . . . . . Line: 24 +. . . . . . . . . . . . . . . . Col: 4 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 358 +. . . . . . . . . . . . . . . . Line: 24 +. . . . . . . . . . . . . . . . Col: 7 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . . . Offset: 319 +. . . . . . . . . . . . . . . . . . Line: 21 +. . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . . . Offset: 319 +. . . . . . . . . . . . . . . . . . Line: 21 +. . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . . . . . Offset: 319 +. . . . . . . . . . . . . . . . . . . . Line: 21 +. . . . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: arguments { +. . . . . . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: args +. . . . . . . . . . . . . . kwarg: +. . . . . . . . . . . . . . vararg: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 9: ClassDef { +. . . Roles: Type,Declaration,Identifier,Statement +. . . TOKEN "class2" +. . . StartPosition: { +. . . . Offset: 367 +. . . . Line: 26 +. . . . Col: 7 +. . . } +. . . EndPosition: { +. . . . Offset: 372 +. . . . Line: 26 +. . . . Col: 12 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: ClassDef.body { +. . . . . Roles: Type,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Assign { +. . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . StartPosition: { +. . . . . . . . Offset: 376 +. . . . . . . . Line: 27 +. . . . . . . . Col: 2 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Name { +. . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . TOKEN "var21" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 376 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 2 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 380 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 6 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . ctx: Store +. . . . . . . . . . internalRole: targets +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 360 +. . . . . . . . . . . . Line: 25 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 360 +. . . . . . . . . . . . Line: 25 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 360 +. . . . . . . . . . . . . . Line: 25 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: NoneLiteral { +. . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . TOKEN "None" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 384 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 10 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 387 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 13 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . . value: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 1: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func21" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 394 +. . . . . . . . Line: 28 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 399 +. . . . . . . . Line: 28 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 401 +. . . . . . . . . . . . Line: 28 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 404 +. . . . . . . . . . . . Line: 28 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Expr { +. . . . . . . . . . . Roles: Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 410 +. . . . . . . . . . . . Line: 29 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 410 +. . . . . . . . . . . . . . Line: 29 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 413 +. . . . . . . . . . . . . . Line: 29 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 2: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func22" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 420 +. . . . . . . . Line: 30 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 425 +. . . . . . . . Line: 30 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 427 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 430 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "arg1" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 433 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 19 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 436 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 22 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Expr { +. . . . . . . . . . . Roles: Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 442 +. . . . . . . . . . . . Line: 31 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 442 +. . . . . . . . . . . . . . Line: 31 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 445 +. . . . . . . . . . . . . . Line: 31 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 3: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func23" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 452 +. . . . . . . . Line: 32 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 457 +. . . . . . . . Line: 32 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Expr { +. . . . . . . . . . . Roles: Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 464 +. . . . . . . . . . . . Line: 33 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 464 +. . . . . . . . . . . . . . Line: 33 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 467 +. . . . . . . . . . . . . . Line: 33 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 10: ClassDef { +. . . Roles: Type,Declaration,Identifier,Statement +. . . TOKEN "class3" +. . . StartPosition: { +. . . . Offset: 476 +. . . . Line: 35 +. . . . Col: 7 +. . . } +. . . EndPosition: { +. . . . Offset: 481 +. . . . Line: 35 +. . . . Col: 12 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: ClassDef.body { +. . . . . Roles: Type,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Pass { +. . . . . . . Roles: Noop,Statement +. . . . . . . TOKEN "pass" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 485 +. . . . . . . . Line: 36 +. . . . . . . . Col: 2 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 488 +. . . . . . . . Line: 36 +. . . . . . . . Col: 5 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: PreviousNoops { +. . . . . . . . . Roles: Whitespace +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 469 +. . . . . . . . . . Line: 34 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 469 +. . . . . . . . . . Line: 34 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: noops_previous +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . Roles: Comment +. . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 469 +. . . . . . . . . . . . Line: 34 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. } +} + diff --git a/fixtures/issue96.py.source b/fixtures/issue96.py.source new file mode 100644 index 00000000..e69de29b diff --git a/fixtures/issue96.py.uast b/fixtures/issue96.py.uast new file mode 100644 index 00000000..841c99e8 --- /dev/null +++ b/fixtures/issue96.py.uast @@ -0,0 +1,1391 @@ +Status: ok +Errors: +UAST: +Module { +. Roles: File,Module +. Children: { +. . 0: Import { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 0 +. . . . Line: 1 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib1" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 1: Import { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 12 +. . . . Line: 2 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib2.lib21" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 2: Import { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 30 +. . . . Line: 3 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib3" +. . . . . Properties: { +. . . . . . alias.asname: lib3_alias +. . . . . . internalRole: names +. . . . . } +. . . . . Children: { +. . . . . . 0: alias.asname { +. . . . . . . Roles: Import,Alias,Identifier +. . . . . . . TOKEN "lib3_alias" +. . . . . . . Properties: { +. . . . . . . . promotedPropertyString: true +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 3: ImportFrom { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 61 +. . . . Line: 4 +. . . . Col: 6 +. . . } +. . . EndPosition: { +. . . . Offset: 64 +. . . . Line: 4 +. . . . Col: 9 +. . . } +. . . Properties: { +. . . . ImportFrom.module: lib4 +. . . . internalRole: body +. . . . level: 0 +. . . } +. . . Children: { +. . . . 0: ImportFrom.module { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib4" +. . . . . Properties: { +. . . . . . promotedPropertyString: true +. . . . . } +. . . . } +. . . . 1: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib41" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 4: ImportFrom { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 79 +. . . . Line: 5 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . ImportFrom.module: lib5.lib51 +. . . . internalRole: body +. . . . level: 0 +. . . } +. . . Children: { +. . . . 0: ImportFrom.module { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib5.lib51" +. . . . . Properties: { +. . . . . . promotedPropertyString: true +. . . . . } +. . . . } +. . . . 1: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib511" +. . . . . Properties: { +. . . . . . asname: +. . . . . . internalRole: names +. . . . . } +. . . . } +. . . } +. . } +. . 5: ImportFrom { +. . . Roles: Import,Declaration,Statement +. . . StartPosition: { +. . . . Offset: 114 +. . . . Line: 6 +. . . . Col: 6 +. . . } +. . . EndPosition: { +. . . . Offset: 117 +. . . . Line: 6 +. . . . Col: 9 +. . . } +. . . Properties: { +. . . . ImportFrom.module: lib6 +. . . . internalRole: body +. . . . level: 0 +. . . } +. . . Children: { +. . . . 0: ImportFrom.module { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib6" +. . . . . Properties: { +. . . . . . promotedPropertyString: true +. . . . . } +. . . . } +. . . . 1: alias { +. . . . . Roles: Import,Pathname,Identifier +. . . . . TOKEN "lib61" +. . . . . Properties: { +. . . . . . alias.asname: lib611 +. . . . . . internalRole: names +. . . . . } +. . . . . Children: { +. . . . . . 0: alias.asname { +. . . . . . . Roles: Import,Alias,Identifier +. . . . . . . TOKEN "lib611" +. . . . . . . Properties: { +. . . . . . . . promotedPropertyString: true +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 6: Assign { +. . . Roles: Binary,Assignment,Expression +. . . StartPosition: { +. . . . Offset: 143 +. . . . Line: 8 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: Name { +. . . . . Roles: Left,Identifier,Expression +. . . . . TOKEN "var1" +. . . . . StartPosition: { +. . . . . . Offset: 143 +. . . . . . Line: 8 +. . . . . . Col: 1 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 146 +. . . . . . Line: 8 +. . . . . . Col: 4 +. . . . . } +. . . . . Properties: { +. . . . . . ctx: Store +. . . . . . internalRole: targets +. . . . . } +. . . . . Children: { +. . . . . . 0: PreviousNoops { +. . . . . . . Roles: Whitespace +. . . . . . . StartPosition: { +. . . . . . . . Offset: 142 +. . . . . . . . Line: 7 +. . . . . . . . Col: 1 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 142 +. . . . . . . . Line: 7 +. . . . . . . . Col: 1 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . internalRole: noops_previous +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: NoopLine { +. . . . . . . . . Roles: Comment +. . . . . . . . . TOKEN " +" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 142 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: lines +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . . 1: NoneLiteral { +. . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . TOKEN "None" +. . . . . StartPosition: { +. . . . . . Offset: 150 +. . . . . . Line: 8 +. . . . . . Col: 8 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 153 +. . . . . . Line: 8 +. . . . . . Col: 11 +. . . . . } +. . . . . Properties: { +. . . . . . internalRole: value +. . . . . . value: +. . . . . } +. . . . } +. . . } +. . } +. . 7: Assign { +. . . Roles: Binary,Assignment,Expression +. . . StartPosition: { +. . . . Offset: 155 +. . . . Line: 9 +. . . . Col: 1 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: Name { +. . . . . Roles: Left,Identifier,Expression +. . . . . TOKEN "var2" +. . . . . StartPosition: { +. . . . . . Offset: 155 +. . . . . . Line: 9 +. . . . . . Col: 1 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 158 +. . . . . . Line: 9 +. . . . . . Col: 4 +. . . . . } +. . . . . Properties: { +. . . . . . ctx: Store +. . . . . . internalRole: targets +. . . . . } +. . . . } +. . . . 1: NoneLiteral { +. . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . TOKEN "None" +. . . . . StartPosition: { +. . . . . . Offset: 162 +. . . . . . Line: 9 +. . . . . . Col: 8 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 165 +. . . . . . Line: 9 +. . . . . . Col: 11 +. . . . . } +. . . . . Properties: { +. . . . . . internalRole: value +. . . . . . value: +. . . . . } +. . . . } +. . . } +. . } +. . 8: ClassDef { +. . . Roles: Type,Declaration,Identifier,Statement +. . . TOKEN "class1" +. . . StartPosition: { +. . . . Offset: 174 +. . . . Line: 11 +. . . . Col: 7 +. . . } +. . . EndPosition: { +. . . . Offset: 179 +. . . . Line: 11 +. . . . Col: 12 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: ClassDef.body { +. . . . . Roles: Type,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Assign { +. . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . StartPosition: { +. . . . . . . . Offset: 183 +. . . . . . . . Line: 12 +. . . . . . . . Col: 2 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Name { +. . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . TOKEN "var11" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 183 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 2 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 187 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 6 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . ctx: Store +. . . . . . . . . . internalRole: targets +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 167 +. . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 167 +. . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 167 +. . . . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: NoneLiteral { +. . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . TOKEN "None" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 191 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 10 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 194 +. . . . . . . . . . Line: 12 +. . . . . . . . . . Col: 13 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . . value: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 1: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "__init__" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 202 +. . . . . . . . Line: 14 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 209 +. . . . . . . . Line: 14 +. . . . . . . . Col: 13 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 211 +. . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . Col: 15 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 214 +. . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . Col: 18 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 196 +. . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 196 +. . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 196 +. . . . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 220 +. . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Attribute { +. . . . . . . . . . . . . Roles: Identifier,Expression,Left +. . . . . . . . . . . . . TOKEN "var101" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 225 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 230 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 13 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . . . Roles: Identifier,Qualified,Identifier,Expression +. . . . . . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 220 +. . . . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 223 +. . . . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 234 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 17 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 237 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 20 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 2: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func11" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 245 +. . . . . . . . Line: 17 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 250 +. . . . . . . . Line: 17 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 252 +. . . . . . . . . . . . Line: 17 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 255 +. . . . . . . . . . . . Line: 17 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 239 +. . . . . . . . . . . . . . Line: 16 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 239 +. . . . . . . . . . . . . . Line: 16 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 239 +. . . . . . . . . . . . . . . . Line: 16 +. . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 261 +. . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Attribute { +. . . . . . . . . . . . . Roles: Identifier,Expression,Left +. . . . . . . . . . . . . TOKEN "var111" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 268 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 10 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 273 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 15 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . . . Roles: Identifier,Qualified,Identifier,Expression +. . . . . . . . . . . . . . . TOKEN "class1" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 261 +. . . . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 266 +. . . . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 277 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 19 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 280 +. . . . . . . . . . . . . . Line: 18 +. . . . . . . . . . . . . . Col: 22 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 284 +. . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Attribute { +. . . . . . . . . . . . . Roles: Identifier,Expression,Left +. . . . . . . . . . . . . TOKEN "var112" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 289 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 294 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 13 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . . . Roles: Identifier,Qualified,Identifier,Expression +. . . . . . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 284 +. . . . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 287 +. . . . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . ctx: Load +. . . . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 298 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 17 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 301 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 20 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 2: Assign { +. . . . . . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 305 +. . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: Name { +. . . . . . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . . . . . TOKEN "var113" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 305 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 310 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 8 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . ctx: Store +. . . . . . . . . . . . . . internalRole: targets +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 314 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 12 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 317 +. . . . . . . . . . . . . . Line: 20 +. . . . . . . . . . . . . . Col: 15 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 3: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func12" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 325 +. . . . . . . . Line: 22 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 330 +. . . . . . . . Line: 22 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: FunctionDef { +. . . . . . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . . . . . TOKEN "func121" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 341 +. . . . . . . . . . . . Line: 23 +. . . . . . . . . . . . Col: 7 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 347 +. . . . . . . . . . . . Line: 23 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . returns: +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: FunctionDef.body { +. . . . . . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . promotedPropertyList: true +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . 0: Pass { +. . . . . . . . . . . . . . . Roles: Noop,Statement +. . . . . . . . . . . . . . . TOKEN "pass" +. . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . Offset: 355 +. . . . . . . . . . . . . . . . Line: 24 +. . . . . . . . . . . . . . . . Col: 4 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 358 +. . . . . . . . . . . . . . . . Line: 24 +. . . . . . . . . . . . . . . . Col: 7 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . . . Offset: 319 +. . . . . . . . . . . . . . . . . . Line: 21 +. . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . . . Offset: 319 +. . . . . . . . . . . . . . . . . . Line: 21 +. . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . Children: { +. . . . . . . . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . . . . . . . Offset: 319 +. . . . . . . . . . . . . . . . . . . . Line: 21 +. . . . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . } +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . . 1: arguments { +. . . . . . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: args +. . . . . . . . . . . . . . kwarg: +. . . . . . . . . . . . . . vararg: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 9: ClassDef { +. . . Roles: Type,Declaration,Identifier,Statement +. . . TOKEN "class2" +. . . StartPosition: { +. . . . Offset: 367 +. . . . Line: 26 +. . . . Col: 7 +. . . } +. . . EndPosition: { +. . . . Offset: 372 +. . . . Line: 26 +. . . . Col: 12 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: ClassDef.body { +. . . . . Roles: Type,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Assign { +. . . . . . . Roles: Binary,Assignment,Expression +. . . . . . . StartPosition: { +. . . . . . . . Offset: 376 +. . . . . . . . Line: 27 +. . . . . . . . Col: 2 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: Name { +. . . . . . . . . Roles: Left,Identifier,Expression +. . . . . . . . . TOKEN "var21" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 376 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 2 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 380 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 6 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . ctx: Store +. . . . . . . . . . internalRole: targets +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: PreviousNoops { +. . . . . . . . . . . Roles: Whitespace +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 360 +. . . . . . . . . . . . Line: 25 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 360 +. . . . . . . . . . . . Line: 25 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: noops_previous +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . . . Roles: Comment +. . . . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 360 +. . . . . . . . . . . . . . Line: 25 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: NoneLiteral { +. . . . . . . . . Roles: Literal,Null,Expression,Primitive,Right +. . . . . . . . . TOKEN "None" +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 384 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 10 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 387 +. . . . . . . . . . Line: 27 +. . . . . . . . . . Col: 13 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: value +. . . . . . . . . . value: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 1: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func21" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 394 +. . . . . . . . Line: 28 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 399 +. . . . . . . . Line: 28 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 401 +. . . . . . . . . . . . Line: 28 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 404 +. . . . . . . . . . . . Line: 28 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Expr { +. . . . . . . . . . . Roles: Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 410 +. . . . . . . . . . . . Line: 29 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 410 +. . . . . . . . . . . . . . Line: 29 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 413 +. . . . . . . . . . . . . . Line: 29 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 2: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func22" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 420 +. . . . . . . . Line: 30 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 425 +. . . . . . . . Line: 30 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "self" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 427 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 430 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . . 1: arg { +. . . . . . . . . . . Roles: Function,Declaration,Argument,Name,Identifier +. . . . . . . . . . . TOKEN "arg1" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 433 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 19 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 436 +. . . . . . . . . . . . Line: 30 +. . . . . . . . . . . . Col: 22 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . annotation: +. . . . . . . . . . . . internalRole: args +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Expr { +. . . . . . . . . . . Roles: Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 442 +. . . . . . . . . . . . Line: 31 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 442 +. . . . . . . . . . . . . . Line: 31 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 445 +. . . . . . . . . . . . . . Line: 31 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . . 3: FunctionDef { +. . . . . . . Roles: Function,Declaration,Name,Identifier +. . . . . . . TOKEN "func23" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 452 +. . . . . . . . Line: 32 +. . . . . . . . Col: 6 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 457 +. . . . . . . . Line: 32 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . Properties: { +. . . . . . . . returns: +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: FunctionDef.body { +. . . . . . . . . Roles: Function,Declaration,Body +. . . . . . . . . Properties: { +. . . . . . . . . . promotedPropertyList: true +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: Expr { +. . . . . . . . . . . Roles: Expression +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 464 +. . . . . . . . . . . . Line: 33 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } +. . . . . . . . . . . Children: { +. . . . . . . . . . . . 0: NoneLiteral { +. . . . . . . . . . . . . Roles: Literal,Null,Expression,Primitive +. . . . . . . . . . . . . TOKEN "None" +. . . . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . . . Offset: 464 +. . . . . . . . . . . . . . Line: 33 +. . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 467 +. . . . . . . . . . . . . . Line: 33 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . Properties: { +. . . . . . . . . . . . . . internalRole: value +. . . . . . . . . . . . . . value: +. . . . . . . . . . . . . } +. . . . . . . . . . . . } +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . . 1: arguments { +. . . . . . . . . Roles: Function,Declaration,Incomplete,Argument +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: args +. . . . . . . . . . kwarg: +. . . . . . . . . . vararg: +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. . 10: ClassDef { +. . . Roles: Type,Declaration,Identifier,Statement +. . . TOKEN "class3" +. . . StartPosition: { +. . . . Offset: 476 +. . . . Line: 35 +. . . . Col: 7 +. . . } +. . . EndPosition: { +. . . . Offset: 481 +. . . . Line: 35 +. . . . Col: 12 +. . . } +. . . Properties: { +. . . . internalRole: body +. . . } +. . . Children: { +. . . . 0: ClassDef.body { +. . . . . Roles: Type,Declaration,Body +. . . . . Properties: { +. . . . . . promotedPropertyList: true +. . . . . } +. . . . . Children: { +. . . . . . 0: Pass { +. . . . . . . Roles: Noop,Statement +. . . . . . . TOKEN "pass" +. . . . . . . StartPosition: { +. . . . . . . . Offset: 485 +. . . . . . . . Line: 36 +. . . . . . . . Col: 2 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 488 +. . . . . . . . Line: 36 +. . . . . . . . Col: 5 +. . . . . . . } +. . . . . . . Children: { +. . . . . . . . 0: PreviousNoops { +. . . . . . . . . Roles: Whitespace +. . . . . . . . . StartPosition: { +. . . . . . . . . . Offset: 469 +. . . . . . . . . . Line: 34 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 469 +. . . . . . . . . . Line: 34 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . Properties: { +. . . . . . . . . . internalRole: noops_previous +. . . . . . . . . } +. . . . . . . . . Children: { +. . . . . . . . . . 0: NoopLine { +. . . . . . . . . . . Roles: Comment +. . . . . . . . . . . TOKEN " +" +. . . . . . . . . . . StartPosition: { +. . . . . . . . . . . . Offset: 469 +. . . . . . . . . . . . Line: 34 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } +. . . . . . . . . . . Properties: { +. . . . . . . . . . . . internalRole: lines +. . . . . . . . . . . } +. . . . . . . . . . } +. . . . . . . . . } +. . . . . . . . } +. . . . . . . } +. . . . . . } +. . . . . } +. . . . } +. . . } +. . } +. } +} + diff --git a/native/python_package/python_driver/astimprove.py b/native/python_package/python_driver/astimprove.py index f4caca14..31ba71be 100644 --- a/native/python_package/python_driver/astimprove.py +++ b/native/python_package/python_driver/astimprove.py @@ -503,9 +503,7 @@ def visit_Num(self, node): return node def visit_NoneType(self, node): - if node: - ret = node - + ret = node if node else {} ret.update({"LiteralValue": "None", "ast_type": "NoneLiteral"}) return ret From c46ce1e979f8b807d0a599244e1602ba80c20ee3 Mon Sep 17 00:00:00 2001 From: Juanjo Alvarez Date: Wed, 4 Oct 2017 15:33:27 +0200 Subject: [PATCH 3/3] Fixed empty integration test file. Signed-off-by: Juanjo Alvarez --- fixtures/issue96.py.native | 716 +++++++++++++++++++++++++++++++++++++ fixtures/issue96.py.source | 36 ++ 2 files changed, 752 insertions(+) create mode 100644 fixtures/issue96.py.native diff --git a/fixtures/issue96.py.native b/fixtures/issue96.py.native new file mode 100644 index 00000000..752a63c4 --- /dev/null +++ b/fixtures/issue96.py.native @@ -0,0 +1,716 @@ +{ + "status": "ok", + "errors": [], + "ast": { + "PY3AST": { + "ast_type": "Module", + "body": [ + { + "ast_type": "Import", + "col_offset": 1, + "lineno": 1, + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib1" + } + ] + }, + { + "ast_type": "Import", + "col_offset": 1, + "lineno": 2, + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib2.lib21" + } + ] + }, + { + "ast_type": "Import", + "col_offset": 1, + "lineno": 3, + "names": [ + { + "asname": "lib3_alias", + "ast_type": "alias", + "name": "lib3" + } + ] + }, + { + "ast_type": "ImportFrom", + "col_offset": 6, + "end_col_offset": 9, + "end_lineno": 4, + "level": 0, + "lineno": 4, + "module": "lib4", + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib41" + } + ] + }, + { + "ast_type": "ImportFrom", + "col_offset": 1, + "level": 0, + "lineno": 5, + "module": "lib5.lib51", + "names": [ + { + "asname": null, + "ast_type": "alias", + "name": "lib511" + } + ] + }, + { + "ast_type": "ImportFrom", + "col_offset": 6, + "end_col_offset": 9, + "end_lineno": 6, + "level": 0, + "lineno": 6, + "module": "lib6", + "names": [ + { + "asname": "lib611", + "ast_type": "alias", + "name": "lib61" + } + ] + }, + { + "ast_type": "Assign", + "col_offset": 1, + "lineno": 8, + "targets": [ + { + "ast_type": "Name", + "col_offset": 1, + "ctx": "Store", + "end_col_offset": 4, + "end_lineno": 8, + "id": "var1", + "lineno": 8, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 7, + "lineno": 7, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 7, + "noop_line": "\n" + } + ] + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 8, + "end_col_offset": 11, + "end_lineno": 8, + "lineno": 8, + "value": null + } + }, + { + "ast_type": "Assign", + "col_offset": 1, + "lineno": 9, + "targets": [ + { + "ast_type": "Name", + "col_offset": 1, + "ctx": "Store", + "end_col_offset": 4, + "end_lineno": 9, + "id": "var2", + "lineno": 9 + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 8, + "end_col_offset": 11, + "end_lineno": 9, + "lineno": 9, + "value": null + } + }, + { + "ast_type": "ClassDef", + "bases": [], + "body": [ + { + "ast_type": "Assign", + "col_offset": 2, + "lineno": 12, + "targets": [ + { + "ast_type": "Name", + "col_offset": 2, + "ctx": "Store", + "end_col_offset": 6, + "end_lineno": 12, + "id": "var11", + "lineno": 12, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 10, + "lineno": 10, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 10, + "noop_line": "\n" + } + ] + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 10, + "end_col_offset": 13, + "end_lineno": 12, + "lineno": 12, + "value": null + } + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 15, + "end_col_offset": 18, + "end_lineno": 14, + "lineno": 14, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 13, + "lineno": 13, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 13, + "noop_line": "\n" + } + ] + } + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 15, + "targets": [ + { + "ast_type": "Attribute", + "attr": "var101", + "col_offset": 8, + "ctx": "Store", + "end_col_offset": 13, + "end_lineno": 15, + "lineno": 15, + "value": { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Load", + "end_col_offset": 6, + "end_lineno": 15, + "id": "self", + "lineno": 15 + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 17, + "end_col_offset": 20, + "end_lineno": 15, + "lineno": 15, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 13, + "end_lineno": 14, + "lineno": 14, + "name": "__init__", + "returns": null + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 13, + "end_col_offset": 16, + "end_lineno": 17, + "lineno": 17, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 16, + "lineno": 16, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 16, + "noop_line": "\n" + } + ] + } + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 18, + "targets": [ + { + "ast_type": "Attribute", + "attr": "var111", + "col_offset": 10, + "ctx": "Store", + "end_col_offset": 15, + "end_lineno": 18, + "lineno": 18, + "value": { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Load", + "end_col_offset": 8, + "end_lineno": 18, + "id": "class1", + "lineno": 18 + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 19, + "end_col_offset": 22, + "end_lineno": 18, + "lineno": 18, + "value": null + } + }, + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 19, + "targets": [ + { + "ast_type": "Attribute", + "attr": "var112", + "col_offset": 8, + "ctx": "Store", + "end_col_offset": 13, + "end_lineno": 19, + "lineno": 19, + "value": { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Load", + "end_col_offset": 6, + "end_lineno": 19, + "id": "self", + "lineno": 19 + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 17, + "end_col_offset": 20, + "end_lineno": 19, + "lineno": 19, + "value": null + } + }, + { + "ast_type": "Assign", + "col_offset": 3, + "lineno": 20, + "targets": [ + { + "ast_type": "Name", + "col_offset": 3, + "ctx": "Store", + "end_col_offset": 8, + "end_lineno": 20, + "id": "var113", + "lineno": 20 + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 12, + "end_col_offset": 15, + "end_lineno": 20, + "lineno": 20, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 17, + "lineno": 17, + "name": "func11", + "returns": null + }, + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Pass", + "col_offset": 4, + "end_col_offset": 7, + "end_lineno": 24, + "lineno": 24, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 21, + "lineno": 21, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 21, + "noop_line": "\n" + } + ] + } + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 13, + "end_lineno": 23, + "lineno": 23, + "name": "func121", + "returns": null + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 22, + "lineno": 22, + "name": "func12", + "returns": null + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 12, + "end_lineno": 11, + "keywords": [], + "lineno": 11, + "name": "class1" + }, + { + "ast_type": "ClassDef", + "bases": [], + "body": [ + { + "ast_type": "Assign", + "col_offset": 2, + "lineno": 27, + "targets": [ + { + "ast_type": "Name", + "col_offset": 2, + "ctx": "Store", + "end_col_offset": 6, + "end_lineno": 27, + "id": "var21", + "lineno": 27, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 25, + "lineno": 25, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 25, + "noop_line": "\n" + } + ] + } + } + ], + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 10, + "end_col_offset": 13, + "end_lineno": 27, + "lineno": 27, + "value": null + } + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 13, + "end_col_offset": 16, + "end_lineno": 28, + "lineno": 28 + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Expr", + "col_offset": 3, + "lineno": 29, + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 3, + "end_col_offset": 6, + "end_lineno": 29, + "lineno": 29, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 28, + "lineno": 28, + "name": "func21", + "returns": null + }, + { + "args": { + "args": [ + { + "annotation": null, + "arg": "self", + "ast_type": "arg", + "col_offset": 13, + "end_col_offset": 16, + "end_lineno": 30, + "lineno": 30 + }, + { + "annotation": null, + "arg": "arg1", + "ast_type": "arg", + "col_offset": 19, + "end_col_offset": 22, + "end_lineno": 30, + "lineno": 30 + } + ], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Expr", + "col_offset": 3, + "lineno": 31, + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 3, + "end_col_offset": 6, + "end_lineno": 31, + "lineno": 31, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 30, + "lineno": 30, + "name": "func22", + "returns": null + }, + { + "args": { + "args": [], + "ast_type": "arguments", + "defaults": [], + "kw_defaults": [], + "kwarg": null, + "kwonlyargs": [], + "vararg": null + }, + "ast_type": "FunctionDef", + "body": [ + { + "ast_type": "Expr", + "col_offset": 3, + "lineno": 33, + "value": { + "LiteralValue": "None", + "ast_type": "NoneLiteral", + "col_offset": 3, + "end_col_offset": 6, + "end_lineno": 33, + "lineno": 33, + "value": null + } + } + ], + "col_offset": 6, + "decorator_list": [], + "end_col_offset": 11, + "end_lineno": 32, + "lineno": 32, + "name": "func23", + "returns": null + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 12, + "end_lineno": 26, + "keywords": [], + "lineno": 26, + "name": "class2" + }, + { + "ast_type": "ClassDef", + "bases": [], + "body": [ + { + "ast_type": "Pass", + "col_offset": 2, + "end_col_offset": 5, + "end_lineno": 36, + "lineno": 36, + "noops_previous": { + "ast_type": "PreviousNoops", + "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 34, + "lineno": 34, + "lines": [ + { + "ast_type": "NoopLine", + "col_offset": 1, + "lineno": 34, + "noop_line": "\n" + } + ] + } + } + ], + "col_offset": 7, + "decorator_list": [], + "end_col_offset": 12, + "end_lineno": 35, + "keywords": [], + "lineno": 35, + "name": "class3" + } + ] + } + } +} diff --git a/fixtures/issue96.py.source b/fixtures/issue96.py.source index e69de29b..c72e0f04 100644 --- a/fixtures/issue96.py.source +++ b/fixtures/issue96.py.source @@ -0,0 +1,36 @@ +import lib1 +import lib2.lib21 +import lib3 as lib3_alias +from lib4 import lib41 +from lib5.lib51 import lib511 +from lib6 import lib61 as lib611 + +var1 = None +var2 = None + +class class1: + var11 = None + + def __init__(self): + self.var101 = None + + def func11(self): + class1.var111 = None + self.var112 = None + var113 = None + + def func12(): + def func121(): + pass + +class class2: + var21 = None + def func21(self): + None + def func22(self, arg1): + None + def func23(): + None + +class class3: + pass