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

Commit ec04b0c

Browse files
committed
sem: don't map FunctionDeclaration>[predicate returnType typeParameters]
Skip mapping Flow type annotation for function's - arguments - return types in Sematic UAST Signed-off-by: Alexander Bezzubov <[email protected]>
1 parent c20f8d5 commit ec04b0c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

driver/normalizer/normalizer.go

+13-7
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,18 @@ var Normalizers = []Mapping{
252252
},
253253
)),
254254
MapSemantic("FunctionDeclaration", uast.FunctionGroup{}, MapObj(
255-
Obj{
256-
"id": Var("name"),
257-
"generator": Var("gen"), // FIXME: define channels in SDK? or return a function?
258-
"async": Var("async"), // TODO: async
259-
"body": Var("body"),
260-
"params": Each("params", Cases("param_case",
255+
Fields{
256+
{Name: "id", Op: Var("name")},
257+
{Name: "generator", Op: Var("gen")}, // FIXME: define channels in SDK? or return a function?
258+
{Name: "async", Op: Var("async")}, // TODO: async
259+
{Name: "body", Op: Var("body")},
260+
//FIXME(bzz): map predicate properly
261+
{Name: "predicate", Drop: true, Op: Any()},
262+
//FIXME(bzz): map Flow return type annotations
263+
{Name: "returnType", Drop: true, Op: Any()},
264+
//FIXME(bzz): map Flow argument type annotations
265+
{Name: "typeParameters", Drop: true, Op: Any()},
266+
{Name: "params", Op: Each("params", Cases("param_case",
261267
// Identifier
262268
Check(
263269
HasType(uast.Identifier{}),
@@ -276,7 +282,7 @@ var Normalizers = []Mapping{
276282
uast.KeyPos: Var("arg_pos"),
277283
"argument": Var("arg_name"),
278284
},
279-
)),
285+
))},
280286
},
281287
Obj{
282288
"Nodes": Arr(

0 commit comments

Comments
 (0)