@rightcapital/phpdoc-parser 0.3.3-feature-add-basic-ci.7.0 → 0.3.3-feature-add-basic-ci.8.0
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/dist/index.d.ts +73 -0
- package/dist/index.js +0 -1
- package/dist/phpdoc-parser/ast/abstract-node-visitor.d.ts +8 -0
- package/dist/phpdoc-parser/ast/abstract-node-visitor.js +18 -0
- package/dist/phpdoc-parser/ast/base-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/base-node.js +27 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-item-node.d.ts +8 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-item-node.js +21 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-node.d.ts +8 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-node.js +17 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-false-node.d.ts +5 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-false-node.js +13 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-float-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-float-node.js +17 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-integer-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-integer-node.js +17 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-node.d.ts +25 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-node.js +43 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-null-node.d.ts +5 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-null-node.js +13 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-string-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-string-node.js +17 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-true-node.d.ts +5 -0
- package/dist/phpdoc-parser/ast/const-expr/const-expr-true-node.js +13 -0
- package/dist/phpdoc-parser/ast/const-expr/const-fetch-node.d.ts +8 -0
- package/dist/phpdoc-parser/ast/const-expr/const-fetch-node.js +21 -0
- package/dist/phpdoc-parser/ast/const-expr/quote-aware-const-expr-string-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/const-expr/quote-aware-const-expr-string-node.js +47 -0
- package/dist/phpdoc-parser/ast/node-traverser.d.ts +11 -0
- package/dist/phpdoc-parser/ast/node-traverser.js +216 -0
- package/dist/phpdoc-parser/ast/node-visitor/cloning-visitor.d.ts +5 -0
- package/dist/phpdoc-parser/ast/node-visitor/cloning-visitor.js +14 -0
- package/dist/phpdoc-parser/ast/node-visitor.d.ts +11 -0
- package/dist/phpdoc-parser/ast/node-visitor.js +2 -0
- package/dist/phpdoc-parser/ast/node.d.ts +6 -0
- package/dist/phpdoc-parser/ast/node.js +2 -0
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-method-value-node.d.ts +13 -0
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-method-value-node.js +24 -0
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-property-value-node.d.ts +13 -0
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-property-value-node.js +24 -0
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-value-node.d.ts +12 -0
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-value-node.js +23 -0
- package/dist/phpdoc-parser/ast/php-doc/deprecated-tag-value-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/php-doc/deprecated-tag-value-node.js +17 -0
- package/dist/phpdoc-parser/ast/php-doc/extends-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/extends-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/generic-tag-value-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/php-doc/generic-tag-value-node.js +17 -0
- package/dist/phpdoc-parser/ast/php-doc/implements-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/implements-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/invalid-tag-value-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/php-doc/invalid-tag-value-node.js +33 -0
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-node.d.ts +15 -0
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-node.js +27 -0
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-parameter-node.d.ts +13 -0
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-parameter-node.js +27 -0
- package/dist/phpdoc-parser/ast/php-doc/mixin-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/mixin-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/param-out-tag-value-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/php-doc/param-out-tag-value-node.js +19 -0
- package/dist/phpdoc-parser/ast/php-doc/param-tag-value-node.d.ts +12 -0
- package/dist/phpdoc-parser/ast/php-doc/param-tag-value-node.js +28 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-child-node.d.ts +4 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-child-node.js +10 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-node.d.ts +32 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-node.js +97 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-node.d.ts +56 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-node.js +90 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-value-node.d.ts +4 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-value-node.js +10 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-text-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/php-doc/php-doc-text-node.js +17 -0
- package/dist/phpdoc-parser/ast/php-doc/property-tag-value-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/php-doc/property-tag-value-node.js +19 -0
- package/dist/phpdoc-parser/ast/php-doc/return-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/return-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/self-out-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/self-out-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/template-tag-value-node.d.ts +11 -0
- package/dist/phpdoc-parser/ast/php-doc/template-tag-value-node.js +24 -0
- package/dist/phpdoc-parser/ast/php-doc/throws-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/throws-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/type-alias-import-tag-value-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/php-doc/type-alias-import-tag-value-node.js +22 -0
- package/dist/phpdoc-parser/ast/php-doc/type-alias-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/type-alias-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/typeless-param-tag-value-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/php-doc/typeless-param-tag-value-node.js +22 -0
- package/dist/phpdoc-parser/ast/php-doc/uses-tag-value-node.d.ts +9 -0
- package/dist/phpdoc-parser/ast/php-doc/uses-tag-value-node.js +18 -0
- package/dist/phpdoc-parser/ast/php-doc/var-tag-value-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/php-doc/var-tag-value-node.js +19 -0
- package/dist/phpdoc-parser/ast/type/array-shape-item-node.d.ts +12 -0
- package/dist/phpdoc-parser/ast/type/array-shape-item-node.js +22 -0
- package/dist/phpdoc-parser/ast/type/array-shape-node.d.ts +14 -0
- package/dist/phpdoc-parser/ast/type/array-shape-node.js +31 -0
- package/dist/phpdoc-parser/ast/type/array-type-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/type/array-type-node.js +25 -0
- package/dist/phpdoc-parser/ast/type/callable-type-node.d.ts +11 -0
- package/dist/phpdoc-parser/ast/type/callable-type-node.js +24 -0
- package/dist/phpdoc-parser/ast/type/callable-type-parameter-node.d.ts +11 -0
- package/dist/phpdoc-parser/ast/type/callable-type-parameter-node.js +26 -0
- package/dist/phpdoc-parser/ast/type/conditional-type-for-parameter-node.d.ts +11 -0
- package/dist/phpdoc-parser/ast/type/conditional-type-for-parameter-node.js +21 -0
- package/dist/phpdoc-parser/ast/type/conditional-type-node.d.ts +11 -0
- package/dist/phpdoc-parser/ast/type/conditional-type-node.js +21 -0
- package/dist/phpdoc-parser/ast/type/const-type-node.d.ts +8 -0
- package/dist/phpdoc-parser/ast/type/const-type-node.js +17 -0
- package/dist/phpdoc-parser/ast/type/generic-type-node.d.ts +15 -0
- package/dist/phpdoc-parser/ast/type/generic-type-node.js +37 -0
- package/dist/phpdoc-parser/ast/type/identifier-type-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/type/identifier-type-node.js +17 -0
- package/dist/phpdoc-parser/ast/type/intersection-type-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/type/intersection-type-node.js +25 -0
- package/dist/phpdoc-parser/ast/type/invalid-type-node.d.ts +10 -0
- package/dist/phpdoc-parser/ast/type/invalid-type-node.js +29 -0
- package/dist/phpdoc-parser/ast/type/nullable-type-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/type/nullable-type-node.js +17 -0
- package/dist/phpdoc-parser/ast/type/object-shape-item-node.d.ts +11 -0
- package/dist/phpdoc-parser/ast/type/object-shape-item-node.js +22 -0
- package/dist/phpdoc-parser/ast/type/object-shape-node.d.ts +8 -0
- package/dist/phpdoc-parser/ast/type/object-shape-node.js +17 -0
- package/dist/phpdoc-parser/ast/type/offset-access-type-node.d.ts +8 -0
- package/dist/phpdoc-parser/ast/type/offset-access-type-node.js +26 -0
- package/dist/phpdoc-parser/ast/type/this-type-node.d.ts +5 -0
- package/dist/phpdoc-parser/ast/type/this-type-node.js +13 -0
- package/dist/phpdoc-parser/ast/type/type-node.d.ts +40 -0
- package/dist/phpdoc-parser/ast/type/type-node.js +64 -0
- package/dist/phpdoc-parser/ast/type/union-type-node.d.ts +7 -0
- package/dist/phpdoc-parser/ast/type/union-type-node.js +25 -0
- package/dist/phpdoc-parser/ast/types.d.ts +13 -0
- package/dist/phpdoc-parser/ast/types.js +18 -0
- package/dist/phpdoc-parser/lexer/lexer.d.ts +46 -0
- package/dist/phpdoc-parser/lexer/lexer.js +143 -0
- package/dist/phpdoc-parser/parser/const-expr-parser.d.ts +16 -0
- package/dist/phpdoc-parser/parser/const-expr-parser.js +146 -0
- package/dist/phpdoc-parser/parser/node-collecting-visitor.d.ts +7 -0
- package/dist/phpdoc-parser/parser/node-collecting-visitor.js +15 -0
- package/dist/phpdoc-parser/parser/parser-exception.d.ts +16 -0
- package/dist/phpdoc-parser/parser/parser-exception.js +44 -0
- package/dist/phpdoc-parser/parser/php-doc-parser.d.ts +47 -0
- package/dist/phpdoc-parser/parser/php-doc-parser.js +558 -0
- package/dist/phpdoc-parser/parser/string-unescaper.d.ts +6 -0
- package/dist/phpdoc-parser/parser/string-unescaper.js +41 -0
- package/dist/phpdoc-parser/parser/token-iterator.d.ts +40 -0
- package/dist/phpdoc-parser/parser/token-iterator.js +215 -0
- package/dist/phpdoc-parser/parser/type-parser.d.ts +41 -0
- package/dist/phpdoc-parser/parser/type-parser.js +576 -0
- package/dist/phpdoc-parser/printer/diff-elem.d.ts +12 -0
- package/dist/phpdoc-parser/printer/diff-elem.js +19 -0
- package/dist/phpdoc-parser/printer/differ.d.ts +10 -0
- package/dist/phpdoc-parser/printer/differ.js +111 -0
- package/dist/phpdoc-parser/printer/printer.d.ts +20 -0
- package/dist/phpdoc-parser/printer/printer.js +612 -0
- package/package.json +2 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeAliasTagValueNode = void 0;
|
|
4
|
+
const php_doc_tag_value_node_1 = require("./php-doc-tag-value-node");
|
|
5
|
+
class TypeAliasTagValueNode extends php_doc_tag_value_node_1.PhpDocTagValueNode {
|
|
6
|
+
constructor(alias, type) {
|
|
7
|
+
super();
|
|
8
|
+
this.alias = alias;
|
|
9
|
+
this.type = type;
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `${this.alias} ${this.type.toString()}`.trim();
|
|
13
|
+
}
|
|
14
|
+
getNodeType() {
|
|
15
|
+
return 'TypeAliasTagValueNode';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.TypeAliasTagValueNode = TypeAliasTagValueNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PhpDocTagValueNode } from './php-doc-tag-value-node';
|
|
2
|
+
export declare class TypelessParamTagValueNode extends PhpDocTagValueNode {
|
|
3
|
+
isVariadic: boolean;
|
|
4
|
+
parameterName: string;
|
|
5
|
+
description: string;
|
|
6
|
+
isReference: boolean;
|
|
7
|
+
constructor(isVariadic: boolean, parameterName: string, description: string, isReference?: boolean);
|
|
8
|
+
toString(): string;
|
|
9
|
+
getNodeType(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypelessParamTagValueNode = void 0;
|
|
4
|
+
const php_doc_tag_value_node_1 = require("./php-doc-tag-value-node");
|
|
5
|
+
class TypelessParamTagValueNode extends php_doc_tag_value_node_1.PhpDocTagValueNode {
|
|
6
|
+
constructor(isVariadic, parameterName, description, isReference = false) {
|
|
7
|
+
super();
|
|
8
|
+
this.isVariadic = isVariadic;
|
|
9
|
+
this.parameterName = parameterName;
|
|
10
|
+
this.description = description;
|
|
11
|
+
this.isReference = isReference;
|
|
12
|
+
}
|
|
13
|
+
toString() {
|
|
14
|
+
const reference = this.isReference ? '&' : '';
|
|
15
|
+
const variadic = this.isVariadic ? '...' : '';
|
|
16
|
+
return `${reference}${variadic}${this.parameterName} ${this.description}`.trim();
|
|
17
|
+
}
|
|
18
|
+
getNodeType() {
|
|
19
|
+
return 'TypelessParamTagValueNode';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.TypelessParamTagValueNode = TypelessParamTagValueNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PhpDocTagValueNode } from './php-doc-tag-value-node';
|
|
2
|
+
import { GenericTypeNode } from '../type/generic-type-node';
|
|
3
|
+
export declare class UsesTagValueNode extends PhpDocTagValueNode {
|
|
4
|
+
type: GenericTypeNode;
|
|
5
|
+
description: string;
|
|
6
|
+
constructor(type: GenericTypeNode, description: string);
|
|
7
|
+
toString(): string;
|
|
8
|
+
getNodeType(): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UsesTagValueNode = void 0;
|
|
4
|
+
const php_doc_tag_value_node_1 = require("./php-doc-tag-value-node");
|
|
5
|
+
class UsesTagValueNode extends php_doc_tag_value_node_1.PhpDocTagValueNode {
|
|
6
|
+
constructor(type, description) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.description = description;
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `${this.type.toString()} ${this.description}`.trim();
|
|
13
|
+
}
|
|
14
|
+
getNodeType() {
|
|
15
|
+
return 'UsesTagValueNode';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.UsesTagValueNode = UsesTagValueNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PhpDocTagValueNode } from './php-doc-tag-value-node';
|
|
2
|
+
import { TypeNode } from '../type/type-node';
|
|
3
|
+
export declare class VarTagValueNode extends PhpDocTagValueNode {
|
|
4
|
+
type: TypeNode;
|
|
5
|
+
variableName: string;
|
|
6
|
+
description: string;
|
|
7
|
+
constructor(type: TypeNode, variableName: string, description: string);
|
|
8
|
+
toString(): string;
|
|
9
|
+
getNodeType(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VarTagValueNode = void 0;
|
|
4
|
+
const php_doc_tag_value_node_1 = require("./php-doc-tag-value-node");
|
|
5
|
+
class VarTagValueNode extends php_doc_tag_value_node_1.PhpDocTagValueNode {
|
|
6
|
+
constructor(type, variableName, description) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.variableName = variableName;
|
|
10
|
+
this.description = description;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
return `${this.type.toString()} ${this.variableName} ${this.description}`.trim();
|
|
14
|
+
}
|
|
15
|
+
getNodeType() {
|
|
16
|
+
return 'VarTagValueNode';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.VarTagValueNode = VarTagValueNode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IdentifierTypeNode } from './identifier-type-node';
|
|
2
|
+
import { TypeNode } from './type-node';
|
|
3
|
+
import { ConstExprIntegerNode } from '../const-expr/const-expr-integer-node';
|
|
4
|
+
import { ConstExprStringNode } from '../const-expr/const-expr-string-node';
|
|
5
|
+
export declare class ArrayShapeItemNode extends TypeNode {
|
|
6
|
+
keyName: ConstExprIntegerNode | ConstExprStringNode | IdentifierTypeNode | null;
|
|
7
|
+
optional: boolean;
|
|
8
|
+
valueType: TypeNode;
|
|
9
|
+
constructor(keyName: ConstExprIntegerNode | ConstExprStringNode | IdentifierTypeNode | null, optional: boolean, valueType: TypeNode);
|
|
10
|
+
toString(): string;
|
|
11
|
+
getNodeType(): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayShapeItemNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class ArrayShapeItemNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(keyName, optional, valueType) {
|
|
7
|
+
super();
|
|
8
|
+
this.keyName = keyName;
|
|
9
|
+
this.optional = optional;
|
|
10
|
+
this.valueType = valueType;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
if (this.keyName !== null) {
|
|
14
|
+
return `${String(this.keyName)}${this.optional ? '?' : ''}: ${String(this.valueType)}`;
|
|
15
|
+
}
|
|
16
|
+
return String(this.valueType);
|
|
17
|
+
}
|
|
18
|
+
getNodeType() {
|
|
19
|
+
return 'ArrayShapeItemNode';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ArrayShapeItemNode = ArrayShapeItemNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ArrayShapeItemNode } from './array-shape-item-node';
|
|
2
|
+
import { TypeNode } from './type-node';
|
|
3
|
+
export declare enum ArrayShapeNodeKind {
|
|
4
|
+
ARRAY = "array",
|
|
5
|
+
LIST = "list"
|
|
6
|
+
}
|
|
7
|
+
export declare class ArrayShapeNode extends TypeNode {
|
|
8
|
+
items: (ArrayShapeItemNode | string)[];
|
|
9
|
+
sealed: boolean;
|
|
10
|
+
kind: ArrayShapeNodeKind;
|
|
11
|
+
constructor(items: (ArrayShapeItemNode | string)[], sealed?: boolean, kind?: ArrayShapeNodeKind);
|
|
12
|
+
toString(): string;
|
|
13
|
+
getNodeType(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayShapeNode = exports.ArrayShapeNodeKind = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
var ArrayShapeNodeKind;
|
|
6
|
+
(function (ArrayShapeNodeKind) {
|
|
7
|
+
ArrayShapeNodeKind["ARRAY"] = "array";
|
|
8
|
+
ArrayShapeNodeKind["LIST"] = "list";
|
|
9
|
+
})(ArrayShapeNodeKind || (exports.ArrayShapeNodeKind = ArrayShapeNodeKind = {}));
|
|
10
|
+
class ArrayShapeNode extends type_node_1.TypeNode {
|
|
11
|
+
constructor(items, sealed = true, kind = ArrayShapeNodeKind.ARRAY) {
|
|
12
|
+
super();
|
|
13
|
+
this.items = items;
|
|
14
|
+
this.sealed = sealed;
|
|
15
|
+
this.kind = kind;
|
|
16
|
+
this.items = items;
|
|
17
|
+
this.sealed = sealed;
|
|
18
|
+
this.kind = kind;
|
|
19
|
+
}
|
|
20
|
+
toString() {
|
|
21
|
+
const { items } = this;
|
|
22
|
+
if (!this.sealed) {
|
|
23
|
+
items.push('...');
|
|
24
|
+
}
|
|
25
|
+
return `${this.kind}{${items.join(', ')}}`;
|
|
26
|
+
}
|
|
27
|
+
getNodeType() {
|
|
28
|
+
return 'ArrayShapeNode';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ArrayShapeNode = ArrayShapeNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayTypeNode = void 0;
|
|
4
|
+
const callable_type_node_1 = require("./callable-type-node");
|
|
5
|
+
const const_type_node_1 = require("./const-type-node");
|
|
6
|
+
const nullable_type_node_1 = require("./nullable-type-node");
|
|
7
|
+
const type_node_1 = require("./type-node");
|
|
8
|
+
class ArrayTypeNode extends type_node_1.TypeNode {
|
|
9
|
+
constructor(type) {
|
|
10
|
+
super();
|
|
11
|
+
this.type = type;
|
|
12
|
+
}
|
|
13
|
+
toString() {
|
|
14
|
+
if (this.type instanceof callable_type_node_1.CallableTypeNode ||
|
|
15
|
+
this.type instanceof const_type_node_1.ConstTypeNode ||
|
|
16
|
+
this.type instanceof nullable_type_node_1.NullableTypeNode) {
|
|
17
|
+
return `(${this.type.toString()})[]`;
|
|
18
|
+
}
|
|
19
|
+
return `${this.type.toString()}[]`;
|
|
20
|
+
}
|
|
21
|
+
getNodeType() {
|
|
22
|
+
return 'ArrayTypeNode';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.ArrayTypeNode = ArrayTypeNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CallableTypeParameterNode } from './callable-type-parameter-node';
|
|
2
|
+
import { IdentifierTypeNode } from './identifier-type-node';
|
|
3
|
+
import { TypeNode } from './type-node';
|
|
4
|
+
export declare class CallableTypeNode extends TypeNode {
|
|
5
|
+
identifier: IdentifierTypeNode;
|
|
6
|
+
parameters: CallableTypeParameterNode[];
|
|
7
|
+
returnType: TypeNode;
|
|
8
|
+
constructor(identifier: IdentifierTypeNode, parameters: CallableTypeParameterNode[], returnType: TypeNode);
|
|
9
|
+
toString(): string;
|
|
10
|
+
getNodeType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CallableTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class CallableTypeNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(identifier, parameters, returnType) {
|
|
7
|
+
super();
|
|
8
|
+
this.identifier = identifier;
|
|
9
|
+
this.parameters = parameters;
|
|
10
|
+
this.returnType = returnType;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
let { returnType } = this;
|
|
14
|
+
if (returnType instanceof CallableTypeNode) {
|
|
15
|
+
returnType = `(${returnType.toString()})`;
|
|
16
|
+
}
|
|
17
|
+
const parameters = this.parameters.join(', ');
|
|
18
|
+
return `${this.identifier.toString()}(${parameters}): ${returnType.toString()}`;
|
|
19
|
+
}
|
|
20
|
+
getNodeType() {
|
|
21
|
+
return 'CallableTypeNode';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.CallableTypeNode = CallableTypeNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeNode } from './type-node';
|
|
2
|
+
export declare class CallableTypeParameterNode extends TypeNode {
|
|
3
|
+
type: TypeNode;
|
|
4
|
+
isReference: boolean;
|
|
5
|
+
isVariadic: boolean;
|
|
6
|
+
parameterName: string;
|
|
7
|
+
isOptional: boolean;
|
|
8
|
+
constructor(type: TypeNode, isReference: boolean, isVariadic: boolean, parameterName: string, isOptional: boolean);
|
|
9
|
+
toString(): string;
|
|
10
|
+
getNodeType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CallableTypeParameterNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class CallableTypeParameterNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(type, isReference, isVariadic, parameterName, isOptional) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.isReference = isReference;
|
|
10
|
+
this.isVariadic = isVariadic;
|
|
11
|
+
this.parameterName = parameterName;
|
|
12
|
+
this.isOptional = isOptional;
|
|
13
|
+
}
|
|
14
|
+
toString() {
|
|
15
|
+
const type = `${this.type.toString()} `;
|
|
16
|
+
const isReference = this.isReference ? '&' : '';
|
|
17
|
+
const isVariadic = this.isVariadic ? '...' : '';
|
|
18
|
+
const isOptional = this.isOptional ? '=' : '';
|
|
19
|
+
return (`${type}${isReference}${isVariadic}${this.parameterName}`.trim() +
|
|
20
|
+
isOptional);
|
|
21
|
+
}
|
|
22
|
+
getNodeType() {
|
|
23
|
+
return 'CallableTypeParameterNode';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.CallableTypeParameterNode = CallableTypeParameterNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeNode } from './type-node';
|
|
2
|
+
export declare class ConditionalTypeForParameterNode extends TypeNode {
|
|
3
|
+
parameterName: string;
|
|
4
|
+
targetType: TypeNode;
|
|
5
|
+
ifCondition: TypeNode;
|
|
6
|
+
elseCondition: TypeNode;
|
|
7
|
+
negated: boolean;
|
|
8
|
+
constructor(parameterName: string, targetType: TypeNode, ifCondition: TypeNode, elseCondition: TypeNode, negated: boolean);
|
|
9
|
+
toString(): string;
|
|
10
|
+
getNodeType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionalTypeForParameterNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class ConditionalTypeForParameterNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(parameterName, targetType, ifCondition, elseCondition, negated) {
|
|
7
|
+
super();
|
|
8
|
+
this.parameterName = parameterName;
|
|
9
|
+
this.targetType = targetType;
|
|
10
|
+
this.ifCondition = ifCondition;
|
|
11
|
+
this.elseCondition = elseCondition;
|
|
12
|
+
this.negated = negated;
|
|
13
|
+
}
|
|
14
|
+
toString() {
|
|
15
|
+
return `(${this.parameterName} ${this.negated ? 'is not' : 'is'} ${this.targetType.toString()} ? ${this.ifCondition.toString()} : ${this.elseCondition.toString()})`;
|
|
16
|
+
}
|
|
17
|
+
getNodeType() {
|
|
18
|
+
return 'ConditionalTypeForParameterNode';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ConditionalTypeForParameterNode = ConditionalTypeForParameterNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeNode } from './type-node';
|
|
2
|
+
export declare class ConditionalTypeNode extends TypeNode {
|
|
3
|
+
subjectType: TypeNode;
|
|
4
|
+
targetType: TypeNode;
|
|
5
|
+
ifType: TypeNode;
|
|
6
|
+
elseType: TypeNode;
|
|
7
|
+
negated: boolean;
|
|
8
|
+
constructor(subjectType: TypeNode, targetType: TypeNode, ifType: TypeNode, elseType: TypeNode, negated: boolean);
|
|
9
|
+
toString(): string;
|
|
10
|
+
getNodeType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConditionalTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class ConditionalTypeNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(subjectType, targetType, ifType, elseType, negated) {
|
|
7
|
+
super();
|
|
8
|
+
this.subjectType = subjectType;
|
|
9
|
+
this.targetType = targetType;
|
|
10
|
+
this.ifType = ifType;
|
|
11
|
+
this.elseType = elseType;
|
|
12
|
+
this.negated = negated;
|
|
13
|
+
}
|
|
14
|
+
toString() {
|
|
15
|
+
return `(${this.subjectType.toString()} ${this.negated ? 'is not' : 'is'} ${this.targetType.toString()} ? ${this.ifType.toString()} : ${this.elseType.toString()})`;
|
|
16
|
+
}
|
|
17
|
+
getNodeType() {
|
|
18
|
+
return 'ConditionalTypeNode';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ConditionalTypeNode = ConditionalTypeNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TypeNode } from './type-node';
|
|
2
|
+
import { ConstExprNode } from '../const-expr/const-expr-node';
|
|
3
|
+
export declare class ConstTypeNode extends TypeNode {
|
|
4
|
+
constExpr: ConstExprNode;
|
|
5
|
+
constructor(constExpr: ConstExprNode);
|
|
6
|
+
toString(): string;
|
|
7
|
+
getNodeType(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConstTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class ConstTypeNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(constExpr) {
|
|
7
|
+
super();
|
|
8
|
+
this.constExpr = constExpr;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return this.constExpr.toString();
|
|
12
|
+
}
|
|
13
|
+
getNodeType() {
|
|
14
|
+
return 'ConstTypeNode';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ConstTypeNode = ConstTypeNode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IdentifierTypeNode } from './identifier-type-node';
|
|
2
|
+
import { TypeNode } from './type-node';
|
|
3
|
+
export type GenericTypeNodeVariance = 'invariant' | 'covariant' | 'contravariant' | 'bivariant';
|
|
4
|
+
export declare class GenericTypeNode extends TypeNode {
|
|
5
|
+
type: IdentifierTypeNode;
|
|
6
|
+
genericTypes: TypeNode[];
|
|
7
|
+
variances: string[];
|
|
8
|
+
static readonly VARIANCE_INVARIANT: "invariant";
|
|
9
|
+
static readonly VARIANCE_COVARIANT: "covariant";
|
|
10
|
+
static readonly VARIANCE_CONTRAVARIANT: "contravariant";
|
|
11
|
+
static readonly VARIANCE_BIVARIANT: "bivariant";
|
|
12
|
+
constructor(type: IdentifierTypeNode, genericTypes: TypeNode[], variances?: string[]);
|
|
13
|
+
toString(): string;
|
|
14
|
+
getNodeType(): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenericTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class GenericTypeNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(type, genericTypes, variances = []) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.genericTypes = genericTypes;
|
|
10
|
+
this.variances = variances;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
const genericTypes = [];
|
|
14
|
+
for (const index in this.genericTypes) {
|
|
15
|
+
const type = this.genericTypes[index];
|
|
16
|
+
const variance = this.variances[index] || GenericTypeNode.VARIANCE_INVARIANT;
|
|
17
|
+
if (variance === GenericTypeNode.VARIANCE_INVARIANT) {
|
|
18
|
+
genericTypes.push(type.toString());
|
|
19
|
+
}
|
|
20
|
+
else if (variance === GenericTypeNode.VARIANCE_BIVARIANT) {
|
|
21
|
+
genericTypes.push('*');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
genericTypes.push(`${variance} ${type.toString()}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return `${this.type.toString()}<${genericTypes.join(', ')}>`;
|
|
28
|
+
}
|
|
29
|
+
getNodeType() {
|
|
30
|
+
return 'GenericTypeNode';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.GenericTypeNode = GenericTypeNode;
|
|
34
|
+
GenericTypeNode.VARIANCE_INVARIANT = 'invariant';
|
|
35
|
+
GenericTypeNode.VARIANCE_COVARIANT = 'covariant';
|
|
36
|
+
GenericTypeNode.VARIANCE_CONTRAVARIANT = 'contravariant';
|
|
37
|
+
GenericTypeNode.VARIANCE_BIVARIANT = 'bivariant';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdentifierTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class IdentifierTypeNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(name) {
|
|
7
|
+
super();
|
|
8
|
+
this.name = name;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return this.name;
|
|
12
|
+
}
|
|
13
|
+
getNodeType() {
|
|
14
|
+
return 'IdentifierTypeNode';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.IdentifierTypeNode = IdentifierTypeNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntersectionTypeNode = void 0;
|
|
4
|
+
const nullable_type_node_1 = require("./nullable-type-node");
|
|
5
|
+
const type_node_1 = require("./type-node");
|
|
6
|
+
class IntersectionTypeNode extends type_node_1.TypeNode {
|
|
7
|
+
constructor(types) {
|
|
8
|
+
super();
|
|
9
|
+
this.types = types;
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `(${this.types
|
|
13
|
+
.map((type) => {
|
|
14
|
+
if (type instanceof nullable_type_node_1.NullableTypeNode) {
|
|
15
|
+
return `(${type.toString()})`;
|
|
16
|
+
}
|
|
17
|
+
return type.toString();
|
|
18
|
+
})
|
|
19
|
+
.join(' & ')})`;
|
|
20
|
+
}
|
|
21
|
+
getNodeType() {
|
|
22
|
+
return 'IntersectionTypeNode';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.IntersectionTypeNode = IntersectionTypeNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TypeNode } from './type-node';
|
|
2
|
+
import { ParserException } from '../../parser/parser-exception';
|
|
3
|
+
export declare class InvalidTypeNode extends TypeNode {
|
|
4
|
+
exception: ParserException;
|
|
5
|
+
exceptionArgs: ConstructorParameters<typeof ParserException>;
|
|
6
|
+
constructor(exception: ParserException);
|
|
7
|
+
getException(): ParserException;
|
|
8
|
+
toString(): string;
|
|
9
|
+
getNodeType(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvalidTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
const parser_exception_1 = require("../../parser/parser-exception");
|
|
6
|
+
class InvalidTypeNode extends type_node_1.TypeNode {
|
|
7
|
+
constructor(exception) {
|
|
8
|
+
super();
|
|
9
|
+
this.exception = exception;
|
|
10
|
+
this.exceptionArgs = [
|
|
11
|
+
exception.getCurrentTokenValue(),
|
|
12
|
+
exception.getCurrentTokenType(),
|
|
13
|
+
exception.getCurrentOffset(),
|
|
14
|
+
exception.getExpectedTokenType(),
|
|
15
|
+
exception.getExpectedTokenValue(),
|
|
16
|
+
exception.getCurrentTokenLine(),
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
getException() {
|
|
20
|
+
return new parser_exception_1.ParserException(...this.exceptionArgs);
|
|
21
|
+
}
|
|
22
|
+
toString() {
|
|
23
|
+
return '*Invalid type*';
|
|
24
|
+
}
|
|
25
|
+
getNodeType() {
|
|
26
|
+
return 'InvalidTypeNode';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.InvalidTypeNode = InvalidTypeNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NullableTypeNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class NullableTypeNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(type) {
|
|
7
|
+
super();
|
|
8
|
+
this.type = type;
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return `?${this.type.toString()}`;
|
|
12
|
+
}
|
|
13
|
+
getNodeType() {
|
|
14
|
+
return 'NullableTypeNode';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.NullableTypeNode = NullableTypeNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IdentifierTypeNode } from './identifier-type-node';
|
|
2
|
+
import { TypeNode } from './type-node';
|
|
3
|
+
import { ConstExprStringNode } from '../const-expr/const-expr-string-node';
|
|
4
|
+
export declare class ObjectShapeItemNode extends TypeNode {
|
|
5
|
+
keyName: ConstExprStringNode | IdentifierTypeNode;
|
|
6
|
+
optional: boolean;
|
|
7
|
+
valueType: TypeNode;
|
|
8
|
+
constructor(keyName: ConstExprStringNode | IdentifierTypeNode, optional: boolean, valueType: TypeNode);
|
|
9
|
+
toString(): string;
|
|
10
|
+
getNodeType(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectShapeItemNode = void 0;
|
|
4
|
+
const type_node_1 = require("./type-node");
|
|
5
|
+
class ObjectShapeItemNode extends type_node_1.TypeNode {
|
|
6
|
+
constructor(keyName, optional, valueType) {
|
|
7
|
+
super();
|
|
8
|
+
this.keyName = keyName;
|
|
9
|
+
this.optional = optional;
|
|
10
|
+
this.valueType = valueType;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
if (this.keyName !== null) {
|
|
14
|
+
return `${this.keyName.toString()}${this.optional ? '?' : ''}: ${this.valueType.toString()}`;
|
|
15
|
+
}
|
|
16
|
+
return this.valueType.toString();
|
|
17
|
+
}
|
|
18
|
+
getNodeType() {
|
|
19
|
+
return 'ObjectShapeItemNode';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ObjectShapeItemNode = ObjectShapeItemNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ObjectShapeItemNode } from './object-shape-item-node';
|
|
2
|
+
import { TypeNode } from './type-node';
|
|
3
|
+
export declare class ObjectShapeNode extends TypeNode {
|
|
4
|
+
items: ObjectShapeItemNode[];
|
|
5
|
+
constructor(items: ObjectShapeItemNode[]);
|
|
6
|
+
toString(): string;
|
|
7
|
+
getNodeType(): string;
|
|
8
|
+
}
|