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

Commit e744ab7

Browse files
Denys Smirnovdennwc
authored andcommitted
serialize positions for all ast nodes; fix #71
Signed-off-by: Denys Smirnov <denys@sourced.tech>
1 parent 18f056d commit e744ab7

189 files changed

Lines changed: 11334 additions & 890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fixtures/annotation_type_member_declaration.java.native

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
"errors": [],
55
"ast": {
66
"CompilationUnit": {
7+
"endColumn": 0,
8+
"endPosition": 37,
79
"internalClass": "CompilationUnit",
10+
"startColumn": 1,
11+
"startLine": 1,
12+
"startPosition": 0,
813
"types": [
914
{
1015
"bodyDeclarations": [
@@ -19,6 +24,9 @@
1924
"startPosition": 33,
2025
"token": "0"
2126
},
27+
"endColumn": 21,
28+
"endLine": 2,
29+
"endPosition": 35,
2230
"internalClass": "AnnotationTypeMemberDeclaration",
2331
"name": {
2432
"endColumn": 8,
@@ -30,6 +38,9 @@
3038
"startLine": 2,
3139
"startPosition": 21
3240
},
41+
"startColumn": 3,
42+
"startLine": 2,
43+
"startPosition": 17,
3344
"type": {
3445
"endColumn": 6,
3546
"endLine": 2,
@@ -42,6 +53,8 @@
4253
}
4354
}
4455
],
56+
"endColumn": 0,
57+
"endPosition": 37,
4558
"internalClass": "AnnotationTypeDeclaration",
4659
"name": {
4760
"endColumn": 13,
@@ -52,7 +65,10 @@
5265
"startColumn": 12,
5366
"startLine": 1,
5467
"startPosition": 11
55-
}
68+
},
69+
"startColumn": 1,
70+
"startLine": 1,
71+
"startPosition": 0
5672
}
5773
]
5874
}

fixtures/annotation_type_member_declaration.java.uast

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,29 @@ Errors:
44
UAST:
55
CompilationUnit {
66
. Roles: File
7+
. StartPosition: {
8+
. . Offset: 0
9+
. . Line: 1
10+
. . Col: 1
11+
. }
12+
. EndPosition: {
13+
. . Offset: 37
14+
. . Line: 0
15+
. . Col: 0
16+
. }
717
. Children: {
818
. . 0: AnnotationTypeDeclaration {
919
. . . Roles: Declaration,Type,Annotation
20+
. . . StartPosition: {
21+
. . . . Offset: 0
22+
. . . . Line: 1
23+
. . . . Col: 1
24+
. . . }
25+
. . . EndPosition: {
26+
. . . . Offset: 37
27+
. . . . Line: 0
28+
. . . . Col: 0
29+
. . . }
1030
. . . Properties: {
1131
. . . . internalRole: types
1232
. . . }
@@ -30,6 +50,16 @@ CompilationUnit {
3050
. . . . }
3151
. . . . 1: AnnotationTypeMemberDeclaration {
3252
. . . . . Roles: Body,Declaration,Type,Annotation
53+
. . . . . StartPosition: {
54+
. . . . . . Offset: 17
55+
. . . . . . Line: 2
56+
. . . . . . Col: 3
57+
. . . . . }
58+
. . . . . EndPosition: {
59+
. . . . . . Offset: 35
60+
. . . . . . Line: 2
61+
. . . . . . Col: 21
62+
. . . . . }
3363
. . . . . Properties: {
3464
. . . . . . internalRole: bodyDeclarations
3565
. . . . . }

fixtures/anonymous_class_declaration.java.native

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,41 @@
44
"errors": [],
55
"ast": {
66
"CompilationUnit": {
7+
"endColumn": 0,
8+
"endPosition": 86,
79
"internalClass": "CompilationUnit",
10+
"startColumn": 1,
11+
"startLine": 1,
12+
"startPosition": 0,
813
"types": [
914
{
1015
"bodyDeclarations": [
1116
{
1217
"body": {
18+
"endColumn": 47,
19+
"endLine": 3,
20+
"endPosition": 83,
1321
"internalClass": "Block",
22+
"startColumn": 19,
23+
"startLine": 2,
24+
"startPosition": 35,
1425
"statements": [
1526
{
27+
"endColumn": 45,
28+
"endLine": 3,
29+
"endPosition": 81,
1630
"expression": {
1731
"anonymousClassDeclaration": {
1832
"bodyDeclarations": [
1933
{
2034
"body": {
21-
"internalClass": "Block"
35+
"endColumn": 42,
36+
"endLine": 3,
37+
"endPosition": 78,
38+
"internalClass": "Block",
39+
"startColumn": 40,
40+
"startLine": 3,
41+
"startPosition": 76
2242
},
2343
"constructor": "false",
2444
"endColumn": 42,
@@ -50,10 +70,25 @@
5070
"startPosition": 60
5171
}
5272
],
53-
"internalClass": "AnonymousClassDeclaration"
73+
"endColumn": 44,
74+
"endLine": 3,
75+
"endPosition": 80,
76+
"internalClass": "AnonymousClassDeclaration",
77+
"startColumn": 22,
78+
"startLine": 3,
79+
"startPosition": 58
5480
},
81+
"endColumn": 44,
82+
"endLine": 3,
83+
"endPosition": 80,
5584
"internalClass": "ClassInstanceCreation",
85+
"startColumn": 5,
86+
"startLine": 3,
87+
"startPosition": 41,
5688
"type": {
89+
"endColumn": 19,
90+
"endLine": 3,
91+
"endPosition": 55,
5792
"internalClass": "SimpleType",
5893
"name": {
5994
"endColumn": 19,
@@ -64,10 +99,16 @@
6499
"startColumn": 9,
65100
"startLine": 3,
66101
"startPosition": 45
67-
}
102+
},
103+
"startColumn": 9,
104+
"startLine": 3,
105+
"startPosition": 45
68106
}
69107
},
70-
"internalClass": "ExpressionStatement"
108+
"internalClass": "ExpressionStatement",
109+
"startColumn": 5,
110+
"startLine": 3,
111+
"startPosition": 41
71112
}
72113
]
73114
},

fixtures/anonymous_class_declaration.java.uast

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ Errors:
44
UAST:
55
CompilationUnit {
66
. Roles: File
7+
. StartPosition: {
8+
. . Offset: 0
9+
. . Line: 1
10+
. . Col: 1
11+
. }
12+
. EndPosition: {
13+
. . Offset: 86
14+
. . Line: 0
15+
. . Col: 0
16+
. }
717
. Children: {
818
. . 0: TypeDeclaration {
919
. . . Roles: Visibility,Package,Declaration,Type
@@ -92,24 +102,64 @@ CompilationUnit {
92102
. . . . . . }
93103
. . . . . . 2: Block {
94104
. . . . . . . Roles: Function,Body,Statement,Block,Scope
105+
. . . . . . . StartPosition: {
106+
. . . . . . . . Offset: 35
107+
. . . . . . . . Line: 2
108+
. . . . . . . . Col: 19
109+
. . . . . . . }
110+
. . . . . . . EndPosition: {
111+
. . . . . . . . Offset: 83
112+
. . . . . . . . Line: 3
113+
. . . . . . . . Col: 47
114+
. . . . . . . }
95115
. . . . . . . Properties: {
96116
. . . . . . . . internalRole: body
97117
. . . . . . . }
98118
. . . . . . . Children: {
99119
. . . . . . . . 0: ExpressionStatement {
100120
. . . . . . . . . Roles: Statement
121+
. . . . . . . . . StartPosition: {
122+
. . . . . . . . . . Offset: 41
123+
. . . . . . . . . . Line: 3
124+
. . . . . . . . . . Col: 5
125+
. . . . . . . . . }
126+
. . . . . . . . . EndPosition: {
127+
. . . . . . . . . . Offset: 81
128+
. . . . . . . . . . Line: 3
129+
. . . . . . . . . . Col: 45
130+
. . . . . . . . . }
101131
. . . . . . . . . Properties: {
102132
. . . . . . . . . . internalRole: statements
103133
. . . . . . . . . }
104134
. . . . . . . . . Children: {
105135
. . . . . . . . . . 0: ClassInstanceCreation {
106136
. . . . . . . . . . . Roles: Expression,Call,Instance
137+
. . . . . . . . . . . StartPosition: {
138+
. . . . . . . . . . . . Offset: 41
139+
. . . . . . . . . . . . Line: 3
140+
. . . . . . . . . . . . Col: 5
141+
. . . . . . . . . . . }
142+
. . . . . . . . . . . EndPosition: {
143+
. . . . . . . . . . . . Offset: 80
144+
. . . . . . . . . . . . Line: 3
145+
. . . . . . . . . . . . Col: 44
146+
. . . . . . . . . . . }
107147
. . . . . . . . . . . Properties: {
108148
. . . . . . . . . . . . internalRole: expression
109149
. . . . . . . . . . . }
110150
. . . . . . . . . . . Children: {
111151
. . . . . . . . . . . . 0: SimpleType {
112152
. . . . . . . . . . . . . Roles: Call,Callee,Type
153+
. . . . . . . . . . . . . StartPosition: {
154+
. . . . . . . . . . . . . . Offset: 45
155+
. . . . . . . . . . . . . . Line: 3
156+
. . . . . . . . . . . . . . Col: 9
157+
. . . . . . . . . . . . . }
158+
. . . . . . . . . . . . . EndPosition: {
159+
. . . . . . . . . . . . . . Offset: 55
160+
. . . . . . . . . . . . . . Line: 3
161+
. . . . . . . . . . . . . . Col: 19
162+
. . . . . . . . . . . . . }
113163
. . . . . . . . . . . . . Properties: {
114164
. . . . . . . . . . . . . . internalRole: type
115165
. . . . . . . . . . . . . }
@@ -135,6 +185,16 @@ CompilationUnit {
135185
. . . . . . . . . . . . }
136186
. . . . . . . . . . . . 1: AnonymousClassDeclaration {
137187
. . . . . . . . . . . . . Roles: Expression,Declaration,Type,Anonymous
188+
. . . . . . . . . . . . . StartPosition: {
189+
. . . . . . . . . . . . . . Offset: 58
190+
. . . . . . . . . . . . . . Line: 3
191+
. . . . . . . . . . . . . . Col: 22
192+
. . . . . . . . . . . . . }
193+
. . . . . . . . . . . . . EndPosition: {
194+
. . . . . . . . . . . . . . Offset: 80
195+
. . . . . . . . . . . . . . Line: 3
196+
. . . . . . . . . . . . . . Col: 44
197+
. . . . . . . . . . . . . }
138198
. . . . . . . . . . . . . Properties: {
139199
. . . . . . . . . . . . . . internalRole: anonymousClassDeclaration
140200
. . . . . . . . . . . . . }
@@ -156,13 +216,7 @@ CompilationUnit {
156216
. . . . . . . . . . . . . . . . internalRole: bodyDeclarations
157217
. . . . . . . . . . . . . . . }
158218
. . . . . . . . . . . . . . . Children: {
159-
. . . . . . . . . . . . . . . . 0: Block {
160-
. . . . . . . . . . . . . . . . . Roles: Function,Body,Statement,Block,Scope
161-
. . . . . . . . . . . . . . . . . Properties: {
162-
. . . . . . . . . . . . . . . . . . internalRole: body
163-
. . . . . . . . . . . . . . . . . }
164-
. . . . . . . . . . . . . . . . }
165-
. . . . . . . . . . . . . . . . 1: PrimitiveType {
219+
. . . . . . . . . . . . . . . . 0: PrimitiveType {
166220
. . . . . . . . . . . . . . . . . Roles: Type,Primitive
167221
. . . . . . . . . . . . . . . . . TOKEN "void"
168222
. . . . . . . . . . . . . . . . . StartPosition: {
@@ -179,7 +233,7 @@ CompilationUnit {
179233
. . . . . . . . . . . . . . . . . . internalRole: returnType2
180234
. . . . . . . . . . . . . . . . . }
181235
. . . . . . . . . . . . . . . . }
182-
. . . . . . . . . . . . . . . . 2: SimpleName {
236+
. . . . . . . . . . . . . . . . 1: SimpleName {
183237
. . . . . . . . . . . . . . . . . Roles: Expression,Identifier,Function,Name
184238
. . . . . . . . . . . . . . . . . TOKEN "testfnc2"
185239
. . . . . . . . . . . . . . . . . StartPosition: {
@@ -196,6 +250,22 @@ CompilationUnit {
196250
. . . . . . . . . . . . . . . . . . internalRole: name
197251
. . . . . . . . . . . . . . . . . }
198252
. . . . . . . . . . . . . . . . }
253+
. . . . . . . . . . . . . . . . 2: Block {
254+
. . . . . . . . . . . . . . . . . Roles: Function,Body,Statement,Block,Scope
255+
. . . . . . . . . . . . . . . . . StartPosition: {
256+
. . . . . . . . . . . . . . . . . . Offset: 76
257+
. . . . . . . . . . . . . . . . . . Line: 3
258+
. . . . . . . . . . . . . . . . . . Col: 40
259+
. . . . . . . . . . . . . . . . . }
260+
. . . . . . . . . . . . . . . . . EndPosition: {
261+
. . . . . . . . . . . . . . . . . . Offset: 78
262+
. . . . . . . . . . . . . . . . . . Line: 3
263+
. . . . . . . . . . . . . . . . . . Col: 42
264+
. . . . . . . . . . . . . . . . . }
265+
. . . . . . . . . . . . . . . . . Properties: {
266+
. . . . . . . . . . . . . . . . . . internalRole: body
267+
. . . . . . . . . . . . . . . . . }
268+
. . . . . . . . . . . . . . . . }
199269
. . . . . . . . . . . . . . . }
200270
. . . . . . . . . . . . . . }
201271
. . . . . . . . . . . . . }

0 commit comments

Comments
 (0)