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

Commit df43b92

Browse files
committed
annotations: Add an integration test for QuailifierIdentifier
1 parent b3b7a15 commit df43b92

3 files changed

Lines changed: 259 additions & 0 deletions

File tree

tests/qualified_identifier.native

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"status": "ok",
3+
"errors": [],
4+
"ast": {
5+
"CompilationUnit": {
6+
"internalClass": "CompilationUnit",
7+
"types": [
8+
{
9+
"bodyDeclarations": [
10+
{
11+
"body": {
12+
"internalClass": "Block",
13+
"statements": [
14+
{
15+
"fragments": [
16+
{
17+
"internalClass": "VariableDeclarationFragment",
18+
"name": {
19+
"identifier": "cons",
20+
"internalClass": "SimpleName",
21+
"line": 3,
22+
"startPosition": 49
23+
}
24+
}
25+
],
26+
"internalClass": "VariableDeclarationStatement",
27+
"type": {
28+
"internalClass": "SimpleType",
29+
"name": {
30+
"internalClass": "QualifiedName",
31+
"name": {
32+
"identifier": "Console",
33+
"internalClass": "SimpleName",
34+
"line": 3,
35+
"startPosition": 41
36+
},
37+
"qualifier": {
38+
"internalClass": "QualifiedName",
39+
"name": {
40+
"identifier": "io",
41+
"internalClass": "SimpleName",
42+
"line": 3,
43+
"startPosition": 38
44+
},
45+
"qualifier": {
46+
"identifier": "Java",
47+
"internalClass": "SimpleName",
48+
"line": 3,
49+
"startPosition": 33
50+
}
51+
}
52+
}
53+
}
54+
}
55+
]
56+
},
57+
"constructor": "false",
58+
"internalClass": "MethodDeclaration",
59+
"line": 2,
60+
"name": {
61+
"identifier": "code",
62+
"internalClass": "SimpleName",
63+
"line": 2,
64+
"startPosition": 20
65+
},
66+
"returnType2": {
67+
"internalClass": "PrimitiveType",
68+
"line": 2,
69+
"primitiveTypeCode": "void",
70+
"startPosition": 15
71+
},
72+
"startPosition": 15
73+
}
74+
],
75+
"interface": "false",
76+
"internalClass": "TypeDeclaration",
77+
"line": 1,
78+
"name": {
79+
"identifier": "Code",
80+
"internalClass": "SimpleName",
81+
"line": 1,
82+
"startPosition": 6
83+
},
84+
"startPosition": 0
85+
}
86+
]
87+
}
88+
}
89+
}

tests/qualified_identifier.source

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Code {
2+
void code() {
3+
Java.io.Console cons;
4+
}
5+
}

tests/qualified_identifier.uast

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
Status: ok
2+
Errors:
3+
UAST:
4+
CompilationUnit {
5+
. Roles: File
6+
. Children: {
7+
. . 0: TypeDeclaration {
8+
. . . Roles: VisibleFromPackage,TypeDeclaration
9+
. . . StartPosition: {
10+
. . . . Offset: 0
11+
. . . . Line: 1
12+
. . . . Col: 0
13+
. . . }
14+
. . . Properties: {
15+
. . . . interface: false
16+
. . . . internalRole: types
17+
. . . }
18+
. . . Children: {
19+
. . . . 0: SimpleName {
20+
. . . . . Roles: SimpleIdentifier
21+
. . . . . TOKEN "Code"
22+
. . . . . StartPosition: {
23+
. . . . . . Offset: 6
24+
. . . . . . Line: 1
25+
. . . . . . Col: 0
26+
. . . . . }
27+
. . . . . Properties: {
28+
. . . . . . internalRole: name
29+
. . . . . }
30+
. . . . }
31+
. . . . 1: MethodDeclaration {
32+
. . . . . Roles: VisibleFromPackage,FunctionDeclaration
33+
. . . . . StartPosition: {
34+
. . . . . . Offset: 15
35+
. . . . . . Line: 2
36+
. . . . . . Col: 0
37+
. . . . . }
38+
. . . . . Properties: {
39+
. . . . . . constructor: false
40+
. . . . . . internalRole: bodyDeclarations
41+
. . . . . }
42+
. . . . . Children: {
43+
. . . . . . 0: PrimitiveType {
44+
. . . . . . . TOKEN "void"
45+
. . . . . . . StartPosition: {
46+
. . . . . . . . Offset: 15
47+
. . . . . . . . Line: 2
48+
. . . . . . . . Col: 0
49+
. . . . . . . }
50+
. . . . . . . Properties: {
51+
. . . . . . . . internalRole: returnType2
52+
. . . . . . . }
53+
. . . . . . }
54+
. . . . . . 1: SimpleName {
55+
. . . . . . . Roles: SimpleIdentifier,FunctionDeclarationName
56+
. . . . . . . TOKEN "code"
57+
. . . . . . . StartPosition: {
58+
. . . . . . . . Offset: 20
59+
. . . . . . . . Line: 2
60+
. . . . . . . . Col: 0
61+
. . . . . . . }
62+
. . . . . . . Properties: {
63+
. . . . . . . . internalRole: name
64+
. . . . . . . }
65+
. . . . . . }
66+
. . . . . . 2: Block {
67+
. . . . . . . Roles: FunctionDeclarationBody,BlockScope,Block
68+
. . . . . . . Properties: {
69+
. . . . . . . . internalRole: body
70+
. . . . . . . }
71+
. . . . . . . Children: {
72+
. . . . . . . . 0: VariableDeclarationStatement {
73+
. . . . . . . . . Properties: {
74+
. . . . . . . . . . internalRole: statements
75+
. . . . . . . . . }
76+
. . . . . . . . . Children: {
77+
. . . . . . . . . . 0: SimpleType {
78+
. . . . . . . . . . . Properties: {
79+
. . . . . . . . . . . . internalRole: type
80+
. . . . . . . . . . . }
81+
. . . . . . . . . . . Children: {
82+
. . . . . . . . . . . . 0: QualifiedName {
83+
. . . . . . . . . . . . . Roles: QualifiedIdentifier
84+
. . . . . . . . . . . . . Properties: {
85+
. . . . . . . . . . . . . . internalRole: name
86+
. . . . . . . . . . . . . }
87+
. . . . . . . . . . . . . Children: {
88+
. . . . . . . . . . . . . . 0: QualifiedName {
89+
. . . . . . . . . . . . . . . Roles: QualifiedIdentifier
90+
. . . . . . . . . . . . . . . Properties: {
91+
. . . . . . . . . . . . . . . . internalRole: qualifier
92+
. . . . . . . . . . . . . . . }
93+
. . . . . . . . . . . . . . . Children: {
94+
. . . . . . . . . . . . . . . . 0: SimpleName {
95+
. . . . . . . . . . . . . . . . . Roles: SimpleIdentifier
96+
. . . . . . . . . . . . . . . . . TOKEN "Java"
97+
. . . . . . . . . . . . . . . . . StartPosition: {
98+
. . . . . . . . . . . . . . . . . . Offset: 33
99+
. . . . . . . . . . . . . . . . . . Line: 3
100+
. . . . . . . . . . . . . . . . . . Col: 0
101+
. . . . . . . . . . . . . . . . . }
102+
. . . . . . . . . . . . . . . . . Properties: {
103+
. . . . . . . . . . . . . . . . . . internalRole: qualifier
104+
. . . . . . . . . . . . . . . . . }
105+
. . . . . . . . . . . . . . . . }
106+
. . . . . . . . . . . . . . . . 1: SimpleName {
107+
. . . . . . . . . . . . . . . . . Roles: SimpleIdentifier
108+
. . . . . . . . . . . . . . . . . TOKEN "io"
109+
. . . . . . . . . . . . . . . . . StartPosition: {
110+
. . . . . . . . . . . . . . . . . . Offset: 38
111+
. . . . . . . . . . . . . . . . . . Line: 3
112+
. . . . . . . . . . . . . . . . . . Col: 0
113+
. . . . . . . . . . . . . . . . . }
114+
. . . . . . . . . . . . . . . . . Properties: {
115+
. . . . . . . . . . . . . . . . . . internalRole: name
116+
. . . . . . . . . . . . . . . . . }
117+
. . . . . . . . . . . . . . . . }
118+
. . . . . . . . . . . . . . . }
119+
. . . . . . . . . . . . . . }
120+
. . . . . . . . . . . . . . 1: SimpleName {
121+
. . . . . . . . . . . . . . . Roles: SimpleIdentifier
122+
. . . . . . . . . . . . . . . TOKEN "Console"
123+
. . . . . . . . . . . . . . . StartPosition: {
124+
. . . . . . . . . . . . . . . . Offset: 41
125+
. . . . . . . . . . . . . . . . Line: 3
126+
. . . . . . . . . . . . . . . . Col: 0
127+
. . . . . . . . . . . . . . . }
128+
. . . . . . . . . . . . . . . Properties: {
129+
. . . . . . . . . . . . . . . . internalRole: name
130+
. . . . . . . . . . . . . . . }
131+
. . . . . . . . . . . . . . }
132+
. . . . . . . . . . . . . }
133+
. . . . . . . . . . . . }
134+
. . . . . . . . . . . }
135+
. . . . . . . . . . }
136+
. . . . . . . . . . 1: VariableDeclarationFragment {
137+
. . . . . . . . . . . Properties: {
138+
. . . . . . . . . . . . internalRole: fragments
139+
. . . . . . . . . . . }
140+
. . . . . . . . . . . Children: {
141+
. . . . . . . . . . . . 0: SimpleName {
142+
. . . . . . . . . . . . . Roles: SimpleIdentifier
143+
. . . . . . . . . . . . . TOKEN "cons"
144+
. . . . . . . . . . . . . StartPosition: {
145+
. . . . . . . . . . . . . . Offset: 49
146+
. . . . . . . . . . . . . . Line: 3
147+
. . . . . . . . . . . . . . Col: 0
148+
. . . . . . . . . . . . . }
149+
. . . . . . . . . . . . . Properties: {
150+
. . . . . . . . . . . . . . internalRole: name
151+
. . . . . . . . . . . . . }
152+
. . . . . . . . . . . . }
153+
. . . . . . . . . . . }
154+
. . . . . . . . . . }
155+
. . . . . . . . . }
156+
. . . . . . . . }
157+
. . . . . . . }
158+
. . . . . . }
159+
. . . . . }
160+
. . . . }
161+
. . . }
162+
. . }
163+
. }
164+
}
165+

0 commit comments

Comments
 (0)