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

Commit ffb4980

Browse files
committed
sem: skip mapping function's comments
Signed-off-by: Alexander Bezzubov <[email protected]>
1 parent c0c3f18 commit ffb4980

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

driver/normalizer/normalizer.go

+4
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ var Normalizers = []Mapping{
249249
{Name: "local", Op: Var("local")},
250250
//FIXME(bzz): save this once we agree how
251251
{Name: "leadingComments", Drop: true, Op: Any()},
252+
{Name: "trailingComments", Drop: true, Op: Any()},
252253
},
253254
Obj{
254255
"Name": Var("local"),
@@ -270,6 +271,9 @@ var Normalizers = []Mapping{
270271
{Name: "returnType", Drop: true, Op: Any()},
271272
//FIXME(bzz): map Flow argument type annotations
272273
{Name: "typeParameters", Drop: true, Op: Any()},
274+
// FIXME(bzz): make sure such comments are linked properly
275+
{Name: "leadingComments", Drop: true, Op: Any()},
276+
{Name: "trailingComments", Drop: true, Op: Any()},
273277
{Name: "params", Op: Each("params", Cases("param_case",
274278
// Identifier
275279
Check(

fixtures/issue58.js.native

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
comments: [],
3-
end: 170,
3+
end: 168,
44
loc: {
55
end: {
6-
column: 2,
6+
column: 0,
77
line: 10,
88
},
99
start: {
@@ -464,10 +464,10 @@
464464
},
465465
],
466466
directives: [],
467-
end: 170,
467+
end: 168,
468468
loc: {
469469
end: {
470-
column: 2,
470+
column: 0,
471471
line: 10,
472472
},
473473
start: {

fixtures/issue58.js.sem.uast

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
col: 1,
88
},
99
end: { '@type': "uast:Position",
10-
offset: 170,
10+
offset: 168,
1111
line: 10,
12-
col: 3,
12+
col: 1,
1313
},
1414
},
1515
comments: [],
@@ -22,9 +22,9 @@
2222
col: 1,
2323
},
2424
end: { '@type': "uast:Position",
25-
offset: 170,
25+
offset: 168,
2626
line: 10,
27-
col: 3,
27+
col: 1,
2828
},
2929
},
3030
body: [

fixtures/issue58.js.uast

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
col: 1,
88
},
99
end: { '@type': "uast:Position",
10-
offset: 170,
10+
offset: 168,
1111
line: 10,
12-
col: 3,
12+
col: 1,
1313
},
1414
},
1515
comments: [],
@@ -22,9 +22,9 @@
2222
col: 1,
2323
},
2424
end: { '@type': "uast:Position",
25-
offset: 170,
25+
offset: 168,
2626
line: 10,
27-
col: 3,
27+
col: 1,
2828
},
2929
},
3030
body: [

0 commit comments

Comments
 (0)