From f5474e1b08ea25b5241de7a64b2adcd7993ab075 Mon Sep 17 00:00:00 2001 From: Juanjo Alvarez Date: Wed, 26 Jul 2017 17:14:21 +0200 Subject: [PATCH] Add the EndLineKey and EndColumnKey to the driver ToNoder --- Dockerfile.tpl | 2 +- driver/normalizer/parser.go | 2 + native/python_package/requirements.txt | 2 +- native/python_package/setup.py | 2 +- tests/aritmeticops.py.native | 6 +- tests/aritmeticops.py.uast | 254 +++++++---- tests/assert_constant.py.uast | 56 ++- tests/augassign.py.native | 8 - tests/augassign.py.uast | 99 +++-- tests/bitwise.py.uast | 336 ++++++++++----- tests/booleanop.py.native | 6 +- tests/booleanop.py.uast | 252 +++++++---- tests/classdef.py.native | 16 +- tests/classdef.py.uast | 493 ++++++++++++++-------- tests/classdef_inheritance.py.native | 8 +- tests/classdef_inheritance.py.uast | 77 ++-- tests/classdef_metaclass_py2.py.uast | 42 +- tests/classdef_metaclass_py3.py.native | 4 - tests/classdef_metaclass_py3.py.uast | 82 ++-- tests/comments.py.native | 13 +- tests/comments.py.uast | 50 ++- tests/comprehension_dict.py.uast | 105 +++-- tests/comprehension_list.py.uast | 182 +++++--- tests/comprehension_set.py.uast | 98 +++-- tests/declarations_annotated.py.uast | 63 ++- tests/ellipsis.py.uast | 35 +- tests/except.py.uast | 168 +++++--- tests/exec.py.uast | 35 +- tests/for.py.native | 2 - tests/for.py.uast | 100 +++-- tests/functioncalls.py.uast | 238 ++++++++--- tests/functiondef_annotated.py.native | 2 - tests/functiondef_annotated.py.uast | 74 ++-- tests/functiondef_decorated.py.native | 6 +- tests/functiondef_decorated.py.uast | 96 +++-- tests/functiondef_defaultparams.py.native | 6 +- tests/functiondef_defaultparams.py.uast | 81 ++-- tests/functiondef_docstring.py.native | 4 - tests/functiondef_docstring.py.uast | 34 +- tests/functiondef_kwarg.py.native | 4 - tests/functiondef_kwarg.py.uast | 112 +++-- tests/functiondef_simple.py.native | 2 - tests/functiondef_simple.py.uast | 165 +++++--- tests/functiondef_vararg.py.native | 4 - tests/functiondef_vararg.py.uast | 48 ++- tests/hello.py.uast | 35 +- tests/if.py.native | 6 +- tests/if.py.uast | 471 +++++++++++++-------- tests/ifexpression.py.native | 2 +- tests/ifexpression.py.uast | 70 ++- tests/import.py.uast | 77 +++- tests/issue30.py.uast | 63 ++- tests/line_comment.py.native | 9 +- tests/line_comment.py.uast | 32 +- tests/literals_assign.py.native | 85 ++-- tests/literals_assign.py.uast | 415 ++++++++++++------ tests/loop_if.py.native | 2 - tests/loop_if.py.uast | 60 ++- tests/pass.py.native | 15 +- tests/pass.py.uast | 79 ++-- tests/print.py.uast | 35 +- tests/qualified.py.uast | 112 +++-- tests/repr.py.uast | 35 +- tests/sameline.py.uast | 63 ++- tests/sorting.py.native | 15 +- tests/sorting.py.uast | 64 ++- tests/string_fstring.py.native | 4 +- tests/string_fstring.py.uast | 486 ++++++++++++++------- tests/string_normal.py.uast | 35 +- tests/string_triple.py.uast | 35 +- tests/test.py.native | 2 - tests/test.py.uast | 46 +- tests/unary.py.uast | 91 ++-- tests/while.py.native | 2 - tests/while.py.uast | 102 +++-- tests/with.py.uast | 56 ++- 76 files changed, 4037 insertions(+), 2041 deletions(-) diff --git a/Dockerfile.tpl b/Dockerfile.tpl index f789816b..82d52472 100644 --- a/Dockerfile.tpl +++ b/Dockerfile.tpl @@ -3,7 +3,7 @@ MAINTAINER source{d} ARG DEVDEPS=native/dev_deps ARG CONTAINER_DEVDEPS=/tmp/dev_deps -ARG PYDETECTOR_VER=0.11.0 +ARG PYDETECTOR_VER=0.11.1 RUN apk add --no-cache --update python python3 py-pip py2-pip git diff --git a/driver/normalizer/parser.go b/driver/normalizer/parser.go index 76efd988..f92a9a8e 100644 --- a/driver/normalizer/parser.go +++ b/driver/normalizer/parser.go @@ -8,7 +8,9 @@ import ( var ToNoder = &native.ObjectToNoder{ InternalTypeKey: "ast_type", LineKey: "lineno", + EndLineKey: "end_lineno", ColumnKey: "col_offset", + EndColumnKey: "end_col_offset", TokenKeys: map[string]bool{ "module": true, // Module on ImportFrom diff --git a/native/python_package/requirements.txt b/native/python_package/requirements.txt index 1572176f..67a6fce2 100644 --- a/native/python_package/requirements.txt +++ b/native/python_package/requirements.txt @@ -1,3 +1,3 @@ -pydetector-bblfsh==0.11.0 +pydetector-bblfsh==0.11.1 -e git+git://github.com/python/mypy.git@0bb2d1680e8b9522108b38d203cb73021a617e64#egg=mypy-lang typed-ast==1.0.1 diff --git a/native/python_package/setup.py b/native/python_package/setup.py index 8d59ec52..16eff8f6 100644 --- a/native/python_package/setup.py +++ b/native/python_package/setup.py @@ -31,7 +31,7 @@ ] }, install_requires=[ - "pydetector-bblfsh==0.11.0" + "pydetector-bblfsh==0.11.1" ], classifiers=[ "Development Status :: 4 - Beta", diff --git a/tests/aritmeticops.py.native b/tests/aritmeticops.py.native index 951990ed..8216c7db 100644 --- a/tests/aritmeticops.py.native +++ b/tests/aritmeticops.py.native @@ -224,8 +224,6 @@ "op": { "ast_type": "Mod", "col_offset": 1, - "end_col_offset": 1, - "end_lineno": 6, "lineno": 6 }, "right": { @@ -280,8 +278,8 @@ } ], "col_offset": 1, - "end_col_offset": 4, - "end_lineno": 7, + "end_col_offset": 1, + "end_lineno": 8, "lineno": 1, "noops_remainder": { "ast_type": "RemainderNoops", diff --git a/tests/aritmeticops.py.uast b/tests/aritmeticops.py.uast index 073abf7e..83687e66 100644 --- a/tests/aritmeticops.py.uast +++ b/tests/aritmeticops.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 4 -. . end_lineno: 7 +. EndPosition: { +. . Offset: 30 +. . Line: 8 +. . Col: 1 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 2 +. . . . Line: 1 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 2 +. . . . . . Line: 1 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,10 +54,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 1 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -62,9 +72,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 1 +. . . . . . . . Line: 1 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -76,10 +89,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 2 +. . . . . . . . Line: 1 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -94,9 +110,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 6 +. . . . Line: 2 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -107,9 +126,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 6 +. . . . . . Line: 2 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -121,10 +143,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 4 +. . . . . . . . Line: 2 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -136,9 +161,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 5 +. . . . . . . . Line: 2 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -150,10 +178,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 6 +. . . . . . . . Line: 2 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -168,9 +199,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 10 +. . . . Line: 3 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -181,9 +215,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 10 +. . . . . . Line: 3 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -195,10 +232,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 8 +. . . . . . . . Line: 3 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -210,9 +250,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 9 +. . . . . . . . Line: 3 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -224,10 +267,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 10 +. . . . . . . . Line: 3 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -242,9 +288,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 14 +. . . . Line: 4 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -255,9 +304,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 14 +. . . . . . Line: 4 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -269,10 +321,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 12 +. . . . . . . . Line: 4 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -284,9 +339,12 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 13 +. . . . . . . . Line: 4 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -298,10 +356,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 14 +. . . . . . . . Line: 4 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -316,9 +377,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 19 +. . . . Line: 5 +. . . . Col: 4 +. . . } . . . Properties: { -. . . . end_col_offset: 4 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -329,9 +393,12 @@ Module { . . . . . . Line: 5 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 19 +. . . . . . Line: 5 +. . . . . . Col: 4 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 4 -. . . . . . end_lineno: 5 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -343,10 +410,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 5 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -358,9 +428,12 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 18 +. . . . . . . . Line: 5 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -372,10 +445,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 4 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 19 +. . . . . . . . Line: 5 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -390,9 +466,12 @@ Module { . . . . Line: 6 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 23 +. . . . Line: 6 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 6 . . . . internalRole: body . . . } . . . Children: { @@ -403,9 +482,12 @@ Module { . . . . . . Line: 6 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 23 +. . . . . . Line: 6 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 6 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -417,10 +499,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 21 +. . . . . . . . Line: 6 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -433,8 +518,6 @@ Module { . . . . . . . . Col: 1 . . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -446,10 +529,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 23 +. . . . . . . . Line: 6 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -464,9 +550,12 @@ Module { . . . . Line: 7 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 28 +. . . . Line: 7 +. . . . Col: 4 +. . . } . . . Properties: { -. . . . end_col_offset: 4 -. . . . end_lineno: 7 . . . . internalRole: body . . . } . . . Children: { @@ -477,9 +566,12 @@ Module { . . . . . . Line: 7 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 28 +. . . . . . Line: 7 +. . . . . . Col: 4 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 4 -. . . . . . end_lineno: 7 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -491,10 +583,13 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 25 +. . . . . . . . Line: 7 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -506,9 +601,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 27 +. . . . . . . . Line: 7 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -520,10 +618,13 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 4 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 28 +. . . . . . . . Line: 7 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -538,9 +639,12 @@ Module { . . . . Line: 8 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 30 +. . . . Line: 8 +. . . . Col: 1 +. . . } . . . Properties: { -. . . . end_col_offset: 1 -. . . . end_lineno: 8 . . . . internalRole: noops_remainder . . . } . . . Children: { diff --git a/tests/assert_constant.py.uast b/tests/assert_constant.py.uast index 929be77a..b3a30222 100644 --- a/tests/assert_constant.py.uast +++ b/tests/assert_constant.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 29 -. . end_lineno: 3 +. EndPosition: { +. . Offset: 53 +. . Line: 3 +. . Col: 29 . } . Children: { . . 0: Assert { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 10 +. . . . Line: 1 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 11 -. . . . end_lineno: 1 . . . . internalRole: body . . . . msg: . . . } @@ -35,9 +39,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 8 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 10 +. . . . . . Line: 1 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 11 -. . . . . . end_lineno: 1 . . . . . . internalRole: test . . . . . } . . . . } @@ -50,9 +57,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 23 +. . . . Line: 2 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 11 -. . . . end_lineno: 2 . . . . internalRole: body . . . . msg: . . . } @@ -65,9 +75,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 8 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 23 +. . . . . . Line: 2 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 11 -. . . . . . end_lineno: 2 . . . . . . internalRole: test . . . . . } . . . . } @@ -80,9 +93,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 53 +. . . . Line: 3 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 29 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -94,9 +110,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 14 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 53 +. . . . . . Line: 3 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 29 -. . . . . . end_lineno: 3 . . . . . . internalRole: msg . . . . . } . . . . } @@ -108,9 +127,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 8 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 35 +. . . . . . Line: 3 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 11 -. . . . . . end_lineno: 3 . . . . . . internalRole: test . . . . . } . . . . } diff --git a/tests/augassign.py.native b/tests/augassign.py.native index 95ceaaa0..c6c9ac11 100644 --- a/tests/augassign.py.native +++ b/tests/augassign.py.native @@ -14,8 +14,6 @@ "op": { "ast_type": "Add", "col_offset": 1, - "end_col_offset": 1, - "end_lineno": 1, "lineno": 1 }, "target": { @@ -46,8 +44,6 @@ "op": { "ast_type": "Sub", "col_offset": 1, - "end_col_offset": 1, - "end_lineno": 2, "lineno": 2 }, "target": { @@ -78,8 +74,6 @@ "op": { "ast_type": "Mult", "col_offset": 1, - "end_col_offset": 1, - "end_lineno": 3, "lineno": 3 }, "target": { @@ -110,8 +104,6 @@ "op": { "ast_type": "Div", "col_offset": 1, - "end_col_offset": 1, - "end_lineno": 4, "lineno": 4 }, "target": { diff --git a/tests/augassign.py.uast b/tests/augassign.py.uast index 2450a1c6..1f71be4e 100644 --- a/tests/augassign.py.uast +++ b/tests/augassign.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 6 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 26 +. . Line: 4 +. . Col: 6 . } . Children: { . . 0: AugAssign { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 3 . . . } +. . . EndPosition: { +. . . . Offset: 5 +. . . . Line: 1 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -36,8 +40,6 @@ Module { . . . . . . Col: 1 . . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 1 . . . . . . internalRole: op . . . . . } . . . . } @@ -49,10 +51,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 1 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 1 . . . . . . internalRole: target . . . . . } . . . . } @@ -64,10 +69,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 5 +. . . . . . Line: 1 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . } @@ -81,9 +89,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 12 +. . . . Line: 2 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -96,8 +107,6 @@ Module { . . . . . . Col: 1 . . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 2 . . . . . . internalRole: op . . . . . } . . . . } @@ -109,10 +118,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 7 +. . . . . . Line: 2 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 2 . . . . . . internalRole: target . . . . . } . . . . } @@ -124,10 +136,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 12 +. . . . . . Line: 2 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . } @@ -141,9 +156,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 19 +. . . . Line: 3 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -156,8 +174,6 @@ Module { . . . . . . Col: 1 . . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 3 . . . . . . internalRole: op . . . . . } . . . . } @@ -169,10 +185,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 14 +. . . . . . Line: 3 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 3 . . . . . . internalRole: target . . . . . } . . . . } @@ -184,10 +203,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 19 +. . . . . . Line: 3 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . } @@ -201,9 +223,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 26 +. . . . Line: 4 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -216,8 +241,6 @@ Module { . . . . . . Col: 1 . . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 4 . . . . . . internalRole: op . . . . . } . . . . } @@ -229,10 +252,13 @@ Module { . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 21 +. . . . . . Line: 4 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 4 . . . . . . internalRole: target . . . . . } . . . . } @@ -244,10 +270,13 @@ Module { . . . . . . Line: 4 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 26 +. . . . . . Line: 4 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . } diff --git a/tests/bitwise.py.uast b/tests/bitwise.py.uast index 3c67551d..1d0cbd37 100644 --- a/tests/bitwise.py.uast +++ b/tests/bitwise.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 16 -. . end_lineno: 7 +. EndPosition: { +. . Offset: 61 +. . Line: 7 +. . Col: 16 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 4 +. . . . Line: 1 +. . . . Col: 5 +. . . } . . . Properties: { -. . . . end_col_offset: 5 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 4 +. . . . . . Line: 1 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,10 +54,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 1 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -62,9 +72,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 2 +. . . . . . . . Line: 1 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -76,10 +89,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 4 +. . . . . . . . Line: 1 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 5 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -94,9 +110,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 10 +. . . . Line: 2 +. . . . Col: 5 +. . . } . . . Properties: { -. . . . end_col_offset: 5 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -107,9 +126,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 10 +. . . . . . Line: 2 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -121,10 +143,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 6 +. . . . . . . . Line: 2 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -136,9 +161,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 8 +. . . . . . . . Line: 2 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -150,10 +178,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 10 +. . . . . . . . Line: 2 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 5 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -168,9 +199,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 16 +. . . . Line: 3 +. . . . Col: 5 +. . . } . . . Properties: { -. . . . end_col_offset: 5 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -181,9 +215,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 16 +. . . . . . Line: 3 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -195,10 +232,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 12 +. . . . . . . . Line: 3 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -210,9 +250,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 14 +. . . . . . . . Line: 3 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -224,10 +267,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 3 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 5 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -242,9 +288,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 23 +. . . . Line: 4 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -255,9 +304,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 23 +. . . . . . Line: 4 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -269,10 +321,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 18 +. . . . . . . . Line: 4 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -284,9 +339,12 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 21 +. . . . . . . . Line: 4 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -298,10 +356,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 23 +. . . . . . . . Line: 4 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -316,9 +377,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 30 +. . . . Line: 5 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -329,9 +393,12 @@ Module { . . . . . . Line: 5 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 30 +. . . . . . Line: 5 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 5 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -343,10 +410,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 25 +. . . . . . . . Line: 5 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -358,9 +428,12 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 28 +. . . . . . . . Line: 5 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -372,10 +445,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 30 +. . . . . . . . Line: 5 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -390,9 +466,12 @@ Module { . . . . Line: 6 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 44 +. . . . Line: 6 +. . . . Col: 13 +. . . } . . . Properties: { -. . . . end_col_offset: 13 -. . . . end_lineno: 6 . . . . internalRole: body . . . } . . . Children: { @@ -403,9 +482,12 @@ Module { . . . . . . Line: 6 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 44 +. . . . . . Line: 6 +. . . . . . Col: 13 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 13 -. . . . . . end_lineno: 6 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -416,9 +498,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 7 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 40 +. . . . . . . . Line: 6 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: left . . . . . . . } . . . . . . . Children: { @@ -429,9 +514,12 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 36 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . . Children: { @@ -443,10 +531,13 @@ Module { . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 32 +. . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . Col: 1 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . end_col_offset: 1 -. . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . internalRole: left . . . . . . . . . . . } . . . . . . . . . . } @@ -458,9 +549,12 @@ Module { . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 3 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 34 +. . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . internalRole: op . . . . . . . . . . . } . . . . . . . . . . } @@ -472,10 +566,13 @@ Module { . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 36 +. . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . Col: 5 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . internalRole: right . . . . . . . . . . . } . . . . . . . . . . } @@ -489,9 +586,12 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 7 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 38 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 7 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -503,10 +603,13 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 40 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 9 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } @@ -520,9 +623,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 11 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 42 +. . . . . . . . Line: 6 +. . . . . . . . Col: 11 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -534,10 +640,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 13 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 44 +. . . . . . . . Line: 6 +. . . . . . . . Col: 13 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 13 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -552,9 +661,12 @@ Module { . . . . Line: 7 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 61 +. . . . Line: 7 +. . . . Col: 16 +. . . } . . . Properties: { -. . . . end_col_offset: 16 -. . . . end_lineno: 7 . . . . internalRole: body . . . } . . . Children: { @@ -565,9 +677,12 @@ Module { . . . . . . Line: 7 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 61 +. . . . . . Line: 7 +. . . . . . Col: 16 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 16 -. . . . . . end_lineno: 7 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -578,9 +693,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 51 +. . . . . . . . Line: 7 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: left . . . . . . . } . . . . . . . Children: { @@ -592,10 +710,13 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 47 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 2 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 2 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -607,9 +728,12 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 4 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 49 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 4 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -621,10 +745,13 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 51 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 6 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } @@ -638,9 +765,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 54 +. . . . . . . . Line: 7 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -651,9 +781,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 61 +. . . . . . . . Line: 7 +. . . . . . . . Col: 16 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: right . . . . . . . } . . . . . . . Children: { @@ -665,10 +798,13 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 12 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 57 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 12 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 12 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -680,9 +816,12 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 14 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 59 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 14 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -694,10 +833,13 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 16 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 61 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 16 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 16 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } diff --git a/tests/booleanop.py.native b/tests/booleanop.py.native index 2e10b057..d57f0e0d 100644 --- a/tests/booleanop.py.native +++ b/tests/booleanop.py.native @@ -136,7 +136,7 @@ "NumType": "int", "ast_type": "NumLiteral", "col_offset": 6, - "end_col_offset": 9, + "end_col_offset": 6, "end_lineno": 4, "lineno": 4 }, @@ -195,7 +195,7 @@ "NumType": "int", "ast_type": "NumLiteral", "col_offset": 5, - "end_col_offset": 7, + "end_col_offset": 5, "end_lineno": 5, "lineno": 5 }, @@ -254,7 +254,7 @@ "NumType": "int", "ast_type": "NumLiteral", "col_offset": 5, - "end_col_offset": 8, + "end_col_offset": 5, "end_lineno": 6, "lineno": 6 }, diff --git a/tests/booleanop.py.uast b/tests/booleanop.py.uast index bc968ccd..321e0737 100644 --- a/tests/booleanop.py.uast +++ b/tests/booleanop.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 10 -. . end_lineno: 6 +. EndPosition: { +. . Offset: 51 +. . Line: 6 +. . Col: 10 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 5 +. . . . Line: 1 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -32,9 +36,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 5 +. . . . . . Line: 1 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -51,10 +58,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 5 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 6 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -67,10 +77,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 1 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -87,9 +100,10 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 3 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 1 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 3 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 4 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -105,9 +119,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 12 +. . . . Line: 2 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -117,9 +134,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 12 +. . . . . . Line: 2 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -136,10 +156,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 12 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 6 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -152,10 +175,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 7 +. . . . . . . . Line: 2 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -172,9 +198,10 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 3 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 2 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 10 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 4 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -190,9 +217,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 18 +. . . . Line: 3 +. . . . Col: 5 +. . . } . . . Properties: { -. . . . end_col_offset: 5 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -203,9 +233,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 18 +. . . . . . Line: 3 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -217,9 +250,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 3 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -231,10 +267,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 18 +. . . . . . . . Line: 3 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 5 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: operand . . . . . . . } . . . . . . } @@ -249,9 +288,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 30 +. . . . Line: 4 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 11 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -261,9 +303,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 30 +. . . . . . Line: 4 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 11 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -280,10 +325,13 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 25 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 6 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: NumLiteral { @@ -294,10 +342,13 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 11 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 30 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 11 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -310,10 +361,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 20 +. . . . . . . . Line: 4 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -330,9 +384,10 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 3 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 4 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 23 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 4 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: Eq { @@ -343,9 +398,10 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 8 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 4 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 28 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 9 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -361,9 +417,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 40 +. . . . Line: 5 +. . . . Col: 9 +. . . } . . . Properties: { -. . . . end_col_offset: 9 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -373,9 +432,12 @@ Module { . . . . . . Line: 5 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 40 +. . . . . . Line: 5 +. . . . . . Col: 9 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 9 -. . . . . . end_lineno: 5 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -392,10 +454,13 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 36 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: NumLiteral { @@ -406,10 +471,13 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 40 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 9 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -422,10 +490,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 32 +. . . . . . . . Line: 5 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -442,9 +513,10 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 3 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . end_lineno: 5 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 34 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 3 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: Gt { @@ -455,9 +527,10 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 7 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . end_lineno: 5 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 38 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 7 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -473,9 +546,12 @@ Module { . . . . Line: 6 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 51 +. . . . Line: 6 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 6 . . . . internalRole: body . . . } . . . Children: { @@ -485,9 +561,12 @@ Module { . . . . . . Line: 6 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 51 +. . . . . . Line: 6 +. . . . . . Col: 10 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 10 -. . . . . . end_lineno: 6 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -504,10 +583,13 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 46 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 8 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: NumLiteral { @@ -518,10 +600,13 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 10 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 51 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 10 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -534,10 +619,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 42 +. . . . . . . . Line: 6 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -554,9 +642,10 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 3 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . end_lineno: 6 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 44 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 3 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: NotEq { @@ -567,9 +656,10 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 7 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 8 -. . . . . . . . . . end_lineno: 6 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 49 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 8 . . . . . . . . . } . . . . . . . . } . . . . . . . } diff --git a/tests/classdef.py.native b/tests/classdef.py.native index 823f4a77..6f376fa6 100644 --- a/tests/classdef.py.native +++ b/tests/classdef.py.native @@ -160,8 +160,6 @@ { "ast_type": "Pass", "col_offset": 9, - "end_col_offset": 25, - "end_lineno": 6, "lineno": 7 } ], @@ -179,8 +177,6 @@ "ast_type": "arguments", "col_offset": 5, "defaults": [], - "end_col_offset": 25, - "end_lineno": 6, "kw_defaults": [], "kwarg": null, "kwonlyargs": [], @@ -236,8 +232,8 @@ "ast_type": "Name", "col_offset": 6, "ctx": "Load", - "end_col_offset": 22, - "end_lineno": 11, + "end_col_offset": 13, + "end_lineno": 9, "id": "property", "lineno": 9 } @@ -333,15 +329,15 @@ "attr": "setter", "col_offset": 8, "ctx": "Load", - "end_col_offset": 22, - "end_lineno": 15, + "end_col_offset": 13, + "end_lineno": 13, "lineno": 13, "value": { "ast_type": "Name", "col_offset": 6, "ctx": "Load", - "end_col_offset": 22, - "end_lineno": 15, + "end_col_offset": 6, + "end_lineno": 13, "id": "a", "lineno": 13 } diff --git a/tests/classdef.py.uast b/tests/classdef.py.uast index b86712c6..86605741 100644 --- a/tests/classdef.py.uast +++ b/tests/classdef.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 10 -. . end_lineno: 20 +. EndPosition: { +. . Offset: 269 +. . Line: 20 +. . Col: 10 . } . Children: { . . 0: ClassDef { @@ -21,9 +23,12 @@ Module { . . . . Line: 1 . . . . Col: 7 . . . } +. . . EndPosition: { +. . . . Offset: 218 +. . . . Line: 15 +. . . . Col: 22 +. . . } . . . Properties: { -. . . . end_col_offset: 22 -. . . . end_lineno: 15 . . . . internalRole: body . . . } . . . Children: { @@ -41,9 +46,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 70 +. . . . . . . . Line: 4 +. . . . . . . . Col: 13 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 13 -. . . . . . . . end_lineno: 4 . . . . . . . . returns: . . . . . . . } . . . . . . . Children: { @@ -54,9 +62,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 19 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 34 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 21 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 21 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: args . . . . . . . . . . kwarg: . . . . . . . . . . vararg: @@ -70,10 +81,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 18 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 34 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 21 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . annotation: -. . . . . . . . . . . . end_col_offset: 21 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -92,9 +106,10 @@ Module { . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 9 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . . . end_lineno: 3 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 56 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 19 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Attribute { @@ -105,10 +120,13 @@ Module { . . . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . . . Col: 14 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 52 +. . . . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . . . Col: 15 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 15 -. . . . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { @@ -120,10 +138,13 @@ Module { . . . . . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 49 +. . . . . . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . . . . . Col: 12 +. . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . . . end_col_offset: 12 -. . . . . . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . } @@ -137,10 +158,13 @@ Module { . . . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . . . Col: 19 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 56 +. . . . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . . . Col: 19 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -153,9 +177,10 @@ Module { . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . Col: 9 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 13 -. . . . . . . . . . . . end_lineno: 4 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 70 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 13 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Name { @@ -166,10 +191,13 @@ Module { . . . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 66 +. . . . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . . . Col: 9 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . . . end_lineno: 4 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -181,10 +209,13 @@ Module { . . . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . . . Col: 13 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 70 +. . . . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . . . Col: 13 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . end_col_offset: 13 -. . . . . . . . . . . . . . end_lineno: 4 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -202,9 +233,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 97 +. . . . . . . . Line: 6 +. . . . . . . . Col: 25 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 25 -. . . . . . . . end_lineno: 6 . . . . . . . . returns: . . . . . . . } . . . . . . . Children: { @@ -215,9 +249,12 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 17 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 97 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 25 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: args . . . . . . . . . . kwarg: . . . . . . . . . . vararg: @@ -231,10 +268,13 @@ Module { . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 16 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 91 +. . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . Col: 19 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . annotation: -. . . . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -245,9 +285,12 @@ Module { . . . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . . . Col: 0 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . . . internalRole: noops_previous . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { @@ -256,7 +299,7 @@ Module { . . . . . . . . . . . . . . . TOKEN " " . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . Offset: 72 +. . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . . . } @@ -272,14 +315,17 @@ Module { . . . . . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationArgumentName . . . . . . . . . . . TOKEN "arg1" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 94 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 22 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . Col: 25 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . annotation: -. . . . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -294,14 +340,10 @@ Module { . . . . . . . . . . 0: Pass { . . . . . . . . . . . Roles: Noop . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 109 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . Col: 9 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . . . end_lineno: 6 -. . . . . . . . . . . } . . . . . . . . . . } . . . . . . . . . } . . . . . . . . } @@ -311,26 +353,27 @@ Module { . . . . . . . Roles: FunctionDeclaration,FunctionDeclarationName,SimpleIdentifier . . . . . . . TOKEN "a" . . . . . . . StartPosition: { -. . . . . . . . Offset: 119 +. . . . . . . . Offset: 0 . . . . . . . . Line: 9 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 11 +. . . . . . . . Col: 22 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 11 . . . . . . . . returns: . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: arguments { . . . . . . . . . Roles: FunctionDeclarationArgument . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 119 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 5 . . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: args . . . . . . . . . . kwarg: . . . . . . . . . . vararg: @@ -345,27 +388,31 @@ Module { . . . . . . . . . . 0: Return { . . . . . . . . . . . Roles: Return . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 150 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . Col: 9 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . end_lineno: 11 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . Col: 22 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Attribute { . . . . . . . . . . . . . Roles: QualifiedIdentifier . . . . . . . . . . . . . TOKEN "_a" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 162 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . . . Col: 21 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . . . Col: 22 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { @@ -373,27 +420,33 @@ Module { . . . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . . . TOKEN "self" . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . Offset: 157 +. . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . . . . . Col: 16 . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . . . . . Col: 19 +. . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Children: { . . . . . . . . . . . . . . . . 0: PreviousNoops { . . . . . . . . . . . . . . . . . Roles: Whitespace . . . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . . . Offset: 114 +. . . . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . . . Line: 8 . . . . . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . . . . . Line: 8 +. . . . . . . . . . . . . . . . . . Col: 0 +. . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . . . . . . . . . end_lineno: 8 . . . . . . . . . . . . . . . . . . internalRole: noops_previous . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . Children: { @@ -402,7 +455,7 @@ Module { . . . . . . . . . . . . . . . . . . . TOKEN " " . . . . . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . . . . . Offset: 114 +. . . . . . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . . . . . Line: 8 . . . . . . . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . . . . . . . } @@ -429,14 +482,17 @@ Module { . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . TOKEN "property" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 120 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 9 . . . . . . . . . . . . Col: 6 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 9 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . } . . . . . . . . . . } . . . . . . . . . } @@ -447,26 +503,32 @@ Module { . . . . . . . Roles: FunctionDeclaration,FunctionDeclarationName,SimpleIdentifier . . . . . . . TOKEN "a" . . . . . . . StartPosition: { -. . . . . . . . Offset: 170 +. . . . . . . . Offset: 0 . . . . . . . . Line: 13 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 15 +. . . . . . . . Col: 22 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 15 . . . . . . . . returns: . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: arguments { . . . . . . . . . Roles: FunctionDeclarationArgument . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 177 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 13 . . . . . . . . . . Col: 12 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 14 +. . . . . . . . . . Col: 14 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 14 . . . . . . . . . . internalRole: args . . . . . . . . . . kwarg: . . . . . . . . . . vararg: @@ -476,27 +538,33 @@ Module { . . . . . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationArgumentName . . . . . . . . . . . TOKEN "newa" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 190 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 14 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . Col: 14 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . annotation: -. . . . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . . . end_lineno: 14 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: PreviousNoops { . . . . . . . . . . . . . Roles: Whitespace . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 165 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 12 . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 12 +. . . . . . . . . . . . . . Col: 0 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . . . . . end_lineno: 12 . . . . . . . . . . . . . . internalRole: noops_previous . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { @@ -505,7 +573,7 @@ Module { . . . . . . . . . . . . . . . TOKEN " " . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . Offset: 165 +. . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . Line: 12 . . . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . . . } @@ -528,27 +596,31 @@ Module { . . . . . . . . . . 0: Assign { . . . . . . . . . . . Roles: Assignment . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 205 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . Col: 9 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . end_lineno: 15 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . Col: 22 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Attribute { . . . . . . . . . . . . . Roles: AssignmentVariable,QualifiedIdentifier . . . . . . . . . . . . . TOKEN "_a" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 210 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . . . Col: 14 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 15 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 15 -. . . . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { @@ -556,14 +628,17 @@ Module { . . . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . . . TOKEN "self" . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . Offset: 205 +. . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . . . Col: 12 +. . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . . . end_col_offset: 12 -. . . . . . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . } @@ -573,14 +648,17 @@ Module { . . . . . . . . . . . . . Roles: AssignmentValue,SimpleIdentifier . . . . . . . . . . . . . TOKEN "newa" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 215 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . . . Col: 19 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 22 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -597,28 +675,34 @@ Module { . . . . . . . . . . . Roles: QualifiedIdentifier . . . . . . . . . . . TOKEN "setter" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 173 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 13 . . . . . . . . . . . . Col: 8 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . Col: 13 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Name { . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . TOKEN "a" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 171 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 13 +. . . . . . . . . . . . . . Col: 6 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 13 . . . . . . . . . . . . . . Col: 6 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -635,13 +719,16 @@ Module { . . 1: Assign { . . . Roles: Assignment . . . StartPosition: { -. . . . Offset: 221 +. . . . Offset: 0 . . . . Line: 17 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 17 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 17 . . . . internalRole: body . . . } . . . Children: { @@ -649,27 +736,33 @@ Module { . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . TOKEN "a" . . . . . StartPosition: { -. . . . . . Offset: 221 +. . . . . . Offset: 0 +. . . . . . Line: 17 +. . . . . . Col: 1 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 . . . . . . Line: 17 . . . . . . Col: 1 . . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 17 . . . . . . internalRole: targets . . . . . } . . . . . Children: { . . . . . . 0: PreviousNoops { . . . . . . . Roles: Whitespace . . . . . . . StartPosition: { -. . . . . . . . Offset: 220 +. . . . . . . . Offset: 0 . . . . . . . . Line: 16 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 16 +. . . . . . . . Col: 0 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 0 -. . . . . . . . end_lineno: 16 . . . . . . . . internalRole: noops_previous . . . . . . . } . . . . . . . Children: { @@ -678,7 +771,7 @@ Module { . . . . . . . . . TOKEN " " . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 220 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 16 . . . . . . . . . . Col: 1 . . . . . . . . . } @@ -693,13 +786,16 @@ Module { . . . . 1: Call { . . . . . Roles: Call,AssignmentValue . . . . . StartPosition: { -. . . . . . Offset: 226 +. . . . . . Offset: 0 . . . . . . Line: 17 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 17 +. . . . . . Col: 10 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 10 -. . . . . . end_lineno: 17 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -707,14 +803,17 @@ Module { . . . . . . . Roles: CallCallee,CallCallee,SimpleIdentifier . . . . . . . TOKEN "Animal" . . . . . . . StartPosition: { -. . . . . . . . Offset: 225 +. . . . . . . . Offset: 0 . . . . . . . . Line: 17 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 17 +. . . . . . . . Col: 10 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 17 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } @@ -725,13 +824,16 @@ Module { . . 2: Assign { . . . Roles: Assignment . . . StartPosition: { -. . . . Offset: 234 +. . . . Offset: 0 . . . . Line: 18 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 18 +. . . . Col: 7 +. . . } . . . Properties: { -. . . . end_col_offset: 7 -. . . . end_lineno: 18 . . . . internalRole: body . . . } . . . Children: { @@ -739,14 +841,17 @@ Module { . . . . . Roles: AssignmentVariable,QualifiedIdentifier . . . . . TOKEN "b" . . . . . StartPosition: { -. . . . . . Offset: 236 +. . . . . . Offset: 0 +. . . . . . Line: 18 +. . . . . . Col: 3 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 . . . . . . Line: 18 . . . . . . Col: 3 . . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 18 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -754,14 +859,17 @@ Module { . . . . . . . Roles: SimpleIdentifier . . . . . . . TOKEN "a" . . . . . . . StartPosition: { -. . . . . . . . Offset: 234 +. . . . . . . . Offset: 0 +. . . . . . . . Line: 18 +. . . . . . . . Col: 1 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 . . . . . . . . Line: 18 . . . . . . . . Col: 1 . . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 18 . . . . . . . . internalRole: value . . . . . . . } . . . . . . } @@ -771,14 +879,17 @@ Module { . . . . . Roles: NumberLiteral,AssignmentValue . . . . . TOKEN "3" . . . . . StartPosition: { -. . . . . . Offset: 240 +. . . . . . Offset: 0 +. . . . . . Line: 18 +. . . . . . Col: 7 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 . . . . . . Line: 18 . . . . . . Col: 7 . . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 7 -. . . . . . end_lineno: 18 . . . . . . internalRole: value . . . . . } . . . . } @@ -787,13 +898,16 @@ Module { . . 3: Assign { . . . Roles: Assignment . . . StartPosition: { -. . . . Offset: 242 +. . . . Offset: 0 . . . . Line: 19 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 19 +. . . . Col: 17 +. . . } . . . Properties: { -. . . . end_col_offset: 17 -. . . . end_lineno: 19 . . . . internalRole: body . . . } . . . Children: { @@ -801,14 +915,17 @@ Module { . . . . . Roles: AssignmentVariable,QualifiedIdentifier . . . . . TOKEN "g" . . . . . StartPosition: { -. . . . . . Offset: 254 +. . . . . . Offset: 0 +. . . . . . Line: 19 +. . . . . . Col: 13 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 . . . . . . Line: 19 . . . . . . Col: 13 . . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 13 -. . . . . . end_lineno: 19 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -816,14 +933,17 @@ Module { . . . . . . . Roles: QualifiedIdentifier . . . . . . . TOKEN "f" . . . . . . . StartPosition: { -. . . . . . . . Offset: 252 +. . . . . . . . Offset: 0 +. . . . . . . . Line: 19 +. . . . . . . . Col: 11 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 . . . . . . . . Line: 19 . . . . . . . . Col: 11 . . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 19 . . . . . . . . internalRole: value . . . . . . . } . . . . . . . Children: { @@ -831,14 +951,17 @@ Module { . . . . . . . . . Roles: QualifiedIdentifier . . . . . . . . . TOKEN "e" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 250 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 19 +. . . . . . . . . . Col: 9 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 19 . . . . . . . . . . Col: 9 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 19 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -846,14 +969,17 @@ Module { . . . . . . . . . . . Roles: QualifiedIdentifier . . . . . . . . . . . TOKEN "d" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 248 +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . Col: 7 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 19 . . . . . . . . . . . . Col: 7 . . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . . . end_lineno: 19 . . . . . . . . . . . . internalRole: value . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -861,14 +987,17 @@ Module { . . . . . . . . . . . . . Roles: QualifiedIdentifier . . . . . . . . . . . . . TOKEN "c" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 246 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . Col: 5 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 19 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . . . . . end_lineno: 19 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . . Children: { @@ -876,14 +1005,17 @@ Module { . . . . . . . . . . . . . . . Roles: QualifiedIdentifier . . . . . . . . . . . . . . . TOKEN "b" . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . Offset: 244 +. . . . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . . . Col: 3 +. . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . Line: 19 . . . . . . . . . . . . . . . . Col: 3 . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . . . . . . . end_lineno: 19 . . . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Children: { @@ -891,14 +1023,17 @@ Module { . . . . . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . . . . . TOKEN "a" . . . . . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . . . . . Offset: 242 +. . . . . . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . . . . . Line: 19 +. . . . . . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . . . . . Line: 19 . . . . . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . . . . . end_col_offset: 1 -. . . . . . . . . . . . . . . . . . end_lineno: 19 . . . . . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . . } @@ -918,14 +1053,17 @@ Module { . . . . . Roles: NumberLiteral,AssignmentValue . . . . . TOKEN "6" . . . . . StartPosition: { -. . . . . . Offset: 258 +. . . . . . Offset: 0 +. . . . . . Line: 19 +. . . . . . Col: 17 +. . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 . . . . . . Line: 19 . . . . . . Col: 17 . . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 17 -. . . . . . end_lineno: 19 . . . . . . internalRole: value . . . . . } . . . . } @@ -934,26 +1072,32 @@ Module { . . 4: Expr { . . . Roles: Expression . . . StartPosition: { -. . . . Offset: 260 +. . . . Offset: 0 . . . . Line: 20 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 20 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 20 . . . . internalRole: body . . . } . . . Children: { . . . . 0: Call { . . . . . Roles: Call . . . . . StartPosition: { -. . . . . . Offset: 263 +. . . . . . Offset: 0 . . . . . . Line: 20 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 20 +. . . . . . Col: 10 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 10 -. . . . . . end_lineno: 20 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -961,14 +1105,17 @@ Module { . . . . . . . Roles: NumberLiteral,CallPositionalArgument . . . . . . . TOKEN "5" . . . . . . . StartPosition: { -. . . . . . . . Offset: 269 +. . . . . . . . Offset: 0 +. . . . . . . . Line: 20 +. . . . . . . . Col: 10 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 . . . . . . . . Line: 20 . . . . . . . . Col: 10 . . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 20 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -976,14 +1123,17 @@ Module { . . . . . . . Roles: CallCallee,CallCallee,QualifiedIdentifier . . . . . . . TOKEN "method" . . . . . . . StartPosition: { -. . . . . . . . Offset: 262 +. . . . . . . . Offset: 0 . . . . . . . . Line: 20 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 20 +. . . . . . . . Col: 8 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 8 -. . . . . . . . end_lineno: 20 . . . . . . . . internalRole: func . . . . . . . } . . . . . . . Children: { @@ -991,14 +1141,17 @@ Module { . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . TOKEN "a" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 260 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 20 +. . . . . . . . . . Col: 1 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 20 . . . . . . . . . . Col: 1 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 1 -. . . . . . . . . . end_lineno: 20 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } diff --git a/tests/classdef_inheritance.py.native b/tests/classdef_inheritance.py.native index b073fac8..dcdb24a7 100644 --- a/tests/classdef_inheritance.py.native +++ b/tests/classdef_inheritance.py.native @@ -22,8 +22,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 16, - "end_lineno": 1, "lineno": 2 } ], @@ -76,8 +74,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 25, - "end_lineno": 4, "lineno": 5 } ], @@ -91,8 +87,8 @@ } ], "col_offset": 1, - "end_col_offset": 25, - "end_lineno": 4, + "end_col_offset": 1, + "end_lineno": 6, "lineno": 1, "noops_remainder": { "ast_type": "RemainderNoops", diff --git a/tests/classdef_inheritance.py.uast b/tests/classdef_inheritance.py.uast index 1d37f6db..df36455c 100644 --- a/tests/classdef_inheritance.py.uast +++ b/tests/classdef_inheritance.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 25 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 66 +. . Line: 6 +. . Col: 1 . } . Children: { . . 0: ClassDef { @@ -21,9 +23,12 @@ Module { . . . . Line: 1 . . . . Col: 7 . . . } +. . . EndPosition: { +. . . . Offset: 15 +. . . . Line: 1 +. . . . Col: 16 +. . . } . . . Properties: { -. . . . end_col_offset: 16 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -41,10 +46,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 11 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 15 +. . . . . . . . Line: 1 +. . . . . . . . Col: 16 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 1 . . . . . . . } . . . . . . } . . . . . } @@ -62,10 +70,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -79,9 +83,12 @@ Module { . . . . Line: 4 . . . . Col: 7 . . . } +. . . EndPosition: { +. . . . Offset: 53 +. . . . Line: 4 +. . . . Col: 25 +. . . } . . . Properties: { -. . . . end_col_offset: 25 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -99,10 +106,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 16 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 48 +. . . . . . . . Line: 4 +. . . . . . . . Col: 20 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 20 -. . . . . . . . end_lineno: 4 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { @@ -112,9 +122,12 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -123,7 +136,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 28 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -139,14 +152,17 @@ Module { . . . . . . . Roles: SimpleIdentifier . . . . . . . TOKEN "Dog" . . . . . . . StartPosition: { -. . . . . . . . Offset: 51 +. . . . . . . . Offset: 0 . . . . . . . . Line: 4 . . . . . . . . Col: 23 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 25 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 25 -. . . . . . . . end_lineno: 4 . . . . . . . } . . . . . . } . . . . . } @@ -160,14 +176,10 @@ Module { . . . . . . 0: Pass { . . . . . . . Roles: Noop . . . . . . . StartPosition: { -. . . . . . . . Offset: 61 +. . . . . . . . Offset: 0 . . . . . . . . Line: 5 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 25 -. . . . . . . . end_lineno: 4 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -176,13 +188,16 @@ Module { . . 2: RemainderNoops { . . . Roles: Whitespace . . . StartPosition: { -. . . . Offset: 66 +. . . . Offset: 0 +. . . . Line: 6 +. . . . Col: 1 +. . . } +. . . EndPosition: { +. . . . Offset: 0 . . . . Line: 6 . . . . Col: 1 . . . } . . . Properties: { -. . . . end_col_offset: 1 -. . . . end_lineno: 6 . . . . internalRole: noops_remainder . . . } . . . Children: { @@ -191,7 +206,7 @@ Module { . . . . . TOKEN " " . . . . . StartPosition: { -. . . . . . Offset: 66 +. . . . . . Offset: 0 . . . . . . Line: 6 . . . . . . Col: 1 . . . . . } diff --git a/tests/classdef_metaclass_py2.py.uast b/tests/classdef_metaclass_py2.py.uast index 9cae3c13..45cd8d3e 100644 --- a/tests/classdef_metaclass_py2.py.uast +++ b/tests/classdef_metaclass_py2.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 30 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 56 +. . Line: 2 +. . Col: 30 . } . Children: { . . 0: ClassDef { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 7 . . . } +. . . EndPosition: { +. . . . Offset: 56 +. . . . Line: 2 +. . . . Col: 30 +. . . } . . . Properties: { -. . . . end_col_offset: 30 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -41,10 +45,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 19 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 23 +. . . . . . . . Line: 1 +. . . . . . . . Col: 24 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 24 -. . . . . . . . end_lineno: 1 . . . . . . . } . . . . . . } . . . . . } @@ -62,9 +69,10 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 30 -. . . . . . . . end_lineno: 2 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 56 +. . . . . . . . Line: 2 +. . . . . . . . Col: 30 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { @@ -75,10 +83,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 44 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 18 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 18 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: targets . . . . . . . . . } . . . . . . . . } @@ -90,10 +101,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 22 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 56 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 30 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 30 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } diff --git a/tests/classdef_metaclass_py3.py.native b/tests/classdef_metaclass_py3.py.native index cd632cc8..b5dc59d2 100644 --- a/tests/classdef_metaclass_py3.py.native +++ b/tests/classdef_metaclass_py3.py.native @@ -12,8 +12,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 37, - "end_lineno": 1, "lineno": 2 } ], @@ -75,8 +73,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 50, - "end_lineno": 4, "lineno": 5 } ], diff --git a/tests/classdef_metaclass_py3.py.uast b/tests/classdef_metaclass_py3.py.uast index 31f8e013..1ca53702 100644 --- a/tests/classdef_metaclass_py3.py.uast +++ b/tests/classdef_metaclass_py3.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 50 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 99 +. . Line: 4 +. . Col: 50 . } . Children: { . . 0: ClassDef { @@ -21,9 +23,12 @@ Module { . . . . Line: 1 . . . . Col: 7 . . . } +. . . EndPosition: { +. . . . Offset: 36 +. . . . Line: 1 +. . . . Col: 37 +. . . } . . . Properties: { -. . . . end_col_offset: 37 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -40,10 +45,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 37 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -59,9 +60,10 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 19 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 37 -. . . . . . . . end_lineno: 1 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 36 +. . . . . . . . Line: 1 +. . . . . . . . Col: 37 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { @@ -72,10 +74,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 29 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 36 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 37 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 37 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -93,9 +98,12 @@ Module { . . . . Line: 4 . . . . Col: 7 . . . } +. . . EndPosition: { +. . . . Offset: 99 +. . . . Line: 4 +. . . . Col: 50 +. . . } . . . Properties: { -. . . . end_col_offset: 50 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -113,10 +121,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 19 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 78 +. . . . . . . . Line: 4 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 29 -. . . . . . . . end_lineno: 4 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { @@ -126,9 +137,12 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -137,7 +151,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 49 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -160,14 +174,10 @@ Module { . . . . . . 0: Pass { . . . . . . . Roles: Noop . . . . . . . StartPosition: { -. . . . . . . . Offset: 107 +. . . . . . . . Offset: 0 . . . . . . . . Line: 5 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 50 -. . . . . . . . end_lineno: 4 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -179,27 +189,31 @@ Module { . . . . . . 0: keyword { . . . . . . . TOKEN "metaclass" . . . . . . . StartPosition: { -. . . . . . . . Offset: 81 +. . . . . . . . Offset: 0 . . . . . . . . Line: 4 . . . . . . . . Col: 32 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 50 -. . . . . . . . end_lineno: 4 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 50 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . TOKEN "Singleton" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 91 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 42 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 50 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 50 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } diff --git a/tests/comments.py.native b/tests/comments.py.native index 6ef25da4..e8e12424 100644 --- a/tests/comments.py.native +++ b/tests/comments.py.native @@ -8,7 +8,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 5, + "end_col_offset": 29, "end_lineno": 3, "lineno": 3, "targets": [ @@ -16,7 +16,7 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 29, "end_lineno": 3, "id": "a", "lineno": 3, @@ -43,10 +43,9 @@ }, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 29, "col_offset": 6, - "end_col_offset": 22, - "end_lineno": 2, + "end_col_offset": 29, + "end_lineno": 3, "lineno": 3, "noop_line": "# line trailing comment" } @@ -64,8 +63,8 @@ } ], "col_offset": 1, - "end_col_offset": 5, - "end_lineno": 3, + "end_col_offset": 1, + "end_lineno": 5, "lineno": 1, "noops_remainder": { "ast_type": "RemainderNoops", diff --git a/tests/comments.py.uast b/tests/comments.py.uast index a5f8e4dc..b61b8df7 100644 --- a/tests/comments.py.uast +++ b/tests/comments.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 5 -. . end_lineno: 3 +. EndPosition: { +. . Offset: 93 +. . Line: 5 +. . Col: 1 . } . Children: { . . 0: Assign { @@ -20,9 +21,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 67 +. . . . Line: 3 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 5 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -34,10 +38,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 67 +. . . . . . Line: 3 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 3 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -48,9 +55,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 37 +. . . . . . . . Line: 2 +. . . . . . . . Col: 22 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: noops_previous . . . . . . . } . . . . . . . Children: { @@ -90,10 +100,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 67 +. . . . . . . . Line: 3 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 29 -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -107,10 +119,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 43 +. . . . . . Line: 3 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . } @@ -123,9 +138,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 93 +. . . . Line: 5 +. . . . Col: 1 +. . . } . . . Properties: { -. . . . end_col_offset: 1 -. . . . end_lineno: 5 . . . . internalRole: noops_remainder . . . } . . . Children: { diff --git a/tests/comprehension_dict.py.uast b/tests/comprehension_dict.py.uast index 13ae5175..2cfbcd9f 100644 --- a/tests/comprehension_dict.py.uast +++ b/tests/comprehension_dict.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 32 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 31 +. . Line: 1 +. . Col: 32 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 31 +. . . . Line: 1 +. . . . Col: 32 +. . . } . . . Properties: { -. . . . end_col_offset: 32 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -32,9 +36,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 31 +. . . . . . Line: 1 +. . . . . . Col: 32 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 32 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -45,9 +52,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 31 +. . . . . . . . Line: 1 +. . . . . . . . Col: 32 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 32 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: generators . . . . . . . . is_async: 0 . . . . . . . } @@ -59,9 +69,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 30 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 31 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 32 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 32 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: ifs . . . . . . . . . } . . . . . . . . . Children: { @@ -79,10 +92,13 @@ Module { . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . Col: 32 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 31 +. . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . Col: 32 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . end_col_offset: 32 -. . . . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . } @@ -95,10 +111,13 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 30 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 29 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 30 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 30 -. . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . internalRole: left . . . . . . . . . . . } . . . . . . . . . . } @@ -116,9 +135,10 @@ Module { . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . Col: 31 . . . . . . . . . . . . . } -. . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 31 -. . . . . . . . . . . . . . end_lineno: 1 +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 30 +. . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . Col: 31 . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . } @@ -133,10 +153,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 18 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 24 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 25 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: iter . . . . . . . . . } . . . . . . . . } @@ -148,10 +171,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 13 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 12 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 13 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 13 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: target . . . . . . . . . } . . . . . . . . } @@ -165,10 +191,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 1 +. . . . . . . . Line: 1 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: key . . . . . . . } . . . . . . } @@ -179,9 +208,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 6 +. . . . . . . . Line: 1 +. . . . . . . . Col: 7 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: value . . . . . . . } . . . . . . . Children: { @@ -193,10 +225,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 4 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -208,9 +243,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 5 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 6 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -222,10 +260,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 7 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 6 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 7 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } diff --git a/tests/comprehension_list.py.uast b/tests/comprehension_list.py.uast index b69c6759..0d201c3b 100644 --- a/tests/comprehension_list.py.uast +++ b/tests/comprehension_list.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 45 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 75 +. . Line: 2 +. . Col: 45 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 28 +. . . . Line: 1 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 29 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -32,9 +36,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 28 +. . . . . . Line: 1 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 29 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -45,9 +52,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 1 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elt . . . . . . . } . . . . . . . Children: { @@ -59,10 +69,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 1 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 2 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 2 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -74,9 +87,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 3 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 2 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 3 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -88,10 +104,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 4 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 3 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 4 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } @@ -109,9 +128,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 28 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 29 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 29 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . is_async: 0 . . . . . . . . . } . . . . . . . . . Children: { @@ -122,9 +144,12 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 27 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 28 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 29 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 29 -. . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . internalRole: ifs . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -142,10 +167,13 @@ Module { . . . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . . . Col: 29 . . . . . . . . . . . . . . . } +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 28 +. . . . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . . . Col: 29 +. . . . . . . . . . . . . . . } . . . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . . . end_col_offset: 29 -. . . . . . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . } . . . . . . . . . . . . . } @@ -158,10 +186,13 @@ Module { . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . Col: 27 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 26 +. . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . Col: 27 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 27 -. . . . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . . . internalRole: left . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -179,9 +210,10 @@ Module { . . . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . . . Col: 28 . . . . . . . . . . . . . . . } -. . . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . . . . . . . end_lineno: 1 +. . . . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . . . Offset: 27 +. . . . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . . . Col: 28 . . . . . . . . . . . . . . . } . . . . . . . . . . . . . . } . . . . . . . . . . . . . } @@ -196,10 +228,13 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 15 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 21 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 22 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . internalRole: iter . . . . . . . . . . . } . . . . . . . . . . } @@ -211,10 +246,13 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 10 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 9 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 10 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . internalRole: target . . . . . . . . . . . } . . . . . . . . . . } @@ -233,9 +271,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 75 +. . . . Line: 2 +. . . . Col: 45 +. . . } . . . Properties: { -. . . . end_col_offset: 45 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -245,9 +286,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 75 +. . . . . . Line: 2 +. . . . . . Col: 45 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 45 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -258,9 +302,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 34 +. . . . . . . . Line: 2 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: elt . . . . . . . } . . . . . . . Children: { @@ -272,10 +319,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 32 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 2 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 2 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -287,9 +337,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 3 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 33 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 3 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -301,10 +354,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 4 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 34 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 4 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } @@ -322,9 +378,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 58 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 28 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . is_async: 0 . . . . . . . . . } . . . . . . . . . Children: { @@ -336,10 +395,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 21 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 58 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 28 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: iter . . . . . . . . . . . } . . . . . . . . . . } @@ -351,10 +413,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 10 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 46 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 16 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . end_col_offset: 16 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: target . . . . . . . . . . . } . . . . . . . . . . } @@ -367,9 +432,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 21 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 75 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 45 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 45 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . is_async: 0 . . . . . . . . . } . . . . . . . . . Children: { @@ -381,10 +449,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 39 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 75 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 45 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 45 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: iter . . . . . . . . . . . } . . . . . . . . . . } @@ -396,10 +467,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 34 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 64 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 34 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . end_col_offset: 34 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: target . . . . . . . . . . . } . . . . . . . . . . } diff --git a/tests/comprehension_set.py.uast b/tests/comprehension_set.py.uast index ef4c1d54..822b287f 100644 --- a/tests/comprehension_set.py.uast +++ b/tests/comprehension_set.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 29 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 28 +. . Line: 1 +. . Col: 29 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 28 +. . . . Line: 1 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 29 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -32,9 +36,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 28 +. . . . . . Line: 1 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 29 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -45,9 +52,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 1 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elt . . . . . . . } . . . . . . . Children: { @@ -59,10 +69,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 1 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 2 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 2 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -74,9 +87,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 3 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 2 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 3 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -88,10 +104,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 4 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 3 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 4 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 4 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } @@ -104,9 +123,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 28 +. . . . . . . . Line: 1 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 29 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: generators . . . . . . . . is_async: 0 . . . . . . . } @@ -118,9 +140,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 27 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 28 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 29 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 29 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: ifs . . . . . . . . . } . . . . . . . . . Children: { @@ -138,10 +163,13 @@ Module { . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . Col: 29 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 28 +. . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . Col: 29 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . end_col_offset: 29 -. . . . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . } @@ -154,10 +182,13 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 27 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 26 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 27 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 27 -. . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . . internalRole: left . . . . . . . . . . . } . . . . . . . . . . } @@ -175,9 +206,10 @@ Module { . . . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . . . Col: 28 . . . . . . . . . . . . . } -. . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . . . . . end_lineno: 1 +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 27 +. . . . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . . . Col: 28 . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . } @@ -192,10 +224,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 15 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 21 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 22 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: iter . . . . . . . . . } . . . . . . . . } @@ -207,10 +242,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 10 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 9 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 10 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: target . . . . . . . . . } . . . . . . . . } diff --git a/tests/declarations_annotated.py.uast b/tests/declarations_annotated.py.uast index 0d945476..99e28d9d 100644 --- a/tests/declarations_annotated.py.uast +++ b/tests/declarations_annotated.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 14 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 24 +. . Line: 2 +. . Col: 14 . } . Children: { . . 0: AnnAssign { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 9 +. . . . Line: 1 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 1 . . . . internalRole: body . . . . simple: 1 . . . } @@ -35,10 +39,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 5 +. . . . . . Line: 1 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 1 . . . . . . internalRole: annotation . . . . . } . . . . } @@ -50,10 +57,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 1 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 1 . . . . . . internalRole: target . . . . . } . . . . } @@ -65,10 +75,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 10 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 9 +. . . . . . Line: 1 +. . . . . . Col: 10 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 10 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . } @@ -81,9 +94,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 24 +. . . . Line: 2 +. . . . Col: 14 +. . . } . . . Properties: { -. . . . end_col_offset: 14 -. . . . end_lineno: 2 . . . . internalRole: body . . . . simple: 1 . . . } @@ -96,10 +112,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 16 +. . . . . . Line: 2 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 2 . . . . . . internalRole: annotation . . . . . } . . . . } @@ -111,10 +130,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 11 +. . . . . . Line: 2 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 2 . . . . . . internalRole: target . . . . . } . . . . } @@ -126,9 +148,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 10 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 24 +. . . . . . Line: 2 +. . . . . . Col: 14 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 14 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . } diff --git a/tests/ellipsis.py.uast b/tests/ellipsis.py.uast index b3e16f5a..2fc834ec 100644 --- a/tests/ellipsis.py.uast +++ b/tests/ellipsis.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 7 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 6 +. . Line: 1 +. . Col: 7 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 6 +. . . . Line: 1 +. . . . Col: 7 +. . . } . . . Properties: { -. . . . end_col_offset: 7 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,10 +37,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 6 +. . . . . . Line: 1 +. . . . . . Col: 7 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 7 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -48,9 +55,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 1 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -62,10 +72,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 7 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 6 +. . . . . . . . Line: 1 +. . . . . . . . Col: 7 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } diff --git a/tests/except.py.uast b/tests/except.py.uast index 74b677c8..2552d175 100644 --- a/tests/except.py.uast +++ b/tests/except.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 23 -. . end_lineno: 9 +. EndPosition: { +. . Offset: 165 +. . Line: 9 +. . Col: 23 . } . Children: { . . 0: Try { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 165 +. . . . Line: 9 +. . . . Col: 23 +. . . } . . . Properties: { -. . . . end_col_offset: 23 -. . . . end_lineno: 9 . . . . internalRole: body . . . } . . . Children: { @@ -38,9 +42,10 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 2 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 13 +. . . . . . . . Line: 2 +. . . . . . . . Col: 9 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { @@ -51,10 +56,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 9 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: targets . . . . . . . . . } . . . . . . . . } @@ -66,10 +74,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 13 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 9 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -82,10 +93,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 42 +. . . . . . . . Line: 3 +. . . . . . . . Col: 28 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . cause: -. . . . . . . . end_col_offset: 28 -. . . . . . . . end_lineno: 3 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -95,9 +109,12 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 12 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 42 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 28 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: exc . . . . . . . . . } . . . . . . . . . Children: { @@ -109,9 +126,12 @@ Module { . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 21 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 42 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 28 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -123,10 +143,13 @@ Module { . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 33 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 19 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -148,9 +171,10 @@ Module { . . . . . . . . Line: 9 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 9 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 165 +. . . . . . . . Line: 9 +. . . . . . . . Col: 23 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -160,9 +184,12 @@ Module { . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 165 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 23 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 23 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -174,9 +201,12 @@ Module { . . . . . . . . . . . . Line: 9 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 165 +. . . . . . . . . . . . Line: 9 +. . . . . . . . . . . . Col: 23 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 23 -. . . . . . . . . . . . end_lineno: 9 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -188,10 +218,13 @@ Module { . . . . . . . . . . . . Line: 9 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 151 +. . . . . . . . . . . . Line: 9 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 9 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -214,9 +247,10 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 25 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 33 -. . . . . . . . end_lineno: 5 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 104 +. . . . . . . . Line: 5 +. . . . . . . . Col: 33 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Expr { @@ -226,9 +260,12 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 104 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 33 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 33 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: body . . . . . . . . . } . . . . . . . . . Children: { @@ -239,9 +276,12 @@ Module { . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . Col: 6 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 104 +. . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . Col: 33 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 33 -. . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . internalRole: value . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -253,9 +293,12 @@ Module { . . . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . . . Col: 11 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 104 +. . . . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . . . Col: 33 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 33 -. . . . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . . . internalRole: args . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -267,10 +310,13 @@ Module { . . . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 80 +. . . . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . . . Col: 9 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . . . internalRole: func . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -286,10 +332,13 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 8 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 64 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 20 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 20 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: type . . . . . . . . . } . . . . . . . . } @@ -303,9 +352,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 131 +. . . . . . . . Line: 7 +. . . . . . . . Col: 17 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 17 -. . . . . . . . end_lineno: 7 . . . . . . . . type: . . . . . . . } . . . . . . . Children: { @@ -316,9 +368,12 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 131 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 17 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 17 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: body . . . . . . . . . } . . . . . . . . . Children: { @@ -329,9 +384,12 @@ Module { . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . Col: 6 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 131 +. . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . Col: 17 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 17 -. . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . internalRole: value . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -343,9 +401,12 @@ Module { . . . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . . . Col: 11 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 131 +. . . . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . . . Col: 17 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 17 -. . . . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . . . internalRole: args . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -357,10 +418,13 @@ Module { . . . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 123 +. . . . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . . . Col: 9 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . . . internalRole: func . . . . . . . . . . . . . } . . . . . . . . . . . . } diff --git a/tests/exec.py.uast b/tests/exec.py.uast index 7b69d97f..792a4a15 100644 --- a/tests/exec.py.uast +++ b/tests/exec.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 14 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 13 +. . Line: 1 +. . Col: 14 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 13 +. . . . Line: 1 +. . . . Col: 14 +. . . } . . . Properties: { -. . . . end_col_offset: 14 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 13 +. . . . . . Line: 1 +. . . . . . Col: 14 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 14 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,9 +54,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 13 +. . . . . . . . Line: 1 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -61,10 +71,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 1 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } diff --git a/tests/for.py.native b/tests/for.py.native index 4bec2c05..71157b0e 100644 --- a/tests/for.py.native +++ b/tests/for.py.native @@ -17,8 +17,6 @@ "op": { "ast_type": "Add", "col_offset": 5, - "end_col_offset": 5, - "end_lineno": 2, "lineno": 2 }, "target": { diff --git a/tests/for.py.uast b/tests/for.py.uast index 65e1797e..1f4a9be7 100644 --- a/tests/for.py.uast +++ b/tests/for.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 11 -. . end_lineno: 3 +. EndPosition: { +. . Offset: 39 +. . Line: 3 +. . Col: 11 . } . Children: { . . 0: For { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 39 +. . . . Line: 3 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 11 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -40,9 +44,10 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 7 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 2 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 27 +. . . . . . . . Line: 2 +. . . . . . . . Col: 10 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Add { @@ -54,8 +59,6 @@ Module { . . . . . . . . . . Col: 5 . . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -67,10 +70,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 22 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: target . . . . . . . . . } . . . . . . . . } @@ -82,10 +88,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 10 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 27 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 10 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -98,9 +107,10 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 3 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 39 +. . . . . . . . Line: 3 +. . . . . . . . Col: 11 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -110,9 +120,12 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 39 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 11 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -124,10 +137,13 @@ Module { . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 39 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 11 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -139,10 +155,13 @@ Module { . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 37 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -159,10 +178,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 10 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 14 +. . . . . . Line: 1 +. . . . . . Col: 15 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 15 -. . . . . . end_lineno: 1 . . . . . . internalRole: iter . . . . . } . . . . . Children: { @@ -174,10 +196,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 11 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 10 +. . . . . . . . Line: 1 +. . . . . . . . Col: 11 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -189,10 +214,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 13 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 12 +. . . . . . . . Line: 1 +. . . . . . . . Col: 13 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 13 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -204,10 +232,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 15 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 14 +. . . . . . . . Line: 1 +. . . . . . . . Col: 15 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 15 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -221,10 +252,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 4 +. . . . . . Line: 1 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 1 . . . . . . internalRole: target . . . . . } . . . . } diff --git a/tests/functioncalls.py.uast b/tests/functioncalls.py.uast index 07cc8d48..4b1ff3f1 100644 --- a/tests/functioncalls.py.uast +++ b/tests/functioncalls.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 30 -. . end_lineno: 5 +. EndPosition: { +. . Offset: 170 +. . Line: 5 +. . Col: 30 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 39 +. . . . Line: 1 +. . . . Col: 40 +. . . } . . . Properties: { -. . . . end_col_offset: 40 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 39 +. . . . . . Line: 1 +. . . . . . Col: 40 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 40 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,9 +54,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 22 +. . . . . . . . Line: 1 +. . . . . . . . Col: 23 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -61,10 +71,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 26 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 26 +. . . . . . . . Line: 1 +. . . . . . . . Col: 27 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 27 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -76,10 +89,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 30 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 39 +. . . . . . . . Line: 1 +. . . . . . . . Col: 40 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 40 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -91,10 +107,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 9 +. . . . . . . . Line: 1 +. . . . . . . . Col: 10 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } @@ -109,9 +128,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 84 +. . . . Line: 2 +. . . . Col: 43 +. . . } . . . Properties: { -. . . . end_col_offset: 43 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -122,9 +144,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 84 +. . . . . . Line: 2 +. . . . . . Col: 43 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 43 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -136,9 +161,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 68 +. . . . . . . . Line: 2 +. . . . . . . . Col: 27 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 27 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -150,10 +178,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 30 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 72 +. . . . . . . . Line: 2 +. . . . . . . . Col: 31 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 31 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -165,10 +196,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 34 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 84 +. . . . . . . . Line: 2 +. . . . . . . . Col: 43 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 43 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -180,10 +214,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 56 +. . . . . . . . Line: 2 +. . . . . . . . Col: 15 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 15 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: func . . . . . . . } . . . . . . . Children: { @@ -195,10 +232,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 42 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 1 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 1 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -215,9 +255,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 105 +. . . . Line: 3 +. . . . Col: 19 +. . . } . . . Properties: { -. . . . end_col_offset: 19 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -228,9 +271,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 105 +. . . . . . Line: 3 +. . . . . . Col: 19 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 19 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -242,10 +288,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 95 +. . . . . . . . Line: 3 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -257,10 +306,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 93 +. . . . . . . . Line: 3 +. . . . . . . . Col: 7 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } @@ -272,9 +324,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 100 +. . . . . . . . Line: 3 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: keywords . . . . . . . } . . . . . . . Children: { @@ -286,10 +341,13 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 14 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 100 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 14 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -303,9 +361,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 105 +. . . . . . . . Line: 3 +. . . . . . . . Col: 19 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 19 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: keywords . . . . . . . } . . . . . . . Children: { @@ -317,10 +378,13 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 19 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 105 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 19 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -337,9 +401,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 138 +. . . . Line: 4 +. . . . Col: 31 +. . . } . . . Properties: { -. . . . end_col_offset: 31 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -350,9 +417,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 138 +. . . . . . Line: 4 +. . . . . . Col: 31 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 31 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -364,10 +434,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 16 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 123 +. . . . . . . . Line: 4 +. . . . . . . . Col: 16 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -378,10 +451,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 19 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 138 +. . . . . . . . Line: 4 +. . . . . . . . Col: 31 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 31 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -393,10 +469,13 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 20 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 138 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 31 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 31 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -410,10 +489,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 121 +. . . . . . . . Line: 4 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } @@ -428,9 +510,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 170 +. . . . Line: 5 +. . . . Col: 30 +. . . } . . . Properties: { -. . . . end_col_offset: 30 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -441,9 +526,12 @@ Module { . . . . . . Line: 5 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 170 +. . . . . . Line: 5 +. . . . . . Col: 30 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 30 -. . . . . . end_lineno: 5 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -455,10 +543,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 15 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 155 +. . . . . . . . Line: 5 +. . . . . . . . Col: 15 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 15 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -470,10 +561,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 153 +. . . . . . . . Line: 5 +. . . . . . . . Col: 13 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 13 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } @@ -485,9 +579,12 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 15 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 170 +. . . . . . . . Line: 5 +. . . . . . . . Col: 30 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 30 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: keywords . . . . . . . } . . . . . . . Children: { @@ -499,10 +596,13 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 20 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 170 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 30 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 30 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } diff --git a/tests/functiondef_annotated.py.native b/tests/functiondef_annotated.py.native index ab451d2f..35a3efa8 100644 --- a/tests/functiondef_annotated.py.native +++ b/tests/functiondef_annotated.py.native @@ -76,8 +76,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 47, - "end_lineno": 1, "lineno": 2 } ], diff --git a/tests/functiondef_annotated.py.uast b/tests/functiondef_annotated.py.uast index cf506ce4..7d570180 100644 --- a/tests/functiondef_annotated.py.uast +++ b/tests/functiondef_annotated.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 57 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 56 +. . Line: 1 +. . Col: 57 . } . Children: { . . 0: FunctionDef { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 56 +. . . . Line: 1 +. . . . Col: 57 +. . . } . . . Properties: { -. . . . end_col_offset: 57 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -34,9 +38,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 15 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 46 +. . . . . . Line: 1 +. . . . . . Col: 47 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 47 -. . . . . . end_lineno: 1 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -50,9 +57,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 21 +. . . . . . . . Line: 1 +. . . . . . . . Col: 22 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -64,10 +74,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 20 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 21 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 22 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: annotation . . . . . . . . . } . . . . . . . . } @@ -81,9 +94,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 25 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 32 +. . . . . . . . Line: 1 +. . . . . . . . Col: 33 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 33 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -95,10 +111,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 31 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 32 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 33 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 33 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: annotation . . . . . . . . . } . . . . . . . . } @@ -112,9 +131,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 36 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 46 +. . . . . . . . Line: 1 +. . . . . . . . Col: 47 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 47 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -126,10 +148,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 42 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 46 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 47 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 47 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: annotation . . . . . . . . . } . . . . . . . . } @@ -150,10 +175,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 47 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -165,10 +186,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 53 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 56 +. . . . . . Line: 1 +. . . . . . Col: 57 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 57 -. . . . . . end_lineno: 1 . . . . . . internalRole: returns . . . . . } . . . . } diff --git a/tests/functiondef_decorated.py.native b/tests/functiondef_decorated.py.native index 63374883..0890e72c 100644 --- a/tests/functiondef_decorated.py.native +++ b/tests/functiondef_decorated.py.native @@ -50,8 +50,6 @@ "ast_type": "arguments", "col_offset": 1, "defaults": [], - "end_col_offset": 14, - "end_lineno": 1, "kw_defaults": [], "kwarg": null, "kwonlyargs": [], @@ -63,8 +61,8 @@ { "ast_type": "Return", "col_offset": 5, - "end_col_offset": 14, - "end_lineno": 1, + "end_col_offset": 0, + "end_lineno": 4, "lineno": 7, "noops_previous": { "ast_type": "PreviousNoops", diff --git a/tests/functiondef_decorated.py.uast b/tests/functiondef_decorated.py.uast index 49db9418..80e693a3 100644 --- a/tests/functiondef_decorated.py.uast +++ b/tests/functiondef_decorated.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 28 -. . end_lineno: 5 +. EndPosition: { +. . Offset: 70 +. . Line: 5 +. . Col: 28 . } . Children: { . . 0: FunctionDef { @@ -21,9 +23,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 13 +. . . . Line: 1 +. . . . Col: 14 +. . . } . . . Properties: { -. . . . end_col_offset: 14 -. . . . end_lineno: 1 . . . . internalRole: body . . . . returns: . . . } @@ -73,10 +78,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 13 +. . . . . . . . Line: 1 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 1 . . . . . . . } . . . . . . } . . . . . } @@ -91,9 +99,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 70 +. . . . Line: 5 +. . . . Col: 28 +. . . } . . . Properties: { -. . . . end_col_offset: 28 -. . . . end_lineno: 5 . . . . internalRole: body . . . . returns: . . . } @@ -106,8 +117,6 @@ Module { . . . . . . Col: 1 . . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 14 -. . . . . . end_lineno: 1 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -126,22 +135,28 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 0 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 1 . . . . . . . . value: . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { . . . . . . . . . Roles: Whitespace . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 42 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -150,7 +165,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 42 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -172,27 +187,31 @@ Module { . . . . . . 0: Call { . . . . . . . Roles: Call . . . . . . . StartPosition: { -. . . . . . . . Offset: 45 +. . . . . . . . Offset: 0 . . . . . . . . Line: 5 . . . . . . . . Col: 3 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 28 -. . . . . . . . end_lineno: 5 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 5 +. . . . . . . . Col: 28 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: NumLiteral { . . . . . . . . . Roles: NumberLiteral,CallPositionalArgument . . . . . . . . . TOKEN "1" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 64 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 22 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 22 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 22 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: args . . . . . . . . . } . . . . . . . . } @@ -200,14 +219,17 @@ Module { . . . . . . . . . Roles: NumberLiteral,CallPositionalArgument . . . . . . . . . TOKEN "2" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 67 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 25 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 25 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: args . . . . . . . . . } . . . . . . . . } @@ -215,14 +237,17 @@ Module { . . . . . . . . . Roles: NumberLiteral,CallPositionalArgument . . . . . . . . . TOKEN "3" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 70 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 28 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 28 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 28 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: args . . . . . . . . . } . . . . . . . . } @@ -230,14 +255,17 @@ Module { . . . . . . . . . Roles: CallCallee,CallCallee,SimpleIdentifier . . . . . . . . . TOKEN "somedecoratorparams" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 44 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 2 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 20 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 20 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: func . . . . . . . . . } . . . . . . . . } diff --git a/tests/functiondef_defaultparams.py.native b/tests/functiondef_defaultparams.py.native index dfbf5d66..d4312c35 100644 --- a/tests/functiondef_defaultparams.py.native +++ b/tests/functiondef_defaultparams.py.native @@ -62,7 +62,7 @@ "NumType": "int", "ast_type": "NumLiteral", "col_offset": 31, - "end_col_offset": 54, + "end_col_offset": 31, "end_lineno": 1, "lineno": 1 }, @@ -70,7 +70,7 @@ "LiteralValue": "polompos", "ast_type": "StringLiteral", "col_offset": 39, - "end_col_offset": 54, + "end_col_offset": 48, "end_lineno": 1, "lineno": 1 }, @@ -96,8 +96,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 59, - "end_lineno": 1, "lineno": 2 } ], diff --git a/tests/functiondef_defaultparams.py.uast b/tests/functiondef_defaultparams.py.uast index 8e43c552..f3202abd 100644 --- a/tests/functiondef_defaultparams.py.uast +++ b/tests/functiondef_defaultparams.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 59 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 58 +. . Line: 1 +. . Col: 59 . } . Children: { . . 0: FunctionDef { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 58 +. . . . Line: 1 +. . . . Col: 59 +. . . } . . . Properties: { -. . . . end_col_offset: 59 -. . . . end_lineno: 1 . . . . internalRole: body . . . . returns: . . . } @@ -35,9 +39,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 15 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 58 +. . . . . . Line: 1 +. . . . . . Col: 59 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 59 -. . . . . . end_lineno: 1 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -51,10 +58,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 1 +. . . . . . . . Col: 17 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 17 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -66,10 +76,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 20 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 22 +. . . . . . . . Line: 1 +. . . . . . . . Col: 23 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -81,10 +94,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 26 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 28 +. . . . . . . . Line: 1 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 29 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -96,10 +112,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 34 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 36 +. . . . . . . . Line: 1 +. . . . . . . . Col: 37 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 37 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -111,10 +130,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 51 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 53 +. . . . . . . . Line: 1 +. . . . . . . . Col: 54 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 54 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -132,10 +154,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 31 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 30 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 31 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 54 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: StringLiteral { @@ -146,9 +171,10 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 39 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 54 -. . . . . . . . . . end_lineno: 1 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 47 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 48 . . . . . . . . . } . . . . . . . . } . . . . . . . . 2: NoneLiteral { @@ -159,9 +185,10 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 56 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 59 -. . . . . . . . . . end_lineno: 1 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 58 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 59 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -181,10 +208,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 59 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } diff --git a/tests/functiondef_docstring.py.native b/tests/functiondef_docstring.py.native index 2c4a36c7..f89d7b11 100644 --- a/tests/functiondef_docstring.py.native +++ b/tests/functiondef_docstring.py.native @@ -37,15 +37,11 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 7, - "end_lineno": 4, "lineno": 5 }, { "ast_type": "Return", "col_offset": 5, - "end_col_offset": 7, - "end_lineno": 4, "lineno": 6, "value": null } diff --git a/tests/functiondef_docstring.py.uast b/tests/functiondef_docstring.py.uast index bed2c2fd..a337758b 100644 --- a/tests/functiondef_docstring.py.uast +++ b/tests/functiondef_docstring.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 7 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 60 +. . Line: 4 +. . Col: 7 . } . Children: { . . 0: FunctionDef { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 60 +. . . . Line: 4 +. . . . Col: 7 +. . . } . . . Properties: { -. . . . end_col_offset: 7 -. . . . end_lineno: 4 . . . . internalRole: body . . . . returns: . . . } @@ -54,9 +58,10 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 1 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 4 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 60 +. . . . . . . . Line: 4 +. . . . . . . . Col: 7 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: StringLiteral { @@ -69,9 +74,12 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 60 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 7 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -84,10 +92,6 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 4 -. . . . . . . } . . . . . . } . . . . . . 2: Return { . . . . . . . Roles: Return @@ -97,8 +101,6 @@ Module { . . . . . . . . Col: 5 . . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 4 . . . . . . . . value: . . . . . . . } . . . . . . } diff --git a/tests/functiondef_kwarg.py.native b/tests/functiondef_kwarg.py.native index e3a68f54..204b9ab9 100644 --- a/tests/functiondef_kwarg.py.native +++ b/tests/functiondef_kwarg.py.native @@ -51,8 +51,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 39, - "end_lineno": 1, "lineno": 2 } ], @@ -133,8 +131,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 56, - "end_lineno": 4, "lineno": 5 } ], diff --git a/tests/functiondef_kwarg.py.uast b/tests/functiondef_kwarg.py.uast index e12d92ed..72f22c2e 100644 --- a/tests/functiondef_kwarg.py.uast +++ b/tests/functiondef_kwarg.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 56 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 107 +. . Line: 4 +. . Col: 56 . } . Children: { . . 0: FunctionDef { @@ -21,9 +23,12 @@ Module { . . . . Line: 1 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 38 +. . . . Line: 1 +. . . . Col: 39 +. . . } . . . Properties: { -. . . . end_col_offset: 39 -. . . . end_lineno: 1 . . . . internalRole: body . . . . returns: . . . } @@ -35,9 +40,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 15 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 38 +. . . . . . Line: 1 +. . . . . . Col: 39 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 39 -. . . . . . end_lineno: 1 . . . . . . internalRole: args . . . . . . vararg: . . . . . } @@ -50,10 +58,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 1 +. . . . . . . . Col: 17 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 17 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -65,10 +76,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 20 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 22 +. . . . . . . . Line: 1 +. . . . . . . . Col: 23 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -80,10 +94,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 28 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 38 +. . . . . . . . Line: 1 +. . . . . . . . Col: 39 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 39 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: kwarg . . . . . . . } . . . . . . } @@ -102,10 +119,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 39 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -119,9 +132,12 @@ Module { . . . . Line: 4 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 107 +. . . . Line: 4 +. . . . Col: 56 +. . . } . . . Properties: { -. . . . end_col_offset: 56 -. . . . end_lineno: 4 . . . . internalRole: body . . . . returns: . . . } @@ -133,9 +149,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 21 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 107 +. . . . . . Line: 4 +. . . . . . Col: 56 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 56 -. . . . . . end_lineno: 4 . . . . . . internalRole: args . . . . . } . . . . . Children: { @@ -147,10 +166,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 20 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 74 +. . . . . . . . Line: 4 +. . . . . . . . Col: 23 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -161,9 +183,12 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -172,7 +197,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 51 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -188,14 +213,17 @@ Module { . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationArgumentName . . . . . . . TOKEN "arg2" . . . . . . . StartPosition: { -. . . . . . . . Offset: 77 +. . . . . . . . Offset: 0 . . . . . . . . Line: 4 . . . . . . . . Col: 26 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 29 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -203,14 +231,17 @@ Module { . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationVarArgsList,FunctionDeclarationArgumentName . . . . . . . TOKEN "kwparameters2" . . . . . . . StartPosition: { -. . . . . . . . Offset: 95 +. . . . . . . . Offset: 0 . . . . . . . . Line: 4 . . . . . . . . Col: 44 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 56 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 56 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: kwarg . . . . . . . } . . . . . . } @@ -218,14 +249,17 @@ Module { . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationVarArgsList,FunctionDeclarationArgumentName . . . . . . . TOKEN "varargs" . . . . . . . StartPosition: { -. . . . . . . . Offset: 84 +. . . . . . . . Offset: 0 . . . . . . . . Line: 4 . . . . . . . . Col: 33 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 39 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 39 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: vararg . . . . . . . } . . . . . . } @@ -240,14 +274,10 @@ Module { . . . . . . 0: Pass { . . . . . . . Roles: Noop . . . . . . . StartPosition: { -. . . . . . . . Offset: 115 +. . . . . . . . Offset: 0 . . . . . . . . Line: 5 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 56 -. . . . . . . . end_lineno: 4 -. . . . . . . } . . . . . . } . . . . . } . . . . } diff --git a/tests/functiondef_simple.py.native b/tests/functiondef_simple.py.native index a5808f18..6caf0053 100644 --- a/tests/functiondef_simple.py.native +++ b/tests/functiondef_simple.py.native @@ -52,8 +52,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 29, - "end_lineno": 1, "lineno": 2 }, { diff --git a/tests/functiondef_simple.py.uast b/tests/functiondef_simple.py.uast index 525a9428..2cca378a 100644 --- a/tests/functiondef_simple.py.uast +++ b/tests/functiondef_simple.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 20 -. . end_lineno: 6 +. EndPosition: { +. . Offset: 102 +. . Line: 6 +. . Col: 20 . } . Children: { . . 0: FunctionDef { @@ -21,9 +23,12 @@ Module { . . . . Line: 1 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 55 +. . . . Line: 3 +. . . . Col: 15 +. . . } . . . Properties: { -. . . . end_col_offset: 15 -. . . . end_lineno: 3 . . . . internalRole: body . . . . returns: . . . } @@ -35,9 +40,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 15 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 28 +. . . . . . Line: 1 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 29 -. . . . . . end_lineno: 1 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -51,10 +59,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 1 +. . . . . . . . Col: 17 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 17 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -66,10 +77,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 20 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 22 +. . . . . . . . Line: 1 +. . . . . . . . Col: 23 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -81,10 +95,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 26 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 28 +. . . . . . . . Line: 1 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 29 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -103,10 +120,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 29 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . . 1: Return { . . . . . . . Roles: Return @@ -115,9 +128,10 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 15 -. . . . . . . . end_lineno: 3 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 55 +. . . . . . . . Line: 3 +. . . . . . . . Col: 15 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { @@ -128,10 +142,13 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 12 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 55 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 15 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 15 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -149,9 +166,12 @@ Module { . . . . Line: 5 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 102 +. . . . Line: 6 +. . . . Col: 20 +. . . } . . . Properties: { -. . . . end_col_offset: 20 -. . . . end_lineno: 6 . . . . internalRole: body . . . . returns: . . . } @@ -163,9 +183,12 @@ Module { . . . . . . Line: 5 . . . . . . Col: 14 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 79 +. . . . . . Line: 5 +. . . . . . Col: 22 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 22 -. . . . . . end_lineno: 5 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -179,10 +202,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 13 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 71 +. . . . . . . . Line: 5 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -193,9 +219,12 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -204,7 +233,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 57 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -220,14 +249,17 @@ Module { . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationArgumentName . . . . . . . TOKEN "n2" . . . . . . . StartPosition: { -. . . . . . . . Offset: 74 +. . . . . . . . Offset: 0 . . . . . . . . Line: 5 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 5 +. . . . . . . . Col: 18 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 18 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -235,14 +267,17 @@ Module { . . . . . . . Roles: FunctionDeclarationArgument,FunctionDeclarationArgumentName . . . . . . . TOKEN "n3" . . . . . . . StartPosition: { -. . . . . . . . Offset: 78 +. . . . . . . . Offset: 0 . . . . . . . . Line: 5 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 5 +. . . . . . . . Col: 22 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -257,38 +292,45 @@ Module { . . . . . . 0: Expr { . . . . . . . Roles: Expression . . . . . . . StartPosition: { -. . . . . . . . Offset: 87 +. . . . . . . . Offset: 0 . . . . . . . . Line: 6 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 20 -. . . . . . . . end_lineno: 6 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 6 +. . . . . . . . Col: 20 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Yield { . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 87 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 20 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 20 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { . . . . . . . . . . 0: Tuple { . . . . . . . . . . . Roles: TupleLiteral . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 93 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . Col: 20 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 20 -. . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . internalRole: value . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -296,14 +338,17 @@ Module { . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . TOKEN "n1" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 93 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . . . Col: 11 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . . . Col: 12 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 12 -. . . . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . . . internalRole: elts . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -311,14 +356,17 @@ Module { . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . TOKEN "n2" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 97 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . . . Col: 15 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . . . Col: 16 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 16 -. . . . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . . . internalRole: elts . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -326,14 +374,17 @@ Module { . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . TOKEN "n3" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 101 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . . . Col: 19 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 6 +. . . . . . . . . . . . . . Col: 20 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 20 -. . . . . . . . . . . . . . end_lineno: 6 . . . . . . . . . . . . . . internalRole: elts . . . . . . . . . . . . . } . . . . . . . . . . . . } diff --git a/tests/functiondef_vararg.py.native b/tests/functiondef_vararg.py.native index 437ed764..9a07c006 100644 --- a/tests/functiondef_vararg.py.native +++ b/tests/functiondef_vararg.py.native @@ -51,15 +51,11 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 35, - "end_lineno": 1, "lineno": 2 }, { "ast_type": "Return", "col_offset": 5, - "end_col_offset": 35, - "end_lineno": 1, "lineno": 3, "value": null } diff --git a/tests/functiondef_vararg.py.uast b/tests/functiondef_vararg.py.uast index e923ee4e..eb1d82d4 100644 --- a/tests/functiondef_vararg.py.uast +++ b/tests/functiondef_vararg.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 35 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 34 +. . Line: 1 +. . Col: 35 . } . Children: { . . 0: FunctionDef { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 34 +. . . . Line: 1 +. . . . Col: 35 +. . . } . . . Properties: { -. . . . end_col_offset: 35 -. . . . end_lineno: 1 . . . . internalRole: body . . . . returns: . . . } @@ -35,9 +39,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 15 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 34 +. . . . . . Line: 1 +. . . . . . Col: 35 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 35 -. . . . . . end_lineno: 1 . . . . . . internalRole: args . . . . . . kwarg: . . . . . } @@ -50,10 +57,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 16 +. . . . . . . . Line: 1 +. . . . . . . . Col: 17 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 17 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -65,10 +75,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 20 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 22 +. . . . . . . . Line: 1 +. . . . . . . . Col: 23 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -80,10 +93,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 27 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 34 +. . . . . . . . Line: 1 +. . . . . . . . Col: 35 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 35 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: vararg . . . . . . . } . . . . . . } @@ -102,10 +118,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 35 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . . 1: Return { . . . . . . . Roles: Return @@ -115,8 +127,6 @@ Module { . . . . . . . . Col: 5 . . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 35 -. . . . . . . . end_lineno: 1 . . . . . . . . value: . . . . . . . } . . . . . . } diff --git a/tests/hello.py.uast b/tests/hello.py.uast index c1420894..ffd7bb0a 100644 --- a/tests/hello.py.uast +++ b/tests/hello.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 19 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 18 +. . Line: 1 +. . Col: 19 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 18 +. . . . Line: 1 +. . . . Col: 19 +. . . } . . . Properties: { -. . . . end_col_offset: 19 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 18 +. . . . . . Line: 1 +. . . . . . Col: 19 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 19 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,9 +54,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 7 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 18 +. . . . . . . . Line: 1 +. . . . . . . . Col: 19 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 19 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -61,10 +71,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 4 +. . . . . . . . Line: 1 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 5 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } diff --git a/tests/if.py.native b/tests/if.py.native index 5bcda907..7173c250 100644 --- a/tests/if.py.native +++ b/tests/if.py.native @@ -411,8 +411,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 16, - "end_lineno": 17, "lineno": 18 } ], @@ -429,7 +427,7 @@ "ast_type": "Name", "col_offset": 8, "ctx": "Load", - "end_col_offset": 14, + "end_col_offset": 8, "end_lineno": 17, "id": "b", "lineno": 17 @@ -438,7 +436,7 @@ "ast_type": "Name", "col_offset": 12, "ctx": "Load", - "end_col_offset": 14, + "end_col_offset": 12, "end_lineno": 17, "id": "c", "lineno": 17 diff --git a/tests/if.py.uast b/tests/if.py.uast index e371d6a0..5fb5557d 100644 --- a/tests/if.py.uast +++ b/tests/if.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 16 -. . end_lineno: 17 +. EndPosition: { +. . Offset: 179 +. . Line: 17 +. . Col: 16 . } . Children: { . . 0: If { @@ -20,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 22 +. . . . Line: 2 +. . . . Col: 14 +. . . } . . . Properties: { -. . . . end_col_offset: 14 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -39,9 +44,10 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 2 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 22 +. . . . . . . . Line: 2 +. . . . . . . . Col: 14 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -51,9 +57,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 22 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 14 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -65,9 +74,12 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 22 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 14 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -79,10 +91,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 17 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -100,9 +115,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 6 +. . . . . . Line: 1 +. . . . . . Col: 7 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 7 -. . . . . . end_lineno: 1 . . . . . . internalRole: test . . . . . } . . . . } @@ -115,9 +133,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 58 +. . . . Line: 5 +. . . . Col: 14 +. . . } . . . Properties: { -. . . . end_col_offset: 14 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -134,9 +155,10 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 5 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 58 +. . . . . . . . Line: 5 +. . . . . . . . Col: 14 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -146,9 +168,12 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 58 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 14 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -160,9 +185,12 @@ Module { . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 58 +. . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . Col: 14 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -174,10 +202,13 @@ Module { . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 53 +. . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -194,9 +225,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 40 +. . . . . . Line: 4 +. . . . . . Col: 15 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 15 -. . . . . . end_lineno: 4 . . . . . . internalRole: test . . . . . } . . . . . Children: { @@ -208,10 +242,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 4 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 40 +. . . . . . . . Line: 4 +. . . . . . . . Col: 15 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 15 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: func . . . . . . . } . . . . . . . Children: { @@ -222,9 +259,12 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -233,7 +273,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 25 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -252,13 +292,16 @@ Module { . . 2: If { . . . Roles: If . . . StartPosition: { -. . . . Offset: 62 +. . . . Offset: 0 . . . . Line: 7 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 15 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 11 -. . . . end_lineno: 15 . . . . internalRole: body . . . } . . . Children: { @@ -271,27 +314,31 @@ Module { . . . . . . 0: Assign { . . . . . . . Roles: Assignment . . . . . . . StartPosition: { -. . . . . . . . Offset: 76 +. . . . . . . . Offset: 0 . . . . . . . . Line: 8 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 8 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 8 +. . . . . . . . Col: 11 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { . . . . . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . . . . . TOKEN "a" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 76 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 8 +. . . . . . . . . . Col: 5 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 8 . . . . . . . . . . Col: 5 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 8 . . . . . . . . . . internalRole: targets . . . . . . . . . } . . . . . . . . } @@ -299,14 +346,17 @@ Module { . . . . . . . . . Roles: NumberLiteral,AssignmentValue . . . . . . . . . TOKEN "1.1" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 80 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 8 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 8 +. . . . . . . . . . Col: 11 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: float -. . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . end_lineno: 8 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -315,27 +365,31 @@ Module { . . . . . . 1: Assign { . . . . . . . Roles: Assignment . . . . . . . StartPosition: { -. . . . . . . . Offset: 88 +. . . . . . . . Offset: 0 . . . . . . . . Line: 9 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 9 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 9 +. . . . . . . . Col: 11 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { . . . . . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . . . . . TOKEN "x" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 88 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 5 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 5 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: targets . . . . . . . . . } . . . . . . . . } @@ -343,14 +397,17 @@ Module { . . . . . . . . . Roles: NumberLiteral,AssignmentValue . . . . . . . . . TOKEN "1.2" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 92 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 11 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: float -. . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -367,13 +424,14 @@ Module { . . . . . . 0: If { . . . . . . . Roles: If . . . . . . . StartPosition: { -. . . . . . . . Offset: 101 +. . . . . . . . Offset: 0 . . . . . . . . Line: 10 . . . . . . . . Col: 6 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 15 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 15 +. . . . . . . . Col: 11 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: If.body { @@ -385,27 +443,31 @@ Module { . . . . . . . . . . 0: Assign { . . . . . . . . . . . Roles: Assignment . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 113 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . end_lineno: 11 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . Col: 11 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Name { . . . . . . . . . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . . . . . . . . . TOKEN "c" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 113 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . . . Col: 5 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -413,14 +475,17 @@ Module { . . . . . . . . . . . . . Roles: NumberLiteral,AssignmentValue . . . . . . . . . . . . . TOKEN "2.1" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 117 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . . . Col: 11 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: float -. . . . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -429,27 +494,31 @@ Module { . . . . . . . . . . 1: Assign { . . . . . . . . . . . Roles: Assignment . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 125 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 12 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . end_lineno: 12 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 12 +. . . . . . . . . . . . Col: 11 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Name { . . . . . . . . . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . . . . . . . . . TOKEN "j" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 125 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 12 +. . . . . . . . . . . . . . Col: 5 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 12 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . . . . . end_lineno: 12 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -457,14 +526,17 @@ Module { . . . . . . . . . . . . . Roles: NumberLiteral,AssignmentValue . . . . . . . . . . . . . TOKEN "2.2" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 129 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 12 . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 12 +. . . . . . . . . . . . . . Col: 11 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: float -. . . . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . . . end_lineno: 12 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -481,27 +553,31 @@ Module { . . . . . . . . . . 0: Assign { . . . . . . . . . . . Roles: Assignment . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 143 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 14 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . end_lineno: 14 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . Col: 11 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Name { . . . . . . . . . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . . . . . . . . . TOKEN "b" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 143 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . . . Col: 5 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 14 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . . . . . end_lineno: 14 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -509,14 +585,17 @@ Module { . . . . . . . . . . . . . Roles: NumberLiteral,AssignmentValue . . . . . . . . . . . . . TOKEN "3.1" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 147 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 14 . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 14 +. . . . . . . . . . . . . . Col: 11 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: float -. . . . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . . . end_lineno: 14 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -525,27 +604,31 @@ Module { . . . . . . . . . . 1: Assign { . . . . . . . . . . . Roles: Assignment . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 155 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . end_lineno: 15 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . Col: 11 . . . . . . . . . . . } . . . . . . . . . . . Children: { . . . . . . . . . . . . 0: Name { . . . . . . . . . . . . . Roles: AssignmentVariable,SimpleIdentifier . . . . . . . . . . . . . TOKEN "p" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 155 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 5 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . . . Col: 5 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Store -. . . . . . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . . . . internalRole: targets . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -553,14 +636,17 @@ Module { . . . . . . . . . . . . . Roles: NumberLiteral,AssignmentValue . . . . . . . . . . . . . TOKEN "3.2" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 159 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 15 . . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 15 +. . . . . . . . . . . . . . Col: 11 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: float -. . . . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . . . end_lineno: 15 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -571,13 +657,16 @@ Module { . . . . . . . . 2: Compare { . . . . . . . . . Roles: IfCondition,BinaryExpression . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 101 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 10 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 10 +. . . . . . . . . . Col: 11 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . end_lineno: 10 . . . . . . . . . . internalRole: test . . . . . . . . . } . . . . . . . . . Children: { @@ -591,14 +680,17 @@ Module { . . . . . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . . . . . TOKEN "c" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 106 +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . . . Col: 11 +. . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 10 . . . . . . . . . . . . . . Col: 11 . . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . . . . . end_lineno: 10 . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . } @@ -607,14 +699,17 @@ Module { . . . . . . . . . . . Roles: SimpleIdentifier,BinaryExpressionLeft . . . . . . . . . . . TOKEN "b" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 101 +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . Col: 6 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 10 . . . . . . . . . . . . Col: 6 . . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . . . end_lineno: 10 . . . . . . . . . . . . internalRole: left . . . . . . . . . . . } . . . . . . . . . . } @@ -628,13 +723,14 @@ Module { . . . . . . . . . . . . . Roles: OpEqual . . . . . . . . . . . . . TOKEN "==" . . . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . . . Offset: 103 +. . . . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . . . Line: 10 . . . . . . . . . . . . . . Col: 8 . . . . . . . . . . . . . } -. . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . . . end_lineno: 10 +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . . . Col: 9 . . . . . . . . . . . . . } . . . . . . . . . . . . } . . . . . . . . . . . } @@ -648,13 +744,16 @@ Module { . . . . 2: Compare { . . . . . Roles: IfCondition,BinaryExpression . . . . . StartPosition: { -. . . . . . Offset: 65 +. . . . . . Offset: 0 . . . . . . Line: 7 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 7 +. . . . . . Col: 8 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 8 -. . . . . . end_lineno: 7 . . . . . . internalRole: test . . . . . } . . . . . Children: { @@ -668,14 +767,17 @@ Module { . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . TOKEN "b" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 69 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 8 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 8 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 8 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -684,27 +786,33 @@ Module { . . . . . . . Roles: SimpleIdentifier,BinaryExpressionLeft . . . . . . . TOKEN "a" . . . . . . . StartPosition: { -. . . . . . . . Offset: 65 +. . . . . . . . Offset: 0 +. . . . . . . . Line: 7 +. . . . . . . . Col: 4 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 . . . . . . . . Line: 7 . . . . . . . . Col: 4 . . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: left . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { . . . . . . . . . Roles: Whitespace . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 61 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -713,7 +821,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 61 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 6 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -735,13 +843,14 @@ Module { . . . . . . . . . Roles: OpGreaterThan . . . . . . . . . TOKEN ">" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 67 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 6 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 7 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 6 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -753,13 +862,16 @@ Module { . . 3: If { . . . Roles: If . . . StartPosition: { -. . . . Offset: 164 +. . . . Offset: 0 . . . . Line: 17 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 17 +. . . . Col: 16 +. . . } . . . Properties: { -. . . . end_col_offset: 16 -. . . . end_lineno: 17 . . . . internalRole: body . . . } . . . Children: { @@ -772,27 +884,26 @@ Module { . . . . . . 0: Pass { . . . . . . . Roles: Noop . . . . . . . StartPosition: { -. . . . . . . . Offset: 186 +. . . . . . . . Offset: 0 . . . . . . . . Line: 18 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 17 -. . . . . . . } . . . . . . } . . . . . } . . . . } . . . . 1: Compare { . . . . . Roles: IfCondition,BinaryExpression . . . . . StartPosition: { -. . . . . . Offset: 167 +. . . . . . Offset: 0 . . . . . . Line: 17 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 17 +. . . . . . Col: 16 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 16 -. . . . . . end_lineno: 17 . . . . . . internalRole: test . . . . . } . . . . . Children: { @@ -806,42 +917,51 @@ Module { . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . TOKEN "b" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 171 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 17 +. . . . . . . . . . Col: 8 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 17 . . . . . . . . . . Col: 8 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 17 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: Name { . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . TOKEN "c" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 175 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 17 +. . . . . . . . . . Col: 12 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 17 . . . . . . . . . . Col: 12 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 17 . . . . . . . . . } . . . . . . . . } . . . . . . . . 2: Name { . . . . . . . . . Roles: SimpleIdentifier . . . . . . . . . TOKEN "d" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 179 +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 17 +. . . . . . . . . . Col: 16 +. . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 17 . . . . . . . . . . Col: 16 . . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 16 -. . . . . . . . . . end_lineno: 17 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -850,27 +970,33 @@ Module { . . . . . . . Roles: SimpleIdentifier,BinaryExpressionLeft . . . . . . . TOKEN "a" . . . . . . . StartPosition: { -. . . . . . . . Offset: 167 +. . . . . . . . Offset: 0 +. . . . . . . . Line: 17 +. . . . . . . . Col: 4 +. . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 . . . . . . . . Line: 17 . . . . . . . . Col: 4 . . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 17 . . . . . . . . internalRole: left . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { . . . . . . . . . Roles: Whitespace . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 163 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 16 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 16 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 16 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -879,7 +1005,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 163 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 16 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -901,39 +1027,42 @@ Module { . . . . . . . . . Roles: OpGreaterThan . . . . . . . . . TOKEN ">" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 169 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 17 . . . . . . . . . . Col: 6 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 17 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 17 +. . . . . . . . . . Col: 6 . . . . . . . . . } . . . . . . . . } . . . . . . . . 1: Gt { . . . . . . . . . Roles: OpGreaterThan . . . . . . . . . TOKEN ">" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 173 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 17 . . . . . . . . . . Col: 10 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . end_lineno: 17 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 17 +. . . . . . . . . . Col: 10 . . . . . . . . . } . . . . . . . . } . . . . . . . . 2: Gt { . . . . . . . . . Roles: OpGreaterThan . . . . . . . . . TOKEN ">" . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 177 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 17 . . . . . . . . . . Col: 14 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 17 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 17 +. . . . . . . . . . Col: 14 . . . . . . . . . } . . . . . . . . } . . . . . . . } diff --git a/tests/ifexpression.py.native b/tests/ifexpression.py.native index 2a87399d..881ac11f 100644 --- a/tests/ifexpression.py.native +++ b/tests/ifexpression.py.native @@ -29,7 +29,7 @@ "NumType": "int", "ast_type": "NumLiteral", "col_offset": 5, - "end_col_offset": 14, + "end_col_offset": 5, "end_lineno": 1, "lineno": 1 }, diff --git a/tests/ifexpression.py.uast b/tests/ifexpression.py.uast index 3871412f..6eca1a12 100644 --- a/tests/ifexpression.py.uast +++ b/tests/ifexpression.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 21 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 20 +. . Line: 1 +. . Col: 21 . } . Children: { . . 0: Assign { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 20 +. . . . Line: 1 +. . . . Col: 21 +. . . } . . . Properties: { -. . . . end_col_offset: 21 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -34,10 +38,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 1 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 1 . . . . . . internalRole: targets . . . . . } . . . . } @@ -48,9 +55,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 20 +. . . . . . Line: 1 +. . . . . . Col: 21 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 21 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -62,10 +72,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 4 +. . . . . . . . Line: 1 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: body . . . . . . . } . . . . . . } @@ -77,10 +90,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 20 +. . . . . . . . Line: 1 +. . . . . . . . Col: 21 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 21 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: orelse . . . . . . . } . . . . . . } @@ -91,9 +107,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 10 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 13 +. . . . . . . . Line: 1 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: test . . . . . . . } . . . . . . . Children: { @@ -110,10 +129,13 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 14 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 13 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 14 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . . . end_lineno: 1 . . . . . . . . . . . } . . . . . . . . . . } . . . . . . . . . } @@ -126,10 +148,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 10 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 9 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 10 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -146,9 +171,10 @@ Module { . . . . . . . . . . . . Line: 1 . . . . . . . . . . . . Col: 12 . . . . . . . . . . . } -. . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 12 -. . . . . . . . . . . . end_lineno: 1 +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 11 +. . . . . . . . . . . . Line: 1 +. . . . . . . . . . . . Col: 12 . . . . . . . . . . . } . . . . . . . . . . } . . . . . . . . . } diff --git a/tests/import.py.uast b/tests/import.py.uast index b3189e4f..75931436 100644 --- a/tests/import.py.uast +++ b/tests/import.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 32 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 77 +. . Line: 4 +. . Col: 32 . } . Children: { . . 0: Import { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 9 +. . . . Line: 1 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -39,10 +43,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 8 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 9 +. . . . . . . . Line: 1 +. . . . . . . . Col: 10 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 1 . . . . . . . } . . . . . . } . . . . . } @@ -56,9 +63,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 24 +. . . . Line: 2 +. . . . Col: 14 +. . . } . . . Properties: { -. . . . end_col_offset: 14 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -75,10 +85,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 8 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 20 +. . . . . . . . Line: 2 +. . . . . . . . Col: 10 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 2 . . . . . . . } . . . . . . } . . . . . . 1: alias { @@ -89,10 +102,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 13 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 24 +. . . . . . . . Line: 2 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 2 . . . . . . . } . . . . . . } . . . . . } @@ -107,9 +123,12 @@ Module { . . . . Line: 3 . . . . Col: 6 . . . } +. . . EndPosition: { +. . . . Offset: 44 +. . . . Line: 3 +. . . . Col: 19 +. . . } . . . Properties: { -. . . . end_col_offset: 19 -. . . . end_lineno: 3 . . . . internalRole: body . . . . level: 0 . . . } @@ -127,10 +146,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 16 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 44 +. . . . . . . . Line: 3 +. . . . . . . . Col: 19 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 19 -. . . . . . . . end_lineno: 3 . . . . . . . } . . . . . . } . . . . . } @@ -145,9 +167,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 77 +. . . . Line: 4 +. . . . Col: 32 +. . . } . . . Properties: { -. . . . end_col_offset: 32 -. . . . end_lineno: 4 . . . . internalRole: body . . . . level: 0 . . . } @@ -165,10 +190,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 69 +. . . . . . . . Line: 4 +. . . . . . . . Col: 24 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 24 -. . . . . . . . end_lineno: 4 . . . . . . . } . . . . . . } . . . . . . 1: alias { @@ -179,10 +207,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 27 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 77 +. . . . . . . . Line: 4 +. . . . . . . . Col: 32 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 32 -. . . . . . . . end_lineno: 4 . . . . . . . } . . . . . . } . . . . . } diff --git a/tests/issue30.py.uast b/tests/issue30.py.uast index 4896b099..dd5b3777 100644 --- a/tests/issue30.py.uast +++ b/tests/issue30.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 33 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 43 +. . Line: 2 +. . Col: 33 . } . Children: { . . 0: Import { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 9 +. . . . Line: 1 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -39,10 +43,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 8 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 9 +. . . . . . . . Line: 1 +. . . . . . . . Col: 10 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . asname: -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 1 . . . . . . . } . . . . . . } . . . . . } @@ -56,9 +63,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 43 +. . . . Line: 2 +. . . . Col: 33 +. . . } . . . Properties: { -. . . . end_col_offset: 33 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -69,9 +79,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 13 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 43 +. . . . . . Line: 2 +. . . . . . Col: 33 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 33 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -84,9 +97,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 18 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 43 +. . . . . . . . Line: 2 +. . . . . . . . Col: 33 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 33 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -98,10 +114,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 26 +. . . . . . . . Line: 2 +. . . . . . . . Col: 16 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: func . . . . . . . } . . . . . . . Children: { @@ -113,10 +132,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 20 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 10 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 10 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -128,10 +150,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 13 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: value . . . . . . . . . . . } . . . . . . . . . . } diff --git a/tests/line_comment.py.native b/tests/line_comment.py.native index f2cb51cb..60218c41 100644 --- a/tests/line_comment.py.native +++ b/tests/line_comment.py.native @@ -8,6 +8,8 @@ { "ast_type": "Pass", "col_offset": 1, + "end_col_offset": 23, + "end_lineno": 3, "lineno": 3, "noops_previous": { "ast_type": "PreviousNoops", @@ -32,16 +34,17 @@ }, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 23, "col_offset": 5, - "end_col_offset": 19, - "end_lineno": 2, + "end_col_offset": 23, + "end_lineno": 3, "lineno": 3, "noop_line": "# sameline comment" } } ], "col_offset": 1, + "end_col_offset": 1, + "end_lineno": 6, "lineno": 1, "noops_remainder": { "ast_type": "RemainderNoops", diff --git a/tests/line_comment.py.uast b/tests/line_comment.py.uast index 18147081..570a8505 100644 --- a/tests/line_comment.py.uast +++ b/tests/line_comment.py.uast @@ -8,6 +8,11 @@ Module { . . Line: 1 . . Col: 1 . } +. EndPosition: { +. . Offset: 88 +. . Line: 6 +. . Col: 1 +. } . Children: { . . 0: Pass { . . . Roles: Noop @@ -16,6 +21,11 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 53 +. . . . Line: 3 +. . . . Col: 23 +. . . } . . . Properties: { . . . . internalRole: body . . . } @@ -27,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 29 +. . . . . . Line: 2 +. . . . . . Col: 19 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 19 -. . . . . . end_lineno: 2 . . . . . . internalRole: noops_previous . . . . . } . . . . . Children: { @@ -69,10 +82,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 53 +. . . . . . Line: 3 +. . . . . . Col: 23 +. . . . . } . . . . . Properties: { -. . . . . . col_end: 23 -. . . . . . end_col_offset: 19 -. . . . . . end_lineno: 2 . . . . . . internalRole: noops_sameline . . . . . } . . . . } @@ -85,9 +100,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 88 +. . . . Line: 6 +. . . . Col: 1 +. . . } . . . Properties: { -. . . . end_col_offset: 1 -. . . . end_lineno: 6 . . . . internalRole: noops_remainder . . . } . . . Children: { diff --git a/tests/literals_assign.py.native b/tests/literals_assign.py.native index 234084cb..f15cf111 100644 --- a/tests/literals_assign.py.native +++ b/tests/literals_assign.py.native @@ -8,7 +8,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 5, + "end_col_offset": 11, "end_lineno": 1, "lineno": 1, "targets": [ @@ -16,16 +16,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 11, "end_lineno": 1, "id": "a", "lineno": 1, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 11, "col_offset": 6, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 11, + "end_lineno": 1, "lineno": 1, "noop_line": "# int" } @@ -44,7 +43,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 8, + "end_col_offset": 16, "end_lineno": 2, "lineno": 2, "targets": [ @@ -52,16 +51,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 16, "end_lineno": 2, "id": "b", "lineno": 2, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 16, "col_offset": 9, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 16, + "end_lineno": 2, "lineno": 2, "noop_line": "# float" } @@ -80,7 +78,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 16, + "end_col_offset": 25, "end_lineno": 3, "lineno": 3, "targets": [ @@ -88,16 +86,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 25, "end_lineno": 3, "id": "c", "lineno": 3, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 25, "col_offset": 17, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 25, + "end_lineno": 3, "lineno": 3, "noop_line": "# string" } @@ -115,7 +112,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 8, + "end_col_offset": 15, "end_lineno": 4, "lineno": 4, "targets": [ @@ -123,16 +120,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 15, "end_lineno": 4, "id": "d", "lineno": 4, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 15, "col_offset": 9, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 15, + "end_lineno": 4, "lineno": 4, "noop_line": "# None" } @@ -150,7 +146,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 12, + "end_col_offset": 28, "end_lineno": 5, "lineno": 5, "targets": [ @@ -158,16 +154,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 28, "end_lineno": 5, "id": "e", "lineno": 5, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 28, "col_offset": 14, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 28, + "end_lineno": 5, "lineno": 5, "noop_line": "# list literal" } @@ -214,7 +209,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 12, + "end_col_offset": 29, "end_lineno": 6, "lineno": 6, "targets": [ @@ -222,16 +217,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 29, "end_lineno": 6, "id": "f", "lineno": 6, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 29, "col_offset": 14, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 29, + "end_lineno": 6, "lineno": 6, "noop_line": "# tuple literal" } @@ -278,7 +272,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 12, + "end_col_offset": 27, "end_lineno": 7, "lineno": 7, "targets": [ @@ -286,16 +280,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 27, "end_lineno": 7, "id": "g", "lineno": 7, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 27, "col_offset": 14, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 27, + "end_lineno": 7, "lineno": 7, "noop_line": "# set literal" } @@ -341,7 +334,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 19, + "end_col_offset": 35, "end_lineno": 8, "lineno": 8, "targets": [ @@ -349,16 +342,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 35, "end_lineno": 8, "id": "h", "lineno": 8, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 35, "col_offset": 21, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 35, + "end_lineno": 8, "lineno": 8, "noop_line": "# dict literal" } @@ -394,7 +386,7 @@ "NumType": "int", "ast_type": "NumLiteral", "col_offset": 11, - "end_col_offset": 16, + "end_col_offset": 11, "end_lineno": 8, "lineno": 8 }, @@ -413,7 +405,7 @@ { "ast_type": "Assign", "col_offset": 1, - "end_col_offset": 17, + "end_col_offset": 42, "end_lineno": 9, "lineno": 9, "targets": [ @@ -421,16 +413,15 @@ "ast_type": "Name", "col_offset": 1, "ctx": "Store", - "end_col_offset": 1, + "end_col_offset": 42, "end_lineno": 9, "id": "i", "lineno": 9, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 42, "col_offset": 19, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 42, + "end_lineno": 9, "lineno": 9, "noop_line": "# expression assignment" } @@ -513,7 +504,7 @@ } ], "col_offset": 1, - "end_col_offset": 17, + "end_col_offset": 42, "end_lineno": 9, "lineno": 1 } diff --git a/tests/literals_assign.py.uast b/tests/literals_assign.py.uast index c7b3de2a..d11374fc 100644 --- a/tests/literals_assign.py.uast +++ b/tests/literals_assign.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 17 -. . end_lineno: 9 +. EndPosition: { +. . Offset: 235 +. . Line: 9 +. . Col: 42 . } . Children: { . . 0: Assign { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 10 +. . . . Line: 1 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 5 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -34,10 +38,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 10 +. . . . . . Line: 1 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 1 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -49,10 +56,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 10 +. . . . . . . . Line: 1 +. . . . . . . . Col: 11 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 11 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -66,10 +75,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 4 +. . . . . . Line: 1 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . } @@ -82,9 +94,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 27 +. . . . Line: 2 +. . . . Col: 16 +. . . } . . . Properties: { -. . . . end_col_offset: 8 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -96,10 +111,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 27 +. . . . . . Line: 2 +. . . . . . Col: 16 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 2 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -111,10 +129,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 27 +. . . . . . . . Line: 2 +. . . . . . . . Col: 16 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 16 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -128,10 +148,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 19 +. . . . . . Line: 2 +. . . . . . Col: 8 +. . . . . } . . . . . Properties: { . . . . . . NumType: float -. . . . . . end_col_offset: 8 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . } @@ -144,9 +167,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 53 +. . . . Line: 3 +. . . . Col: 25 +. . . } . . . Properties: { -. . . . end_col_offset: 16 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -158,10 +184,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 53 +. . . . . . Line: 3 +. . . . . . Col: 25 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 3 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -173,10 +202,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 53 +. . . . . . . . Line: 3 +. . . . . . . . Col: 25 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 25 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -190,9 +221,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 44 +. . . . . . Line: 3 +. . . . . . Col: 16 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 16 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . } @@ -205,9 +239,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 69 +. . . . Line: 4 +. . . . Col: 15 +. . . } . . . Properties: { -. . . . end_col_offset: 8 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -219,10 +256,13 @@ Module { . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 69 +. . . . . . Line: 4 +. . . . . . Col: 15 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 4 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -234,10 +274,12 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 69 +. . . . . . . . Line: 4 +. . . . . . . . Col: 15 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 15 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -251,9 +293,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 62 +. . . . . . Line: 4 +. . . . . . Col: 8 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 8 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . } @@ -266,9 +311,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 98 +. . . . Line: 5 +. . . . Col: 28 +. . . } . . . Properties: { -. . . . end_col_offset: 12 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -280,10 +328,13 @@ Module { . . . . . . Line: 5 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 98 +. . . . . . Line: 5 +. . . . . . Col: 28 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 5 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -295,10 +346,12 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 98 +. . . . . . . . Line: 5 +. . . . . . . . Col: 28 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 28 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -311,10 +364,13 @@ Module { . . . . . . Line: 5 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 82 +. . . . . . Line: 5 +. . . . . . Col: 12 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 12 -. . . . . . end_lineno: 5 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -326,10 +382,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 76 +. . . . . . . . Line: 5 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -341,10 +400,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 79 +. . . . . . . . Line: 5 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -356,10 +418,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 82 +. . . . . . . . Line: 5 +. . . . . . . . Col: 12 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 12 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -374,9 +439,12 @@ Module { . . . . Line: 6 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 128 +. . . . Line: 6 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 12 -. . . . end_lineno: 6 . . . . internalRole: body . . . } . . . Children: { @@ -388,10 +456,13 @@ Module { . . . . . . Line: 6 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 128 +. . . . . . Line: 6 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 6 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -403,10 +474,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 128 +. . . . . . . . Line: 6 +. . . . . . . . Col: 29 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 29 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -419,10 +492,13 @@ Module { . . . . . . Line: 6 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 111 +. . . . . . Line: 6 +. . . . . . Col: 12 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 12 -. . . . . . end_lineno: 6 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -434,10 +510,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 105 +. . . . . . . . Line: 6 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -449,10 +528,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 108 +. . . . . . . . Line: 6 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -464,10 +546,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 111 +. . . . . . . . Line: 6 +. . . . . . . . Col: 12 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 12 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -482,9 +567,12 @@ Module { . . . . Line: 7 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 156 +. . . . Line: 7 +. . . . Col: 27 +. . . } . . . Properties: { -. . . . end_col_offset: 12 -. . . . end_lineno: 7 . . . . internalRole: body . . . } . . . Children: { @@ -496,10 +584,13 @@ Module { . . . . . . Line: 7 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 156 +. . . . . . Line: 7 +. . . . . . Col: 27 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 7 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -511,10 +602,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 156 +. . . . . . . . Line: 7 +. . . . . . . . Col: 27 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 27 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -527,9 +620,12 @@ Module { . . . . . . Line: 7 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 141 +. . . . . . Line: 7 +. . . . . . Col: 12 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 12 -. . . . . . end_lineno: 7 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -541,10 +637,13 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 135 +. . . . . . . . Line: 7 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -556,10 +655,13 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 9 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 138 +. . . . . . . . Line: 7 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -571,10 +673,13 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 12 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 141 +. . . . . . . . Line: 7 +. . . . . . . . Col: 12 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 12 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: elts . . . . . . . } . . . . . . } @@ -589,9 +694,12 @@ Module { . . . . Line: 8 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 192 +. . . . Line: 8 +. . . . Col: 35 +. . . } . . . Properties: { -. . . . end_col_offset: 19 -. . . . end_lineno: 8 . . . . internalRole: body . . . } . . . Children: { @@ -603,10 +711,13 @@ Module { . . . . . . Line: 8 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 192 +. . . . . . Line: 8 +. . . . . . Col: 35 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 8 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -618,10 +729,12 @@ Module { . . . . . . . . Line: 8 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 192 +. . . . . . . . Line: 8 +. . . . . . . . Col: 35 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 35 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -634,9 +747,12 @@ Module { . . . . . . Line: 8 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 176 +. . . . . . Line: 8 +. . . . . . Col: 19 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 19 -. . . . . . end_lineno: 8 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -648,9 +764,12 @@ Module { . . . . . . . . Line: 8 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 165 +. . . . . . . . Line: 8 +. . . . . . . . Col: 8 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 8 -. . . . . . . . end_lineno: 8 . . . . . . . . internalRole: keys . . . . . . . } . . . . . . } @@ -662,9 +781,12 @@ Module { . . . . . . . . Line: 8 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 173 +. . . . . . . . Line: 8 +. . . . . . . . Col: 16 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 8 . . . . . . . . internalRole: keys . . . . . . . } . . . . . . } @@ -676,10 +798,13 @@ Module { . . . . . . . . Line: 8 . . . . . . . . Col: 11 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 168 +. . . . . . . . Line: 8 +. . . . . . . . Col: 11 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 16 -. . . . . . . . end_lineno: 8 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -691,10 +816,13 @@ Module { . . . . . . . . Line: 8 . . . . . . . . Col: 19 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 176 +. . . . . . . . Line: 8 +. . . . . . . . Col: 19 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 19 -. . . . . . . . end_lineno: 8 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -709,9 +837,12 @@ Module { . . . . Line: 9 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 235 +. . . . Line: 9 +. . . . Col: 42 +. . . } . . . Properties: { -. . . . end_col_offset: 17 -. . . . end_lineno: 9 . . . . internalRole: body . . . } . . . Children: { @@ -723,10 +854,13 @@ Module { . . . . . . Line: 9 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 235 +. . . . . . Line: 9 +. . . . . . Col: 42 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 9 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -738,10 +872,12 @@ Module { . . . . . . . . Line: 9 . . . . . . . . Col: 19 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 235 +. . . . . . . . Line: 9 +. . . . . . . . Col: 42 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . col_end: 42 -. . . . . . . . end_col_offset: -. . . . . . . . end_lineno: . . . . . . . . internalRole: noops_sameline . . . . . . . } . . . . . . } @@ -754,9 +890,12 @@ Module { . . . . . . Line: 9 . . . . . . Col: 11 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 210 +. . . . . . Line: 9 +. . . . . . Col: 17 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 17 -. . . . . . end_lineno: 9 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -767,9 +906,12 @@ Module { . . . . . . . . Line: 9 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 202 +. . . . . . . . Line: 9 +. . . . . . . . Col: 9 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 9 . . . . . . . . internalRole: left . . . . . . . } . . . . . . . Children: { @@ -781,10 +923,13 @@ Module { . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 198 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: left . . . . . . . . . } . . . . . . . . } @@ -796,9 +941,12 @@ Module { . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 7 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 200 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 7 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 7 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: op . . . . . . . . . } . . . . . . . . } @@ -810,10 +958,13 @@ Module { . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 202 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 9 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: right . . . . . . . . . } . . . . . . . . } @@ -827,9 +978,12 @@ Module { . . . . . . . . Line: 9 . . . . . . . . Col: 11 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 204 +. . . . . . . . Line: 9 +. . . . . . . . Col: 11 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 9 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -840,9 +994,12 @@ Module { . . . . . . . . Line: 9 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 210 +. . . . . . . . Line: 9 +. . . . . . . . Col: 17 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 17 -. . . . . . . . end_lineno: 9 . . . . . . . . internalRole: right . . . . . . . } . . . . . . . Children: { @@ -854,10 +1011,13 @@ Module { . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 17 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 210 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 17 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 17 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: args . . . . . . . . . } . . . . . . . . } @@ -869,10 +1029,13 @@ Module { . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 13 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 208 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 15 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 15 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: func . . . . . . . . . } . . . . . . . . } diff --git a/tests/loop_if.py.native b/tests/loop_if.py.native index 187b1df8..6b242efe 100644 --- a/tests/loop_if.py.native +++ b/tests/loop_if.py.native @@ -11,8 +11,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 18, - "end_lineno": 1, "lineno": 2 } ], diff --git a/tests/loop_if.py.uast b/tests/loop_if.py.uast index 4abf5a50..f69dfc96 100644 --- a/tests/loop_if.py.uast +++ b/tests/loop_if.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 34 -. . end_lineno: 4 +. EndPosition: { +. . Offset: 68 +. . Line: 4 +. . Col: 34 . } . Children: { . . 0: For { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 68 +. . . . Line: 4 +. . . . Col: 34 +. . . } . . . Properties: { -. . . . end_col_offset: 34 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -39,10 +43,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 18 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -54,10 +54,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 10 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 17 +. . . . . . Line: 1 +. . . . . . Col: 18 +. . . . . } . . . . . Properties: { . . . . . . ctx: Load -. . . . . . end_col_offset: 18 -. . . . . . end_lineno: 1 . . . . . . internalRole: iter . . . . . } . . . . } @@ -74,9 +77,10 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 34 -. . . . . . . . end_lineno: 4 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 68 +. . . . . . . . Line: 4 +. . . . . . . . Col: 34 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -86,9 +90,12 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 68 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 34 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 34 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -100,9 +107,12 @@ Module { . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 68 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 34 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 34 -. . . . . . . . . . . . end_lineno: 4 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -114,10 +124,13 @@ Module { . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 43 +. . . . . . . . . . . . Line: 4 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 4 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -135,10 +148,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 4 +. . . . . . Line: 1 +. . . . . . Col: 5 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 5 -. . . . . . end_lineno: 1 . . . . . . internalRole: target . . . . . } . . . . } diff --git a/tests/pass.py.native b/tests/pass.py.native index 2657494b..85894f3a 100644 --- a/tests/pass.py.native +++ b/tests/pass.py.native @@ -8,13 +8,14 @@ { "ast_type": "Pass", "col_offset": 1, + "end_col_offset": 11, + "end_lineno": 1, "lineno": 1, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 11, "col_offset": 5, - "end_col_offset": null, - "end_lineno": null, + "end_col_offset": 11, + "end_lineno": 1, "lineno": 1, "noop_line": "# easy" } @@ -36,6 +37,8 @@ { "ast_type": "Pass", "col_offset": 16, + "end_col_offset": 0, + "end_lineno": 2, "lineno": 3, "noops_previous": { "ast_type": "PreviousNoops", @@ -68,8 +71,6 @@ "ast_type": "arguments", "col_offset": 1, "defaults": [], - "end_col_offset": 11, - "end_lineno": 3, "kw_defaults": [], "kwarg": null, "kwonlyargs": [], @@ -81,8 +82,8 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 11, - "end_lineno": 3, + "end_col_offset": 0, + "end_lineno": 4, "lineno": 6, "noops_previous": { "ast_type": "PreviousNoops", diff --git a/tests/pass.py.uast b/tests/pass.py.uast index 9fbeb932..ebe5bcd6 100644 --- a/tests/pass.py.uast +++ b/tests/pass.py.uast @@ -1,5 +1,6 @@ -Status: ok +Status: error Errors: + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -8,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 12 -. . end_lineno: 5 +. EndPosition: { +. . Offset: 45 +. . Line: 5 +. . Col: 12 . } . Children: { . . 0: Pass { @@ -20,6 +22,11 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 10 +. . . . Line: 1 +. . . . Col: 11 +. . . } . . . Properties: { . . . . internalRole: body . . . } @@ -32,10 +39,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 10 +. . . . . . Line: 1 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { -. . . . . . col_end: 11 -. . . . . . end_col_offset: -. . . . . . end_lineno: . . . . . . internalRole: noops_sameline . . . . . } . . . . } @@ -49,9 +58,12 @@ Module { . . . . Line: 3 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 23 +. . . . Line: 3 +. . . . Col: 11 +. . . } . . . Properties: { -. . . . end_col_offset: 11 -. . . . end_lineno: 3 . . . . internalRole: body . . . . returns: . . . } @@ -82,17 +94,25 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 16 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 2 +. . . . . . . . Col: 0 +. . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { . . . . . . . . . Roles: Whitespace . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 12 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -101,7 +121,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 12 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -121,13 +141,16 @@ Module { . . . Roles: FunctionDeclaration,FunctionDeclarationName,SimpleIdentifier . . . TOKEN "otherfun" . . . StartPosition: { -. . . . Offset: 38 +. . . . Offset: 0 . . . . Line: 5 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 5 +. . . . Col: 12 +. . . } . . . Properties: { -. . . . end_col_offset: 12 -. . . . end_lineno: 5 . . . . internalRole: body . . . . returns: . . . } @@ -135,13 +158,11 @@ Module { . . . . 0: arguments { . . . . . Roles: FunctionDeclarationArgument . . . . . StartPosition: { -. . . . . . Offset: 34 +. . . . . . Offset: 0 . . . . . . Line: 5 . . . . . . Col: 1 . . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 11 -. . . . . . end_lineno: 3 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -156,25 +177,29 @@ Module { . . . . . . 0: Pass { . . . . . . . Roles: Noop . . . . . . . StartPosition: { -. . . . . . . . Offset: 54 +. . . . . . . . Offset: 0 . . . . . . . . Line: 6 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 11 -. . . . . . . . end_lineno: 3 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 4 +. . . . . . . . Col: 0 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: PreviousNoops { . . . . . . . . . Roles: Whitespace . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 33 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -183,7 +208,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 33 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 4 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } diff --git a/tests/print.py.uast b/tests/print.py.uast index 61fd6b7c..094e657a 100644 --- a/tests/print.py.uast +++ b/tests/print.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 7 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 15 +. . Line: 2 +. . Col: 7 . } . Children: { . . 0: Print { @@ -21,10 +22,13 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 6 +. . . . Line: 1 +. . . . Col: 7 +. . . } . . . Properties: { . . . . dest: -. . . . end_col_offset: 7 -. . . . end_lineno: 1 . . . . internalRole: body . . . . nl: true . . . } @@ -37,10 +41,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 7 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 6 +. . . . . . Line: 1 +. . . . . . Col: 7 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 7 -. . . . . . end_lineno: 1 . . . . . . internalRole: values . . . . . } . . . . } @@ -54,10 +61,13 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 15 +. . . . Line: 2 +. . . . Col: 7 +. . . } . . . Properties: { . . . . dest: -. . . . end_col_offset: 7 -. . . . end_lineno: 2 . . . . internalRole: body . . . . nl: true . . . } @@ -70,10 +80,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 7 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 15 +. . . . . . Line: 2 +. . . . . . Col: 7 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 7 -. . . . . . end_lineno: 2 . . . . . . internalRole: values . . . . . } . . . . } diff --git a/tests/qualified.py.uast b/tests/qualified.py.uast index 2812215e..699a30d5 100644 --- a/tests/qualified.py.uast +++ b/tests/qualified.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 13 -. . end_lineno: 3 +. EndPosition: { +. . Offset: 33 +. . Line: 3 +. . Col: 13 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 9 +. . . . Line: 1 +. . . . Col: 10 +. . . } . . . Properties: { -. . . . end_col_offset: 10 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 6 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 9 +. . . . . . Line: 1 +. . . . . . Col: 10 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 10 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,10 +54,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 5 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 9 +. . . . . . . . Line: 1 +. . . . . . . . Col: 10 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 10 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . . Children: { @@ -62,10 +72,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 2 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 3 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -82,9 +95,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 19 +. . . . Line: 2 +. . . . Col: 7 +. . . } . . . Properties: { -. . . . end_col_offset: 7 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -96,10 +112,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 3 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 15 +. . . . . . Line: 2 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 2 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -111,10 +130,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 13 +. . . . . . . . Line: 2 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: value . . . . . . . } . . . . . . } @@ -128,10 +150,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 7 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 19 +. . . . . . Line: 2 +. . . . . . Col: 7 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 7 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . } @@ -144,9 +169,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 33 +. . . . Line: 3 +. . . . Col: 13 +. . . } . . . Properties: { -. . . . end_col_offset: 13 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -158,10 +186,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 9 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 29 +. . . . . . Line: 3 +. . . . . . Col: 9 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 9 -. . . . . . end_lineno: 3 . . . . . . internalRole: targets . . . . . } . . . . . Children: { @@ -173,10 +204,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 7 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 27 +. . . . . . . . Line: 3 +. . . . . . . . Col: 7 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: value . . . . . . . } . . . . . . . Children: { @@ -188,10 +222,13 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 25 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -203,10 +240,13 @@ Module { . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . Col: 3 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 23 +. . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . Col: 3 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 3 -. . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . internalRole: value . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -218,10 +258,13 @@ Module { . . . . . . . . . . . . . . Line: 3 . . . . . . . . . . . . . . Col: 1 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 21 +. . . . . . . . . . . . . . Line: 3 +. . . . . . . . . . . . . . Col: 1 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . . . end_col_offset: 1 -. . . . . . . . . . . . . . end_lineno: 3 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -241,10 +284,13 @@ Module { . . . . . . Line: 3 . . . . . . Col: 13 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 33 +. . . . . . Line: 3 +. . . . . . Col: 13 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 13 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . } diff --git a/tests/repr.py.uast b/tests/repr.py.uast index 50d19ef3..ac4e83e7 100644 --- a/tests/repr.py.uast +++ b/tests/repr.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 6 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 5 +. . Line: 1 +. . Col: 6 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 5 +. . . . Line: 1 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 5 +. . . . . . Line: 1 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,10 +54,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 6 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 5 +. . . . . . . . Line: 1 +. . . . . . . . Col: 6 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 6 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -62,10 +72,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 1 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } diff --git a/tests/sameline.py.uast b/tests/sameline.py.uast index 311c1a80..b5e5c662 100644 --- a/tests/sameline.py.uast +++ b/tests/sameline.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 45 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 44 +. . Line: 1 +. . Col: 45 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 21 +. . . . Line: 1 +. . . . Col: 22 +. . . } . . . Properties: { -. . . . end_col_offset: 22 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 2 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 21 +. . . . . . Line: 1 +. . . . . . Col: 22 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 22 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,9 +54,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 7 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 21 +. . . . . . . . Line: 1 +. . . . . . . . Col: 22 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 22 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -61,10 +71,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 4 +. . . . . . . . Line: 1 +. . . . . . . . Col: 5 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 5 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } @@ -79,9 +92,12 @@ Module { . . . . Line: 1 . . . . Col: 26 . . . } +. . . EndPosition: { +. . . . Offset: 44 +. . . . Line: 1 +. . . . Col: 45 +. . . } . . . Properties: { -. . . . end_col_offset: 45 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -92,9 +108,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 27 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 44 +. . . . . . Line: 1 +. . . . . . Col: 45 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 45 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -106,9 +125,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 32 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 44 +. . . . . . . . Line: 1 +. . . . . . . . Col: 45 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 45 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: args . . . . . . . } . . . . . . } @@ -120,10 +142,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 26 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 29 +. . . . . . . . Line: 1 +. . . . . . . . Col: 30 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 30 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: func . . . . . . . } . . . . . . } diff --git a/tests/sorting.py.native b/tests/sorting.py.native index f0e2f0d5..4c84129d 100644 --- a/tests/sorting.py.native +++ b/tests/sorting.py.native @@ -8,20 +8,20 @@ { "ast_type": "Expr", "col_offset": 1, - "end_col_offset": 3, + "end_col_offset": 26, "end_lineno": 2, "lineno": 2, "value": { "ast_type": "BinOp", "col_offset": 1, - "end_col_offset": 3, + "end_col_offset": 26, "end_lineno": 2, "left": { "LiteralValue": 1, "NumType": "int", "ast_type": "NumLiteral", "col_offset": 1, - "end_col_offset": 1, + "end_col_offset": 26, "end_lineno": 2, "lineno": 2, "noops_previous": { @@ -41,10 +41,9 @@ }, "noops_sameline": { "ast_type": "SameLineNoops", - "col_end": 26, "col_offset": 4, - "end_col_offset": 16, - "end_lineno": 1, + "end_col_offset": 26, + "end_lineno": 2, "lineno": 2, "noop_line": "# linetrailing comment" } @@ -70,8 +69,8 @@ } ], "col_offset": 1, - "end_col_offset": 3, - "end_lineno": 2, + "end_col_offset": 1, + "end_lineno": 3, "lineno": 1, "noops_remainder": { "ast_type": "RemainderNoops", diff --git a/tests/sorting.py.uast b/tests/sorting.py.uast index 7775eba3..0eaf7e1c 100644 --- a/tests/sorting.py.uast +++ b/tests/sorting.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 3 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 44 +. . Line: 3 +. . Col: 1 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 42 +. . . . Line: 2 +. . . . Col: 26 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 42 +. . . . . . Line: 2 +. . . . . . Col: 26 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,10 +54,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 42 +. . . . . . . . Line: 2 +. . . . . . . . Col: 26 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: left . . . . . . . } . . . . . . . Children: { @@ -61,9 +71,12 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 15 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 16 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 16 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -90,10 +103,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 4 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 42 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 26 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . col_end: 26 -. . . . . . . . . . end_col_offset: 16 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: noops_sameline . . . . . . . . . } . . . . . . . . } @@ -107,9 +122,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 18 +. . . . . . . . Line: 2 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -121,10 +139,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 19 +. . . . . . . . Line: 2 +. . . . . . . . Col: 3 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 3 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: right . . . . . . . } . . . . . . } @@ -139,9 +160,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 44 +. . . . Line: 3 +. . . . Col: 1 +. . . } . . . Properties: { -. . . . end_col_offset: 1 -. . . . end_lineno: 3 . . . . internalRole: noops_remainder . . . } . . . Children: { diff --git a/tests/string_fstring.py.native b/tests/string_fstring.py.native index 8bce6559..e0cdb230 100644 --- a/tests/string_fstring.py.native +++ b/tests/string_fstring.py.native @@ -582,8 +582,8 @@ } ], "col_offset": 1, - "end_col_offset": 54, - "end_lineno": 11, + "end_col_offset": 1, + "end_lineno": 12, "lineno": 1, "noops_remainder": { "ast_type": "RemainderNoops", diff --git a/tests/string_fstring.py.uast b/tests/string_fstring.py.uast index 1193e1cf..f2bb4bf9 100644 --- a/tests/string_fstring.py.uast +++ b/tests/string_fstring.py.uast @@ -1,6 +1,6 @@ Status: error Errors: - . column out of bounds: 11 [1, 7] + . column out of bounds: 0 [1, 1] UAST: Module { . Roles: File @@ -9,9 +9,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 54 -. . end_lineno: 11 +. EndPosition: { +. . Offset: 382 +. . Line: 12 +. . Col: 1 . } . Children: { . . 0: Assign { @@ -21,9 +22,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 5 +. . . . Line: 1 +. . . . Col: 6 +. . . } . . . Properties: { -. . . . end_col_offset: 6 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -35,10 +39,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 1 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 1 . . . . . . internalRole: targets . . . . . } . . . . } @@ -50,10 +57,13 @@ Module { . . . . . . Line: 1 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 5 +. . . . . . Line: 1 +. . . . . . Col: 6 +. . . . . } . . . . . Properties: { . . . . . . NumType: int -. . . . . . end_col_offset: 6 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . } @@ -66,9 +76,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 14 +. . . . Line: 2 +. . . . Col: 8 +. . . } . . . Properties: { -. . . . end_col_offset: 8 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -80,10 +93,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 7 +. . . . . . Line: 2 +. . . . . . Col: 1 +. . . . . } . . . . . Properties: { . . . . . . ctx: Store -. . . . . . end_col_offset: 1 -. . . . . . end_lineno: 2 . . . . . . internalRole: targets . . . . . } . . . . } @@ -95,10 +111,13 @@ Module { . . . . . . Line: 2 . . . . . . Col: 5 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 14 +. . . . . . Line: 2 +. . . . . . Col: 8 +. . . . . } . . . . . Properties: { . . . . . . NumType: float -. . . . . . end_col_offset: 8 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . } @@ -111,9 +130,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 67 +. . . . Line: 3 +. . . . Col: 52 +. . . } . . . Properties: { -. . . . end_col_offset: 52 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -124,9 +146,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 67 +. . . . . . Line: 3 +. . . . . . Col: 52 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 52 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -138,9 +163,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 67 +. . . . . . . . Line: 3 +. . . . . . . . Col: 52 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 52 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -151,10 +179,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 11 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 67 +. . . . . . . . Line: 3 +. . . . . . . . Col: 52 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: -1 -. . . . . . . . end_col_offset: 52 -. . . . . . . . end_lineno: 3 . . . . . . . . format_spec: . . . . . . . . internalRole: values . . . . . . . } @@ -167,10 +198,13 @@ Module { . . . . . . . . . . Line: 3 . . . . . . . . . . Col: 11 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 67 +. . . . . . . . . . Line: 3 +. . . . . . . . . . Col: 52 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 52 -. . . . . . . . . . end_lineno: 3 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -184,9 +218,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 33 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 67 +. . . . . . . . Line: 3 +. . . . . . . . Col: 52 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 52 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -201,9 +238,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 108 +. . . . Line: 4 +. . . . Col: 40 +. . . } . . . Properties: { -. . . . end_col_offset: 40 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -214,9 +254,12 @@ Module { . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 108 +. . . . . . Line: 4 +. . . . . . Col: 40 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 40 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -228,9 +271,12 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 108 +. . . . . . . . Line: 4 +. . . . . . . . Col: 40 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 40 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -241,10 +287,13 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 108 +. . . . . . . . Line: 4 +. . . . . . . . Col: 40 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: 115 -. . . . . . . . end_col_offset: 40 -. . . . . . . . end_lineno: 4 . . . . . . . . format_spec: . . . . . . . . internalRole: values . . . . . . . } @@ -257,10 +306,13 @@ Module { . . . . . . . . . . Line: 4 . . . . . . . . . . Col: 17 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 108 +. . . . . . . . . . Line: 4 +. . . . . . . . . . Col: 40 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 40 -. . . . . . . . . . end_lineno: 4 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -274,9 +326,12 @@ Module { . . . . . . . . Line: 4 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 108 +. . . . . . . . Line: 4 +. . . . . . . . Col: 40 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 40 -. . . . . . . . end_lineno: 4 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -291,9 +346,12 @@ Module { . . . . Line: 5 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 145 +. . . . Line: 5 +. . . . Col: 36 +. . . } . . . Properties: { -. . . . end_col_offset: 36 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -304,9 +362,12 @@ Module { . . . . . . Line: 5 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 145 +. . . . . . Line: 5 +. . . . . . Col: 36 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 36 -. . . . . . end_lineno: 5 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -318,9 +379,12 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 145 +. . . . . . . . Line: 5 +. . . . . . . . Col: 36 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 36 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -331,10 +395,13 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 145 +. . . . . . . . Line: 5 +. . . . . . . . Col: 36 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: 114 -. . . . . . . . end_col_offset: 36 -. . . . . . . . end_lineno: 5 . . . . . . . . format_spec: . . . . . . . . internalRole: values . . . . . . . } @@ -347,10 +414,13 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 17 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 145 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 36 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 36 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -364,9 +434,12 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 145 +. . . . . . . . Line: 5 +. . . . . . . . Col: 36 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 36 -. . . . . . . . end_lineno: 5 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -381,9 +454,12 @@ Module { . . . . Line: 6 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 183 +. . . . Line: 6 +. . . . Col: 37 +. . . } . . . Properties: { -. . . . end_col_offset: 37 -. . . . end_lineno: 6 . . . . internalRole: body . . . } . . . Children: { @@ -394,9 +470,12 @@ Module { . . . . . . Line: 6 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 183 +. . . . . . Line: 6 +. . . . . . Col: 37 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 37 -. . . . . . end_lineno: 6 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -408,9 +487,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 183 +. . . . . . . . Line: 6 +. . . . . . . . Col: 37 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 37 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -421,10 +503,13 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 183 +. . . . . . . . Line: 6 +. . . . . . . . Col: 37 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: 97 -. . . . . . . . end_col_offset: 37 -. . . . . . . . end_lineno: 6 . . . . . . . . format_spec: . . . . . . . . internalRole: values . . . . . . . } @@ -437,10 +522,13 @@ Module { . . . . . . . . . . Line: 6 . . . . . . . . . . Col: 17 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 183 +. . . . . . . . . . Line: 6 +. . . . . . . . . . Col: 37 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 37 -. . . . . . . . . . end_lineno: 6 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -454,9 +542,12 @@ Module { . . . . . . . . Line: 6 . . . . . . . . Col: 21 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 183 +. . . . . . . . Line: 6 +. . . . . . . . Col: 37 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 37 -. . . . . . . . end_lineno: 6 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -471,9 +562,12 @@ Module { . . . . Line: 7 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 248 +. . . . Line: 7 +. . . . Col: 64 +. . . } . . . Properties: { -. . . . end_col_offset: 64 -. . . . end_lineno: 7 . . . . internalRole: body . . . } . . . Children: { @@ -484,9 +578,12 @@ Module { . . . . . . Line: 7 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 248 +. . . . . . Line: 7 +. . . . . . Col: 64 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 64 -. . . . . . end_lineno: 7 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -498,9 +595,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 248 +. . . . . . . . Line: 7 +. . . . . . . . Col: 64 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 64 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -511,10 +611,13 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 248 +. . . . . . . . Line: 7 +. . . . . . . . Col: 64 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: -1 -. . . . . . . . end_col_offset: 64 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: values . . . . . . . } . . . . . . . Children: { @@ -525,9 +628,12 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 248 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 64 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: format_spec . . . . . . . . . } . . . . . . . . . Children: { @@ -538,10 +644,13 @@ Module { . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . Col: 20 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 248 +. . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . Col: 64 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . conversion: -1 -. . . . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . format_spec: . . . . . . . . . . . . internalRole: values . . . . . . . . . . . } @@ -554,10 +663,13 @@ Module { . . . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . . . Col: 20 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 248 +. . . . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . . . Col: 64 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -571,9 +683,12 @@ Module { . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . Col: 22 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 248 +. . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . Col: 64 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . internalRole: values . . . . . . . . . . . } . . . . . . . . . . } @@ -584,10 +699,13 @@ Module { . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . Col: 24 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 248 +. . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . Col: 64 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . conversion: -1 -. . . . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . format_spec: . . . . . . . . . . . . internalRole: values . . . . . . . . . . . } @@ -600,10 +718,13 @@ Module { . . . . . . . . . . . . . . Line: 7 . . . . . . . . . . . . . . Col: 24 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 248 +. . . . . . . . . . . . . . Line: 7 +. . . . . . . . . . . . . . Col: 64 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { . . . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . . . . . end_lineno: 7 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -619,10 +740,13 @@ Module { . . . . . . . . . . Line: 7 . . . . . . . . . . Col: 17 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 248 +. . . . . . . . . . Line: 7 +. . . . . . . . . . Col: 64 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 64 -. . . . . . . . . . end_lineno: 7 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -636,9 +760,12 @@ Module { . . . . . . . . Line: 7 . . . . . . . . Col: 27 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 248 +. . . . . . . . Line: 7 +. . . . . . . . Col: 64 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 64 -. . . . . . . . end_lineno: 7 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -654,9 +781,12 @@ Module { . . . . Line: 9 . . . . Col: 5 . . . } +. . . EndPosition: { +. . . . Offset: 277 +. . . . Line: 9 +. . . . Col: 27 +. . . } . . . Properties: { -. . . . end_col_offset: 27 -. . . . end_lineno: 9 . . . . internalRole: body . . . . returns: . . . } @@ -668,9 +798,12 @@ Module { . . . . . . Line: 9 . . . . . . Col: 15 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 264 +. . . . . . Line: 9 +. . . . . . Col: 14 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 14 -. . . . . . end_lineno: 9 . . . . . . internalRole: args . . . . . . kwarg: . . . . . . vararg: @@ -684,10 +817,13 @@ Module { . . . . . . . . Line: 9 . . . . . . . . Col: 14 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 264 +. . . . . . . . Line: 9 +. . . . . . . . Col: 14 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . annotation: -. . . . . . . . end_col_offset: 14 -. . . . . . . . end_lineno: 9 . . . . . . . . internalRole: args . . . . . . . } . . . . . . . Children: { @@ -698,9 +834,12 @@ Module { . . . . . . . . . . Line: 8 . . . . . . . . . . Col: 1 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 8 +. . . . . . . . . . Col: 0 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 0 -. . . . . . . . . . end_lineno: 8 . . . . . . . . . . internalRole: noops_previous . . . . . . . . . } . . . . . . . . . Children: { @@ -709,7 +848,7 @@ Module { . . . . . . . . . . . TOKEN " " . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 250 +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 8 . . . . . . . . . . . . Col: 1 . . . . . . . . . . . } @@ -732,25 +871,29 @@ Module { . . . . . . 0: Return { . . . . . . . Roles: Return . . . . . . . StartPosition: { -. . . . . . . . Offset: 268 +. . . . . . . . Offset: 0 . . . . . . . . Line: 9 . . . . . . . . Col: 18 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 27 -. . . . . . . . end_lineno: 9 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 9 +. . . . . . . . Col: 27 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: BinOp { . . . . . . . . . Roles: BinaryExpression . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 275 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 9 . . . . . . . . . . Col: 25 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 0 +. . . . . . . . . . Line: 9 +. . . . . . . . . . Col: 27 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 27 -. . . . . . . . . . end_lineno: 9 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -758,14 +901,17 @@ Module { . . . . . . . . . . . Roles: BinaryExpressionLeft,SimpleIdentifier . . . . . . . . . . . TOKEN "i" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 275 +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 9 +. . . . . . . . . . . . Col: 25 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 9 . . . . . . . . . . . . Col: 25 . . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 25 -. . . . . . . . . . . . end_lineno: 9 . . . . . . . . . . . . internalRole: left . . . . . . . . . . . } . . . . . . . . . . } @@ -773,13 +919,16 @@ Module { . . . . . . . . . . . Roles: BinaryExpressionOp,OpMultiply . . . . . . . . . . . TOKEN "*" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 276 +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 9 +. . . . . . . . . . . . Col: 26 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 9 . . . . . . . . . . . . Col: 26 . . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 26 -. . . . . . . . . . . . end_lineno: 9 . . . . . . . . . . . . internalRole: op . . . . . . . . . . . } . . . . . . . . . . } @@ -787,14 +936,17 @@ Module { . . . . . . . . . . . Roles: BinaryExpressionRight,NumberLiteral . . . . . . . . . . . TOKEN "2" . . . . . . . . . . . StartPosition: { -. . . . . . . . . . . . Offset: 277 +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 9 +. . . . . . . . . . . . Col: 27 +. . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 . . . . . . . . . . . . Line: 9 . . . . . . . . . . . . Col: 27 . . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . NumType: int -. . . . . . . . . . . . end_col_offset: 27 -. . . . . . . . . . . . end_lineno: 9 . . . . . . . . . . . . internalRole: right . . . . . . . . . . . } . . . . . . . . . . } @@ -809,26 +961,32 @@ Module { . . 8: Expr { . . . Roles: Expression . . . StartPosition: { -. . . . Offset: 279 +. . . . Offset: 0 . . . . Line: 10 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 10 +. . . . Col: 47 +. . . } . . . Properties: { -. . . . end_col_offset: 47 -. . . . end_lineno: 10 . . . . internalRole: body . . . } . . . Children: { . . . . 0: JoinedStr { . . . . . Roles: StringLiteral . . . . . StartPosition: { -. . . . . . Offset: 279 +. . . . . . Offset: 0 . . . . . . Line: 10 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 10 +. . . . . . Col: 47 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 47 -. . . . . . end_lineno: 10 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -836,27 +994,33 @@ Module { . . . . . . . Roles: StringLiteral . . . . . . . TOKEN "Another with " . . . . . . . StartPosition: { -. . . . . . . . Offset: 281 +. . . . . . . . Offset: 0 . . . . . . . . Line: 10 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 10 +. . . . . . . . Col: 47 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 47 -. . . . . . . . end_lineno: 10 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } . . . . . . 1: FormattedValue { . . . . . . . Roles: Expression . . . . . . . StartPosition: { -. . . . . . . . Offset: 295 +. . . . . . . . Offset: 0 . . . . . . . . Line: 10 . . . . . . . . Col: 17 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 10 +. . . . . . . . Col: 47 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: -1 -. . . . . . . . end_col_offset: 47 -. . . . . . . . end_lineno: 10 . . . . . . . . format_spec: . . . . . . . . internalRole: values . . . . . . . } @@ -864,7 +1028,7 @@ Module { . . . . . . . . 0: Call { . . . . . . . . . Roles: Call . . . . . . . . . StartPosition: { -. . . . . . . . . . Offset: 295 +. . . . . . . . . . Offset: 0 . . . . . . . . . . Line: 10 . . . . . . . . . . Col: 17 . . . . . . . . . } @@ -893,10 +1057,13 @@ Module { . . . . . . . . . . . . Line: 10 . . . . . . . . . . . . Col: 17 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 10 +. . . . . . . . . . . . Col: 47 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 47 -. . . . . . . . . . . . end_lineno: 10 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -912,9 +1079,12 @@ Module { . . . . . . . . Line: 10 . . . . . . . . Col: 30 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 10 +. . . . . . . . Col: 47 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 47 -. . . . . . . . end_lineno: 10 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -929,9 +1099,12 @@ Module { . . . . Line: 11 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 11 +. . . . Col: 54 +. . . } . . . Properties: { -. . . . end_col_offset: 54 -. . . . end_lineno: 11 . . . . internalRole: body . . . } . . . Children: { @@ -942,9 +1115,12 @@ Module { . . . . . . Line: 11 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 0 +. . . . . . Line: 11 +. . . . . . Col: 54 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 54 -. . . . . . end_lineno: 11 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -956,9 +1132,12 @@ Module { . . . . . . . . Line: 11 . . . . . . . . Col: 3 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 11 +. . . . . . . . Col: 54 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 54 -. . . . . . . . end_lineno: 11 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -969,10 +1148,13 @@ Module { . . . . . . . . Line: 11 . . . . . . . . Col: 23 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 11 +. . . . . . . . Col: 54 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . conversion: -1 -. . . . . . . . end_col_offset: 54 -. . . . . . . . end_lineno: 11 . . . . . . . . format_spec: . . . . . . . . internalRole: values . . . . . . . } @@ -996,10 +1178,13 @@ Module { . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . Col: 23 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . Col: 54 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 54 -. . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . . Children: { @@ -1011,9 +1196,12 @@ Module { . . . . . . . . . . . . . . Line: 11 . . . . . . . . . . . . . . Col: 18 . . . . . . . . . . . . . } +. . . . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . . . Offset: 0 +. . . . . . . . . . . . . . Line: 11 +. . . . . . . . . . . . . . Col: 54 +. . . . . . . . . . . . . } . . . . . . . . . . . . . Properties: { -. . . . . . . . . . . . . . end_col_offset: 54 -. . . . . . . . . . . . . . end_lineno: 11 . . . . . . . . . . . . . . internalRole: value . . . . . . . . . . . . . } . . . . . . . . . . . . } @@ -1031,9 +1219,12 @@ Module { . . . . . . . . Line: 11 . . . . . . . . Col: 31 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 11 +. . . . . . . . Col: 54 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 54 -. . . . . . . . end_lineno: 11 . . . . . . . . internalRole: values . . . . . . . } . . . . . . } @@ -1048,9 +1239,12 @@ Module { . . . . Line: 12 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 0 +. . . . Line: 12 +. . . . Col: 1 +. . . } . . . Properties: { -. . . . end_col_offset: 1 -. . . . end_lineno: 12 . . . . internalRole: noops_remainder . . . } . . . Children: { diff --git a/tests/string_normal.py.uast b/tests/string_normal.py.uast index 96005138..f6171e68 100644 --- a/tests/string_normal.py.uast +++ b/tests/string_normal.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 29 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 58 +. . Line: 2 +. . Col: 29 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 28 +. . . . Line: 1 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 29 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -34,9 +38,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 28 +. . . . . . Line: 1 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 29 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . } @@ -49,9 +56,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 58 +. . . . Line: 2 +. . . . Col: 29 +. . . } . . . Properties: { -. . . . end_col_offset: 29 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -63,9 +73,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 58 +. . . . . . Line: 2 +. . . . . . Col: 29 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 29 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . } diff --git a/tests/string_triple.py.uast b/tests/string_triple.py.uast index b8ee2b1b..f7be4d40 100644 --- a/tests/string_triple.py.uast +++ b/tests/string_triple.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 3 -. . end_lineno: 8 +. EndPosition: { +. . Offset: 94 +. . Line: 8 +. . Col: 3 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 4 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 46 +. . . . Line: 4 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 4 . . . . internalRole: body . . . } . . . Children: { @@ -37,9 +41,12 @@ Second line . . . . . . Line: 4 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 46 +. . . . . . Line: 4 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 4 . . . . . . internalRole: value . . . . . } . . . . } @@ -52,9 +59,12 @@ Second line . . . . Line: 8 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 94 +. . . . Line: 8 +. . . . Col: 3 +. . . } . . . Properties: { -. . . . end_col_offset: 3 -. . . . end_lineno: 8 . . . . internalRole: body . . . } . . . Children: { @@ -69,9 +79,12 @@ Second line . . . . . . Line: 8 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 94 +. . . . . . Line: 8 +. . . . . . Col: 3 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 3 -. . . . . . end_lineno: 8 . . . . . . internalRole: value . . . . . } . . . . } diff --git a/tests/test.py.native b/tests/test.py.native index 717f7c72..774fb9c5 100644 --- a/tests/test.py.native +++ b/tests/test.py.native @@ -11,8 +11,6 @@ { "ast_type": "Pass", "col_offset": 5, - "end_col_offset": 8, - "end_lineno": 1, "lineno": 2 } ], diff --git a/tests/test.py.uast b/tests/test.py.uast index 30798ab9..6fd80718 100644 --- a/tests/test.py.uast +++ b/tests/test.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 8 -. . end_lineno: 1 +. EndPosition: { +. . Offset: 7 +. . Line: 1 +. . Col: 8 . } . Children: { . . 0: If { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 7 +. . . . Line: 1 +. . . . Col: 8 +. . . } . . . Properties: { -. . . . end_col_offset: 8 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -39,10 +43,6 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 8 -. . . . . . . . end_lineno: 1 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -53,9 +53,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 4 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 7 +. . . . . . Line: 1 +. . . . . . Col: 8 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 8 -. . . . . . end_lineno: 1 . . . . . . internalRole: test . . . . . } . . . . . Children: { @@ -73,10 +76,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 8 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 7 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 8 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 8 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -89,10 +95,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 4 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 1 +. . . . . . . . Col: 4 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 4 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -110,9 +119,10 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 6 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 6 -. . . . . . . . . . end_lineno: 1 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 5 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 6 . . . . . . . . . } . . . . . . . . } . . . . . . . } diff --git a/tests/unary.py.uast b/tests/unary.py.uast index d452c6c1..a3d11863 100644 --- a/tests/unary.py.uast +++ b/tests/unary.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 2 -. . end_lineno: 3 +. EndPosition: { +. . Offset: 7 +. . Line: 3 +. . Col: 2 . } . Children: { . . 0: Expr { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 1 +. . . . Line: 1 +. . . . Col: 2 +. . . } . . . Properties: { -. . . . end_col_offset: 2 -. . . . end_lineno: 1 . . . . internalRole: body . . . } . . . Children: { @@ -33,9 +37,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 1 +. . . . . . Line: 1 +. . . . . . Col: 2 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 2 -. . . . . . end_lineno: 1 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -47,9 +54,12 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 0 +. . . . . . . . Line: 1 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -61,10 +71,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 1 +. . . . . . . . Line: 1 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: operand . . . . . . . } . . . . . . } @@ -79,9 +92,12 @@ Module { . . . . Line: 2 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 4 +. . . . Line: 2 +. . . . Col: 2 +. . . } . . . Properties: { -. . . . end_col_offset: 2 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -92,9 +108,12 @@ Module { . . . . . . Line: 2 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 4 +. . . . . . Line: 2 +. . . . . . Col: 2 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 2 -. . . . . . end_lineno: 2 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -106,9 +125,12 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 3 +. . . . . . . . Line: 2 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -120,10 +142,13 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 4 +. . . . . . . . Line: 2 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 2 . . . . . . . . internalRole: operand . . . . . . . } . . . . . . } @@ -138,9 +163,12 @@ Module { . . . . Line: 3 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 7 +. . . . Line: 3 +. . . . Col: 2 +. . . } . . . Properties: { -. . . . end_col_offset: 2 -. . . . end_lineno: 3 . . . . internalRole: body . . . } . . . Children: { @@ -151,9 +179,12 @@ Module { . . . . . . Line: 3 . . . . . . Col: 1 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 7 +. . . . . . Line: 3 +. . . . . . Col: 2 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 2 -. . . . . . end_lineno: 3 . . . . . . internalRole: value . . . . . } . . . . . Children: { @@ -165,9 +196,12 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 1 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 6 +. . . . . . . . Line: 3 +. . . . . . . . Col: 1 +. . . . . . . } . . . . . . . Properties: { -. . . . . . . . end_col_offset: 1 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: op . . . . . . . } . . . . . . } @@ -179,10 +213,13 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 2 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 7 +. . . . . . . . Line: 3 +. . . . . . . . Col: 2 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . ctx: Load -. . . . . . . . end_col_offset: 2 -. . . . . . . . end_lineno: 3 . . . . . . . . internalRole: operand . . . . . . . } . . . . . . } diff --git a/tests/while.py.native b/tests/while.py.native index c2dc518c..ed09d3ba 100644 --- a/tests/while.py.native +++ b/tests/while.py.native @@ -45,8 +45,6 @@ { "ast_type": "Break", "col_offset": 5, - "end_col_offset": 23, - "end_lineno": 2, "lineno": 3 } ], diff --git a/tests/while.py.uast b/tests/while.py.uast index 41f62d6c..592ab601 100644 --- a/tests/while.py.uast +++ b/tests/while.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 24 -. . end_lineno: 5 +. EndPosition: { +. . Offset: 77 +. . Line: 5 +. . Col: 24 . } . Children: { . . 0: While { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 77 +. . . . Line: 5 +. . . . Col: 24 +. . . } . . . Properties: { -. . . . end_col_offset: 24 -. . . . end_lineno: 5 . . . . internalRole: body . . . } . . . Children: { @@ -39,9 +43,10 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 2 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 35 +. . . . . . . . Line: 2 +. . . . . . . . Col: 23 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -51,9 +56,12 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 35 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 23 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 23 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -65,9 +73,12 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 35 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 23 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 23 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -79,10 +90,13 @@ Module { . . . . . . . . . . . . Line: 2 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 21 +. . . . . . . . . . . . Line: 2 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 2 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -97,10 +111,6 @@ Module { . . . . . . . . Line: 3 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 23 -. . . . . . . . end_lineno: 2 -. . . . . . . } . . . . . . } . . . . . } . . . . } @@ -117,9 +127,10 @@ Module { . . . . . . . . Line: 5 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 24 -. . . . . . . . end_lineno: 5 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 77 +. . . . . . . . Line: 5 +. . . . . . . . Col: 24 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Call { @@ -129,9 +140,12 @@ Module { . . . . . . . . . . Line: 5 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 77 +. . . . . . . . . . Line: 5 +. . . . . . . . . . Col: 24 +. . . . . . . . . } . . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 24 -. . . . . . . . . . end_lineno: 5 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . . Children: { @@ -143,9 +157,12 @@ Module { . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . Col: 11 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 77 +. . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . Col: 24 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { -. . . . . . . . . . . . end_col_offset: 24 -. . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . internalRole: args . . . . . . . . . . . } . . . . . . . . . . } @@ -157,10 +174,13 @@ Module { . . . . . . . . . . . . Line: 5 . . . . . . . . . . . . Col: 5 . . . . . . . . . . . } +. . . . . . . . . . . EndPosition: { +. . . . . . . . . . . . Offset: 62 +. . . . . . . . . . . . Line: 5 +. . . . . . . . . . . . Col: 9 +. . . . . . . . . . . } . . . . . . . . . . . Properties: { . . . . . . . . . . . . ctx: Load -. . . . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . . . end_lineno: 5 . . . . . . . . . . . . internalRole: func . . . . . . . . . . . } . . . . . . . . . . } @@ -177,9 +197,12 @@ Module { . . . . . . Line: 1 . . . . . . Col: 7 . . . . . } +. . . . . EndPosition: { +. . . . . . Offset: 10 +. . . . . . Line: 1 +. . . . . . Col: 11 +. . . . . } . . . . . Properties: { -. . . . . . end_col_offset: 11 -. . . . . . end_lineno: 1 . . . . . . internalRole: test . . . . . } . . . . . Children: { @@ -196,10 +219,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 11 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 10 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 11 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . NumType: int -. . . . . . . . . . end_col_offset: 11 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . } . . . . . . . . } . . . . . . . } @@ -212,10 +238,13 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 7 . . . . . . . } +. . . . . . . EndPosition: { +. . . . . . . . Offset: 6 +. . . . . . . . Line: 1 +. . . . . . . . Col: 7 +. . . . . . . } . . . . . . . Properties: { . . . . . . . . NumType: int -. . . . . . . . end_col_offset: 7 -. . . . . . . . end_lineno: 1 . . . . . . . . internalRole: left . . . . . . . } . . . . . . } @@ -232,9 +261,10 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 9 . . . . . . . . . } -. . . . . . . . . Properties: { -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 1 +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 8 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 9 . . . . . . . . . } . . . . . . . . } . . . . . . . } diff --git a/tests/with.py.uast b/tests/with.py.uast index 5de9c444..e9939515 100644 --- a/tests/with.py.uast +++ b/tests/with.py.uast @@ -8,9 +8,10 @@ Module { . . Line: 1 . . Col: 1 . } -. Properties: { -. . end_col_offset: 9 -. . end_lineno: 2 +. EndPosition: { +. . Offset: 29 +. . Line: 2 +. . Col: 9 . } . Children: { . . 0: With { @@ -20,9 +21,12 @@ Module { . . . . Line: 1 . . . . Col: 1 . . . } +. . . EndPosition: { +. . . . Offset: 29 +. . . . Line: 2 +. . . . Col: 9 +. . . } . . . Properties: { -. . . . end_col_offset: 9 -. . . . end_lineno: 2 . . . . internalRole: body . . . } . . . Children: { @@ -38,9 +42,10 @@ Module { . . . . . . . . Line: 2 . . . . . . . . Col: 5 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 9 -. . . . . . . . end_lineno: 2 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 29 +. . . . . . . . Line: 2 +. . . . . . . . Col: 9 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { @@ -51,10 +56,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 5 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 25 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 5 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 5 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: targets . . . . . . . . . } . . . . . . . . } @@ -66,10 +74,13 @@ Module { . . . . . . . . . . Line: 2 . . . . . . . . . . Col: 9 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 29 +. . . . . . . . . . Line: 2 +. . . . . . . . . . Col: 9 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 9 -. . . . . . . . . . end_lineno: 2 . . . . . . . . . . internalRole: value . . . . . . . . . } . . . . . . . . } @@ -88,9 +99,10 @@ Module { . . . . . . . . Line: 1 . . . . . . . . Col: 1 . . . . . . . } -. . . . . . . Properties: { -. . . . . . . . end_col_offset: 19 -. . . . . . . . end_lineno: 1 +. . . . . . . EndPosition: { +. . . . . . . . Offset: 18 +. . . . . . . . Line: 1 +. . . . . . . . Col: 19 . . . . . . . } . . . . . . . Children: { . . . . . . . . 0: Name { @@ -101,10 +113,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 6 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 13 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 14 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Load -. . . . . . . . . . end_col_offset: 14 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: context_expr . . . . . . . . . } . . . . . . . . } @@ -116,10 +131,13 @@ Module { . . . . . . . . . . Line: 1 . . . . . . . . . . Col: 19 . . . . . . . . . } +. . . . . . . . . EndPosition: { +. . . . . . . . . . Offset: 18 +. . . . . . . . . . Line: 1 +. . . . . . . . . . Col: 19 +. . . . . . . . . } . . . . . . . . . Properties: { . . . . . . . . . . ctx: Store -. . . . . . . . . . end_col_offset: 19 -. . . . . . . . . . end_lineno: 1 . . . . . . . . . . internalRole: optional_vars . . . . . . . . . } . . . . . . . . }