forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbaseNodeFactory.js
More file actions
39 lines (39 loc) · 1.81 KB
/
baseNodeFactory.js
File metadata and controls
39 lines (39 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createBaseNodeFactory = void 0;
var ts_1 = require("../_namespaces/ts");
/**
* Creates a `BaseNodeFactory` which can be used to create `Node` instances from the constructors provided by the object allocator.
*
* @internal
*/
function createBaseNodeFactory() {
var NodeConstructor;
var TokenConstructor;
var IdentifierConstructor;
var PrivateIdentifierConstructor;
var SourceFileConstructor;
return {
createBaseSourceFileNode: createBaseSourceFileNode,
createBaseIdentifierNode: createBaseIdentifierNode,
createBasePrivateIdentifierNode: createBasePrivateIdentifierNode,
createBaseTokenNode: createBaseTokenNode,
createBaseNode: createBaseNode
};
function createBaseSourceFileNode(kind) {
return new (SourceFileConstructor || (SourceFileConstructor = ts_1.objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
}
function createBaseIdentifierNode(kind) {
return new (IdentifierConstructor || (IdentifierConstructor = ts_1.objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
}
function createBasePrivateIdentifierNode(kind) {
return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts_1.objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
}
function createBaseTokenNode(kind) {
return new (TokenConstructor || (TokenConstructor = ts_1.objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
}
function createBaseNode(kind) {
return new (NodeConstructor || (NodeConstructor = ts_1.objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);
}
}
exports.createBaseNodeFactory = createBaseNodeFactory;