Skip to content

Commit 01a40b2

Browse files
Denys Smirnovdennwc
Denys Smirnov
authored andcommitted
enable language namespace in semantic uast
Signed-off-by: Denys Smirnov <[email protected]>
1 parent 7f197bb commit 01a40b2

Some content is hidden

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

50 files changed

+1179
-1178
lines changed

Gopkg.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[[constraint]]
55
name = "gopkg.in/bblfsh/sdk.v2"
6-
version = "v2.5.x"
6+
version = "v2.6.x"
77

88
[prune]
99
go-tests = true

driver/normalizer/transforms.go

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package normalizer
33
import "gopkg.in/bblfsh/sdk.v2/driver"
44

55
var Transforms = driver.Transforms{
6+
Namespace: "typescript",
67
Preprocess: Preprocess,
78
Normalize: Normalize,
89
Annotations: Native,

fixtures/_integration.ts.sem.uast

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ '@type': "SourceFile",
1+
{ '@type': "typescript:SourceFile",
22
'@role': [Unannotated],
33
'@pos': { '@type': "uast:Positions",
44
start: { '@type': "uast:Position",
@@ -24,7 +24,7 @@
2424
referencedFiles: [],
2525
scriptKind: 3,
2626
statements: [
27-
{ '@type': "ModuleDeclaration",
27+
{ '@type': "typescript:ModuleDeclaration",
2828
'@role': [Unannotated],
2929
'@pos': { '@type': "uast:Positions",
3030
start: { '@type': "uast:Position",
@@ -38,7 +38,7 @@
3838
col: 2,
3939
},
4040
},
41-
body: { '@type': "ModuleBlock",
41+
body: { '@type': "typescript:ModuleBlock",
4242
'@role': [Unannotated],
4343
'@pos': { '@type': "uast:Positions",
4444
start: { '@type': "uast:Position",
@@ -54,7 +54,7 @@
5454
},
5555
flags: [],
5656
statements: [
57-
{ '@type': "VariableStatement",
57+
{ '@type': "typescript:VariableStatement",
5858
'@role': [Unannotated],
5959
'@pos': { '@type': "uast:Positions",
6060
start: { '@type': "uast:Position",
@@ -68,7 +68,7 @@
6868
col: 30,
6969
},
7070
},
71-
declarationList: { '@type': "VariableDeclarationList",
71+
declarationList: { '@type': "typescript:VariableDeclarationList",
7272
'@role': [Unannotated],
7373
'@pos': { '@type': "uast:Positions",
7474
start: { '@type': "uast:Position",
@@ -83,7 +83,7 @@
8383
},
8484
},
8585
declarations: [
86-
{ '@type': "VariableDeclaration",
86+
{ '@type': "typescript:VariableDeclaration",
8787
'@role': [Unannotated],
8888
'@pos': { '@type': "uast:Positions",
8989
start: { '@type': "uast:Position",
@@ -98,7 +98,7 @@
9898
},
9999
},
100100
flags: [],
101-
initializer: { '@type': "NumericLiteral",
101+
initializer: { '@type': "typescript:NumericLiteral",
102102
'@role': [Unannotated],
103103
'@pos': { '@type': "uast:Positions",
104104
start: { '@type': "uast:Position",
@@ -116,7 +116,7 @@
116116
numericLiteralFlags: 0,
117117
text: "1",
118118
},
119-
name: { '@type': "Identifier",
119+
name: { '@type': "typescript:Identifier",
120120
'@role': [Unannotated],
121121
'@pos': { '@type': "uast:Positions",
122122
start: { '@type': "uast:Position",
@@ -133,7 +133,7 @@
133133
escapedText: "a",
134134
flags: [],
135135
},
136-
type: { '@type': "NumberKeyword",
136+
type: { '@type': "typescript:NumberKeyword",
137137
'@role': [Unannotated],
138138
'@pos': { '@type': "uast:Positions",
139139
start: { '@type': "uast:Position",
@@ -155,7 +155,7 @@
155155
},
156156
flags: [],
157157
modifiers: [
158-
{ '@type': "ExportKeyword",
158+
{ '@type': "typescript:ExportKeyword",
159159
'@role': [Unannotated],
160160
'@pos': { '@type': "uast:Positions",
161161
start: { '@type': "uast:Position",
@@ -177,7 +177,7 @@
177177
},
178178
flags: [Namespace],
179179
modifierFlagsCache: 536870912,
180-
name: { '@type': "Identifier",
180+
name: { '@type': "typescript:Identifier",
181181
'@role': [Unannotated],
182182
'@pos': { '@type': "uast:Positions",
183183
start: { '@type': "uast:Position",
@@ -195,7 +195,7 @@
195195
flags: [],
196196
},
197197
},
198-
{ '@type': "VariableStatement",
198+
{ '@type': "typescript:VariableStatement",
199199
'@role': [Unannotated],
200200
'@pos': { '@type': "uast:Positions",
201201
start: { '@type': "uast:Position",
@@ -209,7 +209,7 @@
209209
col: 15,
210210
},
211211
},
212-
declarationList: { '@type': "VariableDeclarationList",
212+
declarationList: { '@type': "typescript:VariableDeclarationList",
213213
'@role': [Unannotated],
214214
'@pos': { '@type': "uast:Positions",
215215
start: { '@type': "uast:Position",
@@ -224,7 +224,7 @@
224224
},
225225
},
226226
declarations: [
227-
{ '@type': "VariableDeclaration",
227+
{ '@type': "typescript:VariableDeclaration",
228228
'@role': [Unannotated],
229229
'@pos': { '@type': "uast:Positions",
230230
start: { '@type': "uast:Position",
@@ -239,7 +239,7 @@
239239
},
240240
},
241241
flags: [],
242-
initializer: { '@type': "PropertyAccessExpression",
242+
initializer: { '@type': "typescript:PropertyAccessExpression",
243243
'@role': [Unannotated],
244244
'@pos': { '@type': "uast:Positions",
245245
start: { '@type': "uast:Position",
@@ -253,7 +253,7 @@
253253
col: 14,
254254
},
255255
},
256-
expression: { '@type': "Identifier",
256+
expression: { '@type': "typescript:Identifier",
257257
'@role': [Unannotated],
258258
'@pos': { '@type': "uast:Positions",
259259
start: { '@type': "uast:Position",
@@ -271,7 +271,7 @@
271271
flags: [],
272272
},
273273
flags: [],
274-
name: { '@type': "Identifier",
274+
name: { '@type': "typescript:Identifier",
275275
'@role': [Unannotated],
276276
'@pos': { '@type': "uast:Positions",
277277
start: { '@type': "uast:Position",
@@ -289,7 +289,7 @@
289289
flags: [],
290290
},
291291
},
292-
name: { '@type': "Identifier",
292+
name: { '@type': "typescript:Identifier",
293293
'@role': [Unannotated],
294294
'@pos': { '@type': "uast:Positions",
295295
start: { '@type': "uast:Position",

fixtures/ambient.ts.sem.uast

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ '@type': "SourceFile",
1+
{ '@type': "typescript:SourceFile",
22
'@role': [Unannotated],
33
'@pos': { '@type': "uast:Positions",
44
start: { '@type': "uast:Position",
@@ -24,7 +24,7 @@
2424
referencedFiles: [],
2525
scriptKind: 3,
2626
statements: [
27-
{ '@type': "VariableStatement",
27+
{ '@type': "typescript:VariableStatement",
2828
'@role': [Unannotated],
2929
'@pos': { '@type': "uast:Positions",
3030
start: { '@type': "uast:Position",
@@ -38,7 +38,7 @@
3838
col: 22,
3939
},
4040
},
41-
declarationList: { '@type': "VariableDeclarationList",
41+
declarationList: { '@type': "typescript:VariableDeclarationList",
4242
'@role': [Unannotated],
4343
'@pos': { '@type': "uast:Positions",
4444
start: { '@type': "uast:Position",
@@ -53,7 +53,7 @@
5353
},
5454
},
5555
declarations: [
56-
{ '@type': "VariableDeclaration",
56+
{ '@type': "typescript:VariableDeclaration",
5757
'@role': [Unannotated],
5858
'@pos': { '@type': "uast:Positions",
5959
start: { '@type': "uast:Position",
@@ -68,7 +68,7 @@
6868
},
6969
},
7070
flags: [],
71-
name: { '@type': "Identifier",
71+
name: { '@type': "typescript:Identifier",
7272
'@role': [Unannotated],
7373
'@pos': { '@type': "uast:Positions",
7474
start: { '@type': "uast:Position",
@@ -92,7 +92,7 @@
9292
flags: [],
9393
modifierFlagsCache: 536870914,
9494
modifiers: [
95-
{ '@type': "DeclareKeyword",
95+
{ '@type': "typescript:DeclareKeyword",
9696
'@role': [Unannotated],
9797
'@pos': { '@type': "uast:Positions",
9898
start: { '@type': "uast:Position",
@@ -110,7 +110,7 @@
110110
},
111111
],
112112
},
113-
{ '@type': "ExpressionStatement",
113+
{ '@type': "typescript:ExpressionStatement",
114114
'@role': [Unannotated],
115115
'@pos': { '@type': "uast:Positions",
116116
start: { '@type': "uast:Position",
@@ -124,7 +124,7 @@
124124
col: 26,
125125
},
126126
},
127-
expression: { '@type': "BinaryExpression",
127+
expression: { '@type': "typescript:BinaryExpression",
128128
'@role': [Unannotated],
129129
'@pos': { '@type': "uast:Positions",
130130
start: { '@type': "uast:Position",
@@ -139,7 +139,7 @@
139139
},
140140
},
141141
flags: [],
142-
left: { '@type': "PropertyAccessExpression",
142+
left: { '@type': "typescript:PropertyAccessExpression",
143143
'@role': [Unannotated],
144144
'@pos': { '@type': "uast:Positions",
145145
start: { '@type': "uast:Position",
@@ -153,7 +153,7 @@
153153
col: 15,
154154
},
155155
},
156-
expression: { '@type': "Identifier",
156+
expression: { '@type': "typescript:Identifier",
157157
'@role': [Unannotated],
158158
'@pos': { '@type': "uast:Positions",
159159
start: { '@type': "uast:Position",
@@ -171,7 +171,7 @@
171171
flags: [],
172172
},
173173
flags: [],
174-
name: { '@type': "Identifier",
174+
name: { '@type': "typescript:Identifier",
175175
'@role': [Unannotated],
176176
'@pos': { '@type': "uast:Positions",
177177
start: { '@type': "uast:Position",
@@ -189,7 +189,7 @@
189189
flags: [],
190190
},
191191
},
192-
operatorToken: { '@type': "EqualsToken",
192+
operatorToken: { '@type': "typescript:EqualsToken",
193193
'@role': [Unannotated],
194194
'@pos': { '@type': "uast:Positions",
195195
start: { '@type': "uast:Position",
@@ -205,7 +205,7 @@
205205
},
206206
flags: [],
207207
},
208-
right: { '@type': "StringLiteral",
208+
right: { '@type': "typescript:StringLiteral",
209209
'@role': [Unannotated],
210210
'@pos': { '@type': "uast:Positions",
211211
start: { '@type': "uast:Position",

0 commit comments

Comments
 (0)