ast-types 0.11.5 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +2 -2
- package/def/babel-core.d.ts +2 -0
- package/def/babel-core.js +250 -290
- package/def/babel.d.ts +2 -0
- package/def/babel.js +12 -3
- package/def/core.d.ts +2 -0
- package/def/core.js +57 -126
- package/def/es-proposals.d.ts +2 -0
- package/def/es-proposals.js +34 -32
- package/def/es6.d.ts +2 -0
- package/def/es6.js +210 -253
- package/def/es7.d.ts +2 -0
- package/def/es7.js +35 -41
- package/def/esprima.d.ts +2 -0
- package/def/esprima.js +50 -71
- package/def/flow.d.ts +2 -0
- package/def/flow.js +289 -393
- package/def/jsx.d.ts +2 -0
- package/def/jsx.js +99 -125
- package/def/type-annotations.d.ts +7 -0
- package/def/type-annotations.js +42 -0
- package/def/typescript.d.ts +2 -0
- package/def/typescript.js +326 -444
- package/fork.d.ts +46 -0
- package/fork.js +40 -31
- package/gen/builders.d.ts +2539 -0
- package/gen/builders.js +2 -0
- package/gen/kinds.d.ts +259 -0
- package/gen/kinds.js +2 -0
- package/gen/namedTypes.d.ts +262 -0
- package/gen/namedTypes.js +2 -0
- package/gen/nodes.d.ts +1255 -0
- package/gen/nodes.js +2 -0
- package/gen/visitor.d.ts +263 -0
- package/gen/visitor.js +2 -0
- package/lib/equiv.d.ts +5 -0
- package/lib/equiv.js +19 -49
- package/lib/node-path.d.ts +22 -0
- package/lib/node-path.js +60 -125
- package/lib/path-visitor.d.ts +52 -0
- package/lib/path-visitor.js +117 -194
- package/lib/path.d.ts +25 -0
- package/lib/path.js +71 -107
- package/lib/scope.d.ts +26 -0
- package/lib/scope.js +100 -143
- package/lib/shared.d.ts +13 -0
- package/lib/shared.js +34 -31
- package/lib/types.d.ts +140 -0
- package/lib/types.js +584 -676
- package/main.d.ts +16 -0
- package/main.js +33 -18
- package/package.json +24 -7
- package/tsconfig.json +20 -0
- package/types.d.ts +6 -0
- package/types.js +2 -0
- package/def/e4x.js +0 -86
- package/def/mozilla.js +0 -42
package/def/esprima.js
CHANGED
|
@@ -1,72 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var types = fork.use(require("../lib/types"));
|
|
5
|
-
var defaults = fork.use(require("../lib/shared")).defaults;
|
|
6
|
-
var def = types.Type.def;
|
|
7
|
-
var or = types.Type.or;
|
|
8
|
-
|
|
9
|
-
def("VariableDeclaration")
|
|
10
|
-
.field("declarations", [or(
|
|
11
|
-
def("VariableDeclarator"),
|
|
12
|
-
def("Identifier") // Esprima deviation.
|
|
13
|
-
)]);
|
|
14
|
-
|
|
15
|
-
def("Property")
|
|
16
|
-
.field("value", or(
|
|
17
|
-
def("Expression"),
|
|
18
|
-
def("Pattern") // Esprima deviation.
|
|
19
|
-
));
|
|
20
|
-
|
|
21
|
-
def("ArrayPattern")
|
|
22
|
-
.field("elements", [or(
|
|
23
|
-
def("Pattern"),
|
|
24
|
-
def("SpreadElement"),
|
|
25
|
-
null
|
|
26
|
-
)]);
|
|
27
|
-
|
|
28
|
-
def("ObjectPattern")
|
|
29
|
-
.field("properties", [or(
|
|
30
|
-
def("Property"),
|
|
31
|
-
def("PropertyPattern"),
|
|
32
|
-
def("SpreadPropertyPattern"),
|
|
33
|
-
def("SpreadProperty") // Used by Esprima.
|
|
34
|
-
)]);
|
|
35
|
-
|
|
36
|
-
// Like ModuleSpecifier, except type:"ExportSpecifier" and buildable.
|
|
37
|
-
// export {<id [as name]>} [from ...];
|
|
38
|
-
def("ExportSpecifier")
|
|
39
|
-
.bases("ModuleSpecifier")
|
|
40
|
-
.build("id", "name");
|
|
41
|
-
|
|
42
|
-
// export <*> from ...;
|
|
43
|
-
def("ExportBatchSpecifier")
|
|
44
|
-
.bases("Specifier")
|
|
45
|
-
.build();
|
|
46
|
-
|
|
47
|
-
def("ExportDeclaration")
|
|
48
|
-
.bases("Declaration")
|
|
49
|
-
.build("default", "declaration", "specifiers", "source")
|
|
50
|
-
.field("default", Boolean)
|
|
51
|
-
.field("declaration", or(
|
|
52
|
-
def("Declaration"),
|
|
53
|
-
def("Expression"), // Implies default.
|
|
54
|
-
null
|
|
55
|
-
))
|
|
56
|
-
.field("specifiers", [or(
|
|
57
|
-
def("ExportSpecifier"),
|
|
58
|
-
def("ExportBatchSpecifier")
|
|
59
|
-
)], defaults.emptyArray)
|
|
60
|
-
.field("source", or(
|
|
61
|
-
def("Literal"),
|
|
62
|
-
null
|
|
63
|
-
), defaults["null"]);
|
|
64
|
-
|
|
65
|
-
def("Block")
|
|
66
|
-
.bases("Comment")
|
|
67
|
-
.build("value", /*optional:*/ "leading", "trailing");
|
|
68
|
-
|
|
69
|
-
def("Line")
|
|
70
|
-
.bases("Comment")
|
|
71
|
-
.build("value", /*optional:*/ "leading", "trailing");
|
|
1
|
+
"use strict";;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
72
4
|
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var es7_1 = __importDefault(require("./es7"));
|
|
7
|
+
var types_1 = __importDefault(require("../lib/types"));
|
|
8
|
+
var shared_1 = __importDefault(require("../lib/shared"));
|
|
9
|
+
function default_1(fork) {
|
|
10
|
+
fork.use(es7_1.default);
|
|
11
|
+
var types = fork.use(types_1.default);
|
|
12
|
+
var defaults = fork.use(shared_1.default).defaults;
|
|
13
|
+
var def = types.Type.def;
|
|
14
|
+
var or = types.Type.or;
|
|
15
|
+
def("VariableDeclaration")
|
|
16
|
+
.field("declarations", [or(def("VariableDeclarator"), def("Identifier") // Esprima deviation.
|
|
17
|
+
)]);
|
|
18
|
+
def("Property")
|
|
19
|
+
.field("value", or(def("Expression"), def("Pattern") // Esprima deviation.
|
|
20
|
+
));
|
|
21
|
+
def("ArrayPattern")
|
|
22
|
+
.field("elements", [or(def("Pattern"), def("SpreadElement"), null)]);
|
|
23
|
+
def("ObjectPattern")
|
|
24
|
+
.field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty") // Used by Esprima.
|
|
25
|
+
)]);
|
|
26
|
+
// Like ModuleSpecifier, except type:"ExportSpecifier" and buildable.
|
|
27
|
+
// export {<id [as name]>} [from ...];
|
|
28
|
+
def("ExportSpecifier")
|
|
29
|
+
.bases("ModuleSpecifier")
|
|
30
|
+
.build("id", "name");
|
|
31
|
+
// export <*> from ...;
|
|
32
|
+
def("ExportBatchSpecifier")
|
|
33
|
+
.bases("Specifier")
|
|
34
|
+
.build();
|
|
35
|
+
def("ExportDeclaration")
|
|
36
|
+
.bases("Declaration")
|
|
37
|
+
.build("default", "declaration", "specifiers", "source")
|
|
38
|
+
.field("default", Boolean)
|
|
39
|
+
.field("declaration", or(def("Declaration"), def("Expression"), // Implies default.
|
|
40
|
+
null))
|
|
41
|
+
.field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray)
|
|
42
|
+
.field("source", or(def("Literal"), null), defaults["null"]);
|
|
43
|
+
def("Block")
|
|
44
|
+
.bases("Comment")
|
|
45
|
+
.build("value", /*optional:*/ "leading", "trailing");
|
|
46
|
+
def("Line")
|
|
47
|
+
.bases("Comment")
|
|
48
|
+
.build("value", /*optional:*/ "leading", "trailing");
|
|
49
|
+
}
|
|
50
|
+
exports.default = default_1;
|
|
51
|
+
module.exports = exports["default"];
|
package/def/flow.d.ts
ADDED