This repository was archived by the owner on Mar 8, 2020. It is now read-only.
File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,26 @@ var Preprocessors = []Mapping{
74
74
uast .KeyType : String ("ImportNamespaceSpecifier" ),
75
75
}),
76
76
),
77
+ // FIXME(bzz): make sure such comments are mapped properly
78
+ Map (
79
+ Part ("_" , Obj {
80
+ uast .KeyType : String ("ImportDeclaration" ),
81
+ "leadingComments" : Any (),
82
+ }),
83
+ Part ("_" , Obj {
84
+ uast .KeyType : String ("ImportDeclaration" ),
85
+ }),
86
+ ),
87
+ // FIXME(bzz): make sure such comments are mapped properly
88
+ Map (
89
+ Part ("_" , Obj {
90
+ uast .KeyType : String ("ImportDeclaration" ),
91
+ "trailingComments" : Any (),
92
+ }),
93
+ Part ("_" , Obj {
94
+ uast .KeyType : String ("ImportDeclaration" ),
95
+ }),
96
+ ),
77
97
}
78
98
79
99
// Normalizers is the main block of normalization rules to convert native AST to semantic UAST.
@@ -141,6 +161,9 @@ var Normalizers = []Mapping{
141
161
"Path" : Var ("path" ),
142
162
},
143
163
)),
164
+ // importKind switch, set only by flow plugin
165
+ // https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md#importdeclaration
166
+ // TODO(bzz): this mapping misses 'typeof' case
144
167
MapSemantic ("ImportDeclaration" , uast.Import {}, MapObj (
145
168
CasesObj ("case" ,
146
169
// common
You can’t perform that action at this time.
0 commit comments