1 | require("./es7");
|
2 |
|
3 | var types = require("../lib/types");
|
4 | var defaults = require("../lib/shared").defaults;
|
5 | var def = types.Type.def;
|
6 | var or = types.Type.or;
|
7 |
|
8 | def("Noop")
|
9 | .bases("Node")
|
10 | .build();
|
11 |
|
12 | def("DoExpression")
|
13 | .bases("Expression")
|
14 | .build("body")
|
15 | .field("body", [def("Statement")]);
|
16 |
|
17 | def("Super")
|
18 | .bases("Expression")
|
19 | .build();
|
20 |
|
21 | def("BindExpression")
|
22 | .bases("Expression")
|
23 | .build("object", "callee")
|
24 | .field("object", or(def("Expression"), null))
|
25 | .field("callee", def("Expression"));
|
26 |
|
27 | def("Decorator")
|
28 | .bases("Node")
|
29 | .build("expression")
|
30 | .field("expression", def("Expression"));
|
31 |
|
32 | def("Property")
|
33 | .field("decorators",
|
34 | or([def("Decorator")], null),
|
35 | defaults["null"]);
|
36 |
|
37 | def("MethodDefinition")
|
38 | .field("decorators",
|
39 | or([def("Decorator")], null),
|
40 | defaults["null"]);
|
41 |
|
42 | def("MetaProperty")
|
43 | .bases("Expression")
|
44 | .build("meta", "property")
|
45 | .field("meta", def("Identifier"))
|
46 | .field("property", def("Identifier"));
|
47 |
|
48 | def("ParenthesizedExpression")
|
49 | .bases("Expression")
|
50 | .build("expression")
|
51 | .field("expression", def("Expression"));
|
52 |
|
53 | def("ImportSpecifier")
|
54 | .bases("ModuleSpecifier")
|
55 | .build("imported", "local")
|
56 | .field("imported", def("Identifier"));
|
57 |
|
58 | def("ImportDefaultSpecifier")
|
59 | .bases("ModuleSpecifier")
|
60 | .build("local");
|
61 |
|
62 | def("ImportNamespaceSpecifier")
|
63 | .bases("ModuleSpecifier")
|
64 | .build("local");
|
65 |
|
66 | def("ExportDefaultDeclaration")
|
67 | .bases("Declaration")
|
68 | .build("declaration")
|
69 | .field("declaration", or(def("Declaration"), def("Expression")));
|
70 |
|
71 | def("ExportNamedDeclaration")
|
72 | .bases("Declaration")
|
73 | .build("declaration", "specifiers", "source")
|
74 | .field("declaration", or(def("Declaration"), null))
|
75 | .field("specifiers", [def("ExportSpecifier")], defaults.emptyArray)
|
76 | .field("source", or(def("Literal"), null), defaults["null"]);
|
77 |
|
78 | def("ExportSpecifier")
|
79 | .bases("ModuleSpecifier")
|
80 | .build("local", "exported")
|
81 | .field("exported", def("Identifier"));
|
82 |
|
83 | def("ExportNamespaceSpecifier")
|
84 | .bases("Specifier")
|
85 | .build("exported")
|
86 | .field("exported", def("Identifier"));
|
87 |
|
88 | def("ExportDefaultSpecifier")
|
89 | .bases("Specifier")
|
90 | .build("exported")
|
91 | .field("exported", def("Identifier"));
|
92 |
|
93 | def("ExportAllDeclaration")
|
94 | .bases("Declaration")
|
95 | .build("exported", "source")
|
96 | .field("exported", or(def("Identifier"), null))
|
97 | .field("source", def("Literal"));
|
98 |
|
99 | def("CommentBlock")
|
100 | .bases("Comment")
|
101 | .build("value", "leading", "trailing");
|
102 |
|
103 | def("CommentLine")
|
104 | .bases("Comment")
|
105 | .build("value", "leading", "trailing");
|