@fncts/schema 0.0.23 → 0.0.25
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/AST.d.ts +60 -29
- package/ASTAnnotationMap.d.ts +4 -1
- package/LICENSE +26 -0
- package/ParseError/ParseError.d.ts +28 -13
- package/_cjs/AST.cjs +1096 -1087
- package/_cjs/AST.cjs.map +1 -1
- package/_cjs/ASTAnnotation.cjs +114 -83
- package/_cjs/ASTAnnotation.cjs.map +1 -1
- package/_cjs/ASTAnnotationMap.cjs +43 -32
- package/_cjs/ASTAnnotationMap.cjs.map +1 -1
- package/_cjs/Eq.cjs +113 -145
- package/_cjs/Eq.cjs.map +1 -1
- package/_cjs/Gen.cjs +131 -167
- package/_cjs/Gen.cjs.map +1 -1
- package/_cjs/Guard.cjs +167 -267
- package/_cjs/Guard.cjs.map +1 -1
- package/_cjs/InvalidInterpretationError.cjs +9 -15
- package/_cjs/InvalidInterpretationError.cjs.map +1 -1
- package/_cjs/ParseError/ParseError.cjs +285 -209
- package/_cjs/ParseError/ParseError.cjs.map +1 -1
- package/_cjs/ParseError/ParseErrorFormatter.cjs +0 -2
- package/_cjs/ParseError/PathFormatter.cjs +55 -87
- package/_cjs/ParseError/PathFormatter.cjs.map +1 -1
- package/_cjs/ParseError/TreeFormatter.cjs +70 -102
- package/_cjs/ParseError/TreeFormatter.cjs.map +1 -1
- package/_cjs/ParseError.cjs +35 -50
- package/_cjs/ParseResult.cjs +15 -15
- package/_cjs/ParseResult.cjs.map +1 -1
- package/_cjs/Parser/api.cjs +54 -50
- package/_cjs/Parser/api.cjs.map +1 -1
- package/_cjs/Parser/definition.cjs +17 -16
- package/_cjs/Parser/definition.cjs.map +1 -1
- package/_cjs/Parser/interpreter.cjs +276 -358
- package/_cjs/Parser/interpreter.cjs.map +1 -1
- package/_cjs/Parser.cjs +12 -39
- package/_cjs/Schema/api/conc.cjs +64 -59
- package/_cjs/Schema/api/conc.cjs.map +1 -1
- package/_cjs/Schema/api/either.cjs +73 -72
- package/_cjs/Schema/api/either.cjs.map +1 -1
- package/_cjs/Schema/api/hashMap.cjs +85 -85
- package/_cjs/Schema/api/hashMap.cjs.map +1 -1
- package/_cjs/Schema/api/hashSet.cjs +75 -69
- package/_cjs/Schema/api/hashSet.cjs.map +1 -1
- package/_cjs/Schema/api/list.cjs +74 -64
- package/_cjs/Schema/api/list.cjs.map +1 -1
- package/_cjs/Schema/api/map.cjs +81 -83
- package/_cjs/Schema/api/map.cjs.map +1 -1
- package/_cjs/Schema/api/maybe.cjs +56 -49
- package/_cjs/Schema/api/maybe.cjs.map +1 -1
- package/_cjs/Schema/api/set.cjs +68 -61
- package/_cjs/Schema/api/set.cjs.map +1 -1
- package/_cjs/Schema/api.cjs +332 -350
- package/_cjs/Schema/api.cjs.map +1 -1
- package/_cjs/Schema/definition.cjs +28 -27
- package/_cjs/Schema/definition.cjs.map +1 -1
- package/_cjs/Schema/derivations.cjs +85 -100
- package/_cjs/Schema/derivations.cjs.map +1 -1
- package/_cjs/Schema.cjs +95 -127
- package/_cjs/Show.cjs +91 -151
- package/_cjs/Show.cjs.map +1 -1
- package/_cjs/chunk.cjs +28 -0
- package/_cjs/global.cjs +0 -2
- package/_cjs/index.cjs +0 -2
- package/_cjs/utils.cjs +41 -46
- package/_cjs/utils.cjs.map +1 -1
- package/_mjs/AST.mjs +1007 -1031
- package/_mjs/AST.mjs.map +1 -1
- package/_mjs/ASTAnnotation.mjs +77 -71
- package/_mjs/ASTAnnotation.mjs.map +1 -1
- package/_mjs/ASTAnnotationMap.mjs +36 -25
- package/_mjs/ASTAnnotationMap.mjs.map +1 -1
- package/_mjs/Eq.mjs +101 -134
- package/_mjs/Eq.mjs.map +1 -1
- package/_mjs/Gen.mjs +117 -157
- package/_mjs/Gen.mjs.map +1 -1
- package/_mjs/Guard.mjs +154 -257
- package/_mjs/Guard.mjs.map +1 -1
- package/_mjs/InvalidInterpretationError.mjs +8 -9
- package/_mjs/InvalidInterpretationError.mjs.map +1 -1
- package/_mjs/ParseError/ParseError.mjs +270 -190
- package/_mjs/ParseError/ParseError.mjs.map +1 -1
- package/_mjs/ParseError/ParseErrorFormatter.mjs +0 -2
- package/_mjs/ParseError/PathFormatter.mjs +51 -80
- package/_mjs/ParseError/PathFormatter.mjs.map +1 -1
- package/_mjs/ParseError/TreeFormatter.mjs +62 -94
- package/_mjs/ParseError/TreeFormatter.mjs.map +1 -1
- package/_mjs/ParseError.mjs +5 -6
- package/_mjs/ParseResult.mjs +13 -9
- package/_mjs/ParseResult.mjs.map +1 -1
- package/_mjs/Parser/api.mjs +43 -39
- package/_mjs/Parser/api.mjs.map +1 -1
- package/_mjs/Parser/definition.mjs +12 -8
- package/_mjs/Parser/definition.mjs.map +1 -1
- package/_mjs/Parser/interpreter.mjs +262 -348
- package/_mjs/Parser/interpreter.mjs.map +1 -1
- package/_mjs/Parser.mjs +4 -5
- package/_mjs/Schema/api/conc.mjs +41 -45
- package/_mjs/Schema/api/conc.mjs.map +1 -1
- package/_mjs/Schema/api/either.mjs +55 -61
- package/_mjs/Schema/api/either.mjs.map +1 -1
- package/_mjs/Schema/api/hashMap.mjs +61 -71
- package/_mjs/Schema/api/hashMap.mjs.map +1 -1
- package/_mjs/Schema/api/hashSet.mjs +53 -56
- package/_mjs/Schema/api/hashSet.mjs.map +1 -1
- package/_mjs/Schema/api/list.mjs +50 -51
- package/_mjs/Schema/api/list.mjs.map +1 -1
- package/_mjs/Schema/api/map.mjs +59 -69
- package/_mjs/Schema/api/map.mjs.map +1 -1
- package/_mjs/Schema/api/maybe.mjs +34 -36
- package/_mjs/Schema/api/maybe.mjs.map +1 -1
- package/_mjs/Schema/api/set.mjs +47 -48
- package/_mjs/Schema/api/set.mjs.map +1 -1
- package/_mjs/Schema/api.mjs +304 -346
- package/_mjs/Schema/api.mjs.map +1 -1
- package/_mjs/Schema/definition.mjs +21 -18
- package/_mjs/Schema/definition.mjs.map +1 -1
- package/_mjs/Schema/derivations.mjs +71 -90
- package/_mjs/Schema/derivations.mjs.map +1 -1
- package/_mjs/Schema.mjs +12 -15
- package/_mjs/Show.mjs +79 -139
- package/_mjs/Show.mjs.map +1 -1
- package/_mjs/global.mjs +0 -2
- package/_mjs/index.mjs +0 -2
- package/_mjs/utils.mjs +35 -37
- package/_mjs/utils.mjs.map +1 -1
- package/_src/AST.ts +226 -28
- package/_src/ASTAnnotationMap.ts +14 -1
- package/_src/ParseError/ParseError.ts +128 -13
- package/_src/Schema/api/hashMap.ts +1 -1
- package/_src/Schema/api/hashSet.ts +1 -1
- package/_src/Schema/api/list.ts +3 -1
- package/_src/Schema/api/map.ts +1 -1
- package/_src/Schema/api/set.ts +1 -1
- package/package.json +7 -3
- package/_cjs/ParseError/ParseErrorFormatter.cjs.map +0 -1
- package/_cjs/ParseError.cjs.map +0 -1
- package/_cjs/Parser.cjs.map +0 -1
- package/_cjs/Schema.cjs.map +0 -1
- package/_cjs/global.cjs.map +0 -1
- package/_cjs/index.cjs.map +0 -1
- package/_mjs/ParseError/ParseErrorFormatter.mjs.map +0 -1
- package/_mjs/ParseError.mjs.map +0 -1
- package/_mjs/Parser.mjs.map +0 -1
- package/_mjs/Schema.mjs.map +0 -1
- package/_mjs/global.mjs.map +0 -1
- package/_mjs/index.mjs.map +0 -1
package/_mjs/AST.mjs
CHANGED
|
@@ -1,1149 +1,1125 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as tsplus_module_1 from "@fncts/schema/Show";
|
|
4
|
-
import * as tsplus_module_2 from "@fncts/schema/ASTAnnotation";
|
|
5
|
-
import * as tsplus_module_3 from "@fncts/base/collection/immutable/Vector/api";
|
|
6
|
-
import * as tsplus_module_4 from "@fncts/base/data/Maybe/constructors";
|
|
7
|
-
import * as tsplus_module_5 from "@fncts/schema/ParseResult";
|
|
8
|
-
import * as tsplus_module_6 from "@fncts/schema/ParseError/ParseError";
|
|
9
|
-
import * as tsplus_module_7 from "@fncts/base/data/number/instances";
|
|
10
|
-
import * as tsplus_module_8 from "@fncts/base/data/Ord/api/contramap";
|
|
11
|
-
import * as tsplus_module_9 from "@fncts/base/data/Ord/api";
|
|
12
|
-
import * as tsplus_module_10 from "@fncts/base/data/Ord/api/max";
|
|
13
|
-
import * as tsplus_module_11 from "@fncts/base/collection/Iterable/api";
|
|
14
|
-
import * as tsplus_module_12 from "@fncts/base/data/Maybe/destructors";
|
|
15
|
-
import * as tsplus_module_13 from "@fncts/base/data/Maybe/definition";
|
|
16
|
-
import * as tsplus_module_14 from "@fncts/base/collection/immutable/Vector/internal";
|
|
17
|
-
import * as tsplus_module_15 from "@fncts/base/data/Maybe/api";
|
|
18
|
-
export const createLiteral = createLiteral_1;
|
|
19
|
-
export const isLiteral = isLiteral_1;
|
|
20
|
-
export const createUniqueSymbol = createUniqueSymbol_1;
|
|
21
|
-
export const isUniqueSymbol = isUniqueSymbol_1;
|
|
22
|
-
export const isStringKeyword = isStringKeyword_1;
|
|
23
|
-
export const isNumberKeyword = isNumberKeyword_1;
|
|
24
|
-
export const isSymbolKeyword = isSymbolKeyword_1;
|
|
25
|
-
export const createTemplateLiteral = createTemplateLiteral_1;
|
|
26
|
-
export const createElement = createElement_1;
|
|
27
|
-
export const createTuple = createTuple_1;
|
|
28
|
-
export const createPropertySignature = createPropertySignature_1;
|
|
29
|
-
export const createIndexSignature = createIndexSignature_1;
|
|
30
|
-
export const createTypeLiteral = createTypeLiteral_1;
|
|
31
|
-
export const createUnion = createUnion_1;
|
|
32
|
-
export const createLazy = createLazy_1;
|
|
33
|
-
export const createRefinement = createRefinement_1;
|
|
34
|
-
export const getPropertySignatures = getPropertySignatures_1;
|
|
35
|
-
export const keysOf = keysOf_1;
|
|
36
|
-
export const partial = partial_1;
|
|
37
|
-
export const getFrom = getFrom_1;
|
|
38
|
-
export const getTo = getTo_1;
|
|
1
|
+
import { ASTAnnotationMap } from "./ASTAnnotationMap.mjs";
|
|
2
|
+
import * as tsplus_module_6 from "@fncts/base/collection/immutable/Vector/api";
|
|
39
3
|
import { show } from "@fncts/base/data/Showable";
|
|
4
|
+
import * as tsplus_module_18 from "@fncts/base/data/Maybe/api";
|
|
5
|
+
import * as tsplus_module_7 from "@fncts/base/data/Maybe/constructors";
|
|
6
|
+
import * as tsplus_module_15 from "@fncts/base/data/Maybe/destructors";
|
|
40
7
|
import { memoize } from "@fncts/schema/utils";
|
|
41
|
-
import
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
8
|
+
import * as tsplus_module_4 from "@fncts/schema/ASTAnnotation";
|
|
9
|
+
import * as tsplus_module_8 from "@fncts/schema/ParseResult";
|
|
10
|
+
import * as tsplus_module_16 from "@fncts/base/data/Maybe/definition";
|
|
11
|
+
import * as tsplus_module_1 from "@fncts/base/data/Equatable/definition";
|
|
12
|
+
import * as tsplus_module_2 from "@fncts/schema/Show";
|
|
13
|
+
import * as tsplus_module_3 from "@fncts/base/util/predicates";
|
|
14
|
+
import * as tsplus_module_5 from "@fncts/base/collection/immutable/Vector/definition";
|
|
15
|
+
import * as tsplus_module_9 from "@fncts/schema/ParseError/ParseError";
|
|
16
|
+
import * as tsplus_module_10 from "@fncts/base/data/number/instances";
|
|
17
|
+
import * as tsplus_module_11 from "@fncts/base/data/Ord/api/contramap";
|
|
18
|
+
import * as tsplus_module_12 from "@fncts/base/data/Ord/api";
|
|
19
|
+
import * as tsplus_module_13 from "@fncts/base/data/Ord/api/max";
|
|
20
|
+
import * as tsplus_module_14 from "@fncts/base/collection/Iterable/api";
|
|
21
|
+
import * as tsplus_module_17 from "@fncts/base/collection/immutable/Vector/internal";
|
|
22
|
+
//#region build/esm/AST.js
|
|
23
|
+
const fileName_1 = "(@fncts/schema) src/AST.ts";
|
|
24
|
+
const createLiteral = createLiteral_1;
|
|
25
|
+
const isLiteral = isLiteral_1;
|
|
26
|
+
const createUniqueSymbol = createUniqueSymbol_1;
|
|
27
|
+
const isUniqueSymbol = isUniqueSymbol_1;
|
|
28
|
+
const isStringKeyword = isStringKeyword_1;
|
|
29
|
+
const isNumberKeyword = isNumberKeyword_1;
|
|
30
|
+
const isSymbolKeyword = isSymbolKeyword_1;
|
|
31
|
+
const createTemplateLiteral = createTemplateLiteral_1;
|
|
32
|
+
const createElement = createElement_1;
|
|
33
|
+
const createTuple = createTuple_1;
|
|
34
|
+
const createPropertySignature = createPropertySignature_1;
|
|
35
|
+
const createIndexSignature = createIndexSignature_1;
|
|
36
|
+
const createTypeLiteral = createTypeLiteral_1;
|
|
37
|
+
const createUnion = createUnion_1;
|
|
38
|
+
const createLazy = createLazy_1;
|
|
39
|
+
const createRefinement = createRefinement_1;
|
|
40
|
+
const getPropertySignatures = getPropertySignatures_1;
|
|
41
|
+
const keysOf = keysOf_1;
|
|
42
|
+
const partial = partial_1;
|
|
43
|
+
const getFrom = getFrom_1;
|
|
44
|
+
const getTo = getTo_1;
|
|
45
|
+
const ASTTypeId = Symbol.for("fncts.schema.AST");
|
|
46
|
+
var Annotated = class {
|
|
47
|
+
annotations = ASTAnnotationMap.empty;
|
|
48
|
+
};
|
|
48
49
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return tsplus_module_1.showAST(verbose)(this);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
_a = ASTTypeId;
|
|
50
|
+
* @tsplus type fncts.schema.AST
|
|
51
|
+
* @tsplus companion fncts.schema.ASTOps
|
|
52
|
+
*/
|
|
53
|
+
var AST = class extends Annotated {
|
|
54
|
+
[ASTTypeId] = ASTTypeId;
|
|
55
|
+
toString(verbose = false) {
|
|
56
|
+
return tsplus_module_2.showAST(verbose)(this);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
62
59
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
* @tsplus static fncts.schema.ASTOps concrete
|
|
61
|
+
* @tsplus macro remove
|
|
62
|
+
*/
|
|
63
|
+
function concrete(_) {}
|
|
64
|
+
function isAST(u) {
|
|
65
|
+
return tsplus_module_3.isObject(u) && ASTTypeId in u;
|
|
68
66
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return self.annotations.get(key);
|
|
72
|
-
};
|
|
67
|
+
function hasTag(u, tag) {
|
|
68
|
+
return isAST(u) && u._tag === tag;
|
|
73
69
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* @tsplus type fncts.schema.AST.Declaration
|
|
79
|
-
*/
|
|
80
|
-
export class Declaration extends AST {
|
|
81
|
-
constructor(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
|
|
82
|
-
super();
|
|
83
|
-
this.typeParameters = typeParameters;
|
|
84
|
-
this.decode = decode;
|
|
85
|
-
this.encode = encode;
|
|
86
|
-
this.annotations = annotations;
|
|
87
|
-
this._tag = 0 /* ASTTag.Declaration */;
|
|
88
|
-
}
|
|
89
|
-
clone(newProperties) {
|
|
90
|
-
return new Declaration(newProperties.typeParameters ?? this.typeParameters, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
|
|
91
|
-
}
|
|
70
|
+
function getAnnotations(key) {
|
|
71
|
+
return (self) => {
|
|
72
|
+
return self.annotations.get(key);
|
|
73
|
+
};
|
|
92
74
|
}
|
|
93
75
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
* @tsplus type fncts.schema.AST.Declaration
|
|
77
|
+
*/
|
|
78
|
+
var Declaration = class Declaration extends AST {
|
|
79
|
+
typeParameters;
|
|
80
|
+
decode;
|
|
81
|
+
encode;
|
|
82
|
+
annotations;
|
|
83
|
+
_tag = 0;
|
|
84
|
+
constructor(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
|
|
85
|
+
super();
|
|
86
|
+
this.typeParameters = typeParameters;
|
|
87
|
+
this.decode = decode;
|
|
88
|
+
this.encode = encode;
|
|
89
|
+
this.annotations = annotations;
|
|
90
|
+
}
|
|
91
|
+
clone(newProperties) {
|
|
92
|
+
return new Declaration(newProperties.typeParameters ?? this.typeParameters, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
|
|
93
|
+
}
|
|
94
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
95
|
+
return hasTag(that, 0) && context.comparator(this.typeParameters, that.typeParameters) && context.comparator(this.decode, that.decode) && context.comparator(this.encode, that.encode) && context.comparator(this.annotations, that.annotations);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
99
98
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return self._tag === 0 /* ASTTag.Declaration */;
|
|
105
|
-
}
|
|
106
|
-
export class Literal extends AST {
|
|
107
|
-
constructor(literal, annotations = ASTAnnotationMap.empty) {
|
|
108
|
-
super();
|
|
109
|
-
this.literal = literal;
|
|
110
|
-
this.annotations = annotations;
|
|
111
|
-
this._tag = 1 /* ASTTag.Literal */;
|
|
112
|
-
}
|
|
113
|
-
clone(newProperties) {
|
|
114
|
-
return new Literal(newProperties.literal ?? this.literal, newProperties.annotations ?? this.annotations);
|
|
115
|
-
}
|
|
99
|
+
* @tsplus static fncts.schema.ASTOps createDeclaration
|
|
100
|
+
*/
|
|
101
|
+
function createDeclaration(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
|
|
102
|
+
return new Declaration(typeParameters, decode, encode, annotations);
|
|
116
103
|
}
|
|
117
104
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
105
|
+
* @tsplus fluent fncts.schema.AST isDeclaration
|
|
106
|
+
*/
|
|
107
|
+
function isDeclaration(self) {
|
|
108
|
+
return self._tag === 0;
|
|
109
|
+
}
|
|
110
|
+
var Literal = class Literal extends AST {
|
|
111
|
+
literal;
|
|
112
|
+
annotations;
|
|
113
|
+
_tag = 1;
|
|
114
|
+
constructor(literal, annotations = ASTAnnotationMap.empty) {
|
|
115
|
+
super();
|
|
116
|
+
this.literal = literal;
|
|
117
|
+
this.annotations = annotations;
|
|
118
|
+
}
|
|
119
|
+
clone(newProperties) {
|
|
120
|
+
return new Literal(newProperties.literal ?? this.literal, newProperties.annotations ?? this.annotations);
|
|
121
|
+
}
|
|
122
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
123
|
+
return hasTag(that, 1) && context.comparator(this.literal, that.literal) && context.comparator(this.annotations, that.annotations);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* @tsplus static fncts.schema.ASTOps createLiteral
|
|
128
|
+
*/
|
|
120
129
|
function createLiteral_1(literal, annotations = ASTAnnotationMap.empty) {
|
|
121
|
-
|
|
130
|
+
return new Literal(literal, annotations);
|
|
122
131
|
}
|
|
123
132
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
* @tsplus fluent fncts.schema.AST isLiteral
|
|
134
|
+
*/
|
|
126
135
|
function isLiteral_1(self) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
136
|
+
return self._tag === 1;
|
|
137
|
+
}
|
|
138
|
+
var UniqueSymbol = class UniqueSymbol extends AST {
|
|
139
|
+
symbol;
|
|
140
|
+
annotations;
|
|
141
|
+
_tag = 2;
|
|
142
|
+
constructor(symbol, annotations = ASTAnnotationMap.empty) {
|
|
143
|
+
super();
|
|
144
|
+
this.symbol = symbol;
|
|
145
|
+
this.annotations = annotations;
|
|
146
|
+
}
|
|
147
|
+
clone(newProperties) {
|
|
148
|
+
return new UniqueSymbol(newProperties.symbol ?? this.symbol, newProperties.annotations ?? this.annotations);
|
|
149
|
+
}
|
|
150
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
151
|
+
return hasTag(that, 2) && context.comparator(this.symbol, that.symbol) && context.comparator(this.annotations, that.annotations);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
144
154
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
155
|
+
* @tsplus static fncts.schema.ASTOps createUniqueSymbol
|
|
156
|
+
*/
|
|
147
157
|
function createUniqueSymbol_1(symbol, annotations = ASTAnnotationMap.empty) {
|
|
148
|
-
|
|
158
|
+
return new UniqueSymbol(symbol, annotations);
|
|
149
159
|
}
|
|
150
160
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
161
|
+
* @tsplus fluent fncts.schema.AST isUniqueSymbol
|
|
162
|
+
*/
|
|
153
163
|
function isUniqueSymbol_1(self) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
164
|
+
return self._tag === 2;
|
|
165
|
+
}
|
|
166
|
+
var UndefinedKeyword = class UndefinedKeyword extends AST {
|
|
167
|
+
annotations;
|
|
168
|
+
_tag = 3;
|
|
169
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
170
|
+
super();
|
|
171
|
+
this.annotations = annotations;
|
|
172
|
+
}
|
|
173
|
+
clone(newProperties) {
|
|
174
|
+
return new UndefinedKeyword(newProperties.annotations ?? this.annotations);
|
|
175
|
+
}
|
|
176
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
177
|
+
return hasTag(that, 3) && context.comparator(this.annotations, that.annotations);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
170
180
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const undefinedKeyword_1 =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
181
|
+
* @tsplus static fncts.schema.ASTOps undefinedKeyword
|
|
182
|
+
*/
|
|
183
|
+
const undefinedKeyword_1 = new UndefinedKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "undefined"));
|
|
184
|
+
const undefinedKeyword = undefinedKeyword_1;
|
|
185
|
+
var VoidKeyword = class VoidKeyword extends AST {
|
|
186
|
+
annotations;
|
|
187
|
+
_tag = 4;
|
|
188
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
189
|
+
super();
|
|
190
|
+
this.annotations = annotations;
|
|
191
|
+
}
|
|
192
|
+
clone(newProperties) {
|
|
193
|
+
return new VoidKeyword(newProperties.annotations ?? this.annotations);
|
|
194
|
+
}
|
|
195
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
196
|
+
return hasTag(that, 4) && context.comparator(this.annotations, that.annotations);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
188
199
|
/**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
200
|
+
* @tsplus static fncts.schema.ASTOps voidKeyword
|
|
201
|
+
*/
|
|
202
|
+
const voidKeyword = new VoidKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "void"));
|
|
203
|
+
var NeverKeyword = class NeverKeyword extends AST {
|
|
204
|
+
annotations;
|
|
205
|
+
_tag = 5;
|
|
206
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
207
|
+
super();
|
|
208
|
+
this.annotations = annotations;
|
|
209
|
+
}
|
|
210
|
+
clone(newProperties) {
|
|
211
|
+
return new NeverKeyword(newProperties.annotations ?? this.annotations);
|
|
212
|
+
}
|
|
213
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
214
|
+
return hasTag(that, 5) && context.comparator(this.annotations, that.annotations);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
205
217
|
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const neverKeyword_1 =
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
218
|
+
* @tsplus static fncts.schema.ASTOps neverKeyword
|
|
219
|
+
*/
|
|
220
|
+
const neverKeyword_1 = new NeverKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "never"));
|
|
221
|
+
const neverKeyword = neverKeyword_1;
|
|
222
|
+
var UnknownKeyword = class UnknownKeyword extends AST {
|
|
223
|
+
annotations;
|
|
224
|
+
_tag = 6;
|
|
225
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
226
|
+
super();
|
|
227
|
+
this.annotations = annotations;
|
|
228
|
+
}
|
|
229
|
+
clone(newProperties) {
|
|
230
|
+
return new UnknownKeyword(newProperties.annotations ?? this.annotations);
|
|
231
|
+
}
|
|
232
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
233
|
+
return hasTag(that, 6) && context.comparator(this.annotations, that.annotations);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
223
236
|
/**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
const unknownKeyword_1 =
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
237
|
+
* @tsplus static fncts.schema.ASTOps unknownKeyword
|
|
238
|
+
*/
|
|
239
|
+
const unknownKeyword_1 = new UnknownKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "unknown"));
|
|
240
|
+
const unknownKeyword = unknownKeyword_1;
|
|
241
|
+
var AnyKeyword = class AnyKeyword extends AST {
|
|
242
|
+
annotations;
|
|
243
|
+
_tag = 7;
|
|
244
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
245
|
+
super();
|
|
246
|
+
this.annotations = annotations;
|
|
247
|
+
}
|
|
248
|
+
clone(newProperties) {
|
|
249
|
+
return new AnyKeyword(newProperties.annotations ?? this.annotations);
|
|
250
|
+
}
|
|
251
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
252
|
+
return hasTag(that, 7) && context.comparator(this.annotations, that.annotations);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
241
255
|
/**
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
256
|
+
* @tsplus static fncts.schema.ASTOps anyKeyword
|
|
257
|
+
*/
|
|
258
|
+
const anyKeyword = new AnyKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "any"));
|
|
259
|
+
var StringKeyword = class StringKeyword extends AST {
|
|
260
|
+
annotations;
|
|
261
|
+
_tag = 8;
|
|
262
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
263
|
+
super();
|
|
264
|
+
this.annotations = annotations;
|
|
265
|
+
}
|
|
266
|
+
clone(newProperties) {
|
|
267
|
+
return new StringKeyword(newProperties.annotations ?? this.annotations);
|
|
268
|
+
}
|
|
269
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
270
|
+
return hasTag(that, 8) && context.comparator(this.annotations, that.annotations);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
258
273
|
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const stringKeyword_1 =
|
|
262
|
-
|
|
274
|
+
* @tsplus static fncts.schema.ASTOps stringKeyword
|
|
275
|
+
*/
|
|
276
|
+
const stringKeyword_1 = new StringKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "string"));
|
|
277
|
+
const stringKeyword = stringKeyword_1;
|
|
263
278
|
/**
|
|
264
|
-
|
|
265
|
-
|
|
279
|
+
* @tsplus fluent fncts.schema.AST isStringKeyword
|
|
280
|
+
*/
|
|
266
281
|
function isStringKeyword_1(self) {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
282
|
+
return self._tag === 8;
|
|
283
|
+
}
|
|
284
|
+
var NumberKeyword = class NumberKeyword extends AST {
|
|
285
|
+
annotations;
|
|
286
|
+
_tag = 9;
|
|
287
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
288
|
+
super();
|
|
289
|
+
this.annotations = annotations;
|
|
290
|
+
}
|
|
291
|
+
clone(newProperties) {
|
|
292
|
+
return new NumberKeyword(newProperties.annotations ?? this.annotations);
|
|
293
|
+
}
|
|
294
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
295
|
+
return hasTag(that, 9) && context.comparator(this.annotations, that.annotations);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
283
298
|
/**
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
const numberKeyword_1 =
|
|
287
|
-
|
|
299
|
+
* @tsplus static fncts.schema.ASTOps numberKeyword
|
|
300
|
+
*/
|
|
301
|
+
const numberKeyword_1 = new NumberKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "number"));
|
|
302
|
+
const numberKeyword = numberKeyword_1;
|
|
288
303
|
/**
|
|
289
|
-
|
|
290
|
-
|
|
304
|
+
* @tsplus fluent fncts.schema.AST isNumberKeyword
|
|
305
|
+
*/
|
|
291
306
|
function isNumberKeyword_1(self) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
307
|
+
return self._tag === 9;
|
|
308
|
+
}
|
|
309
|
+
var BooleanKeyword = class BooleanKeyword extends AST {
|
|
310
|
+
annotations;
|
|
311
|
+
_tag = 10;
|
|
312
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
313
|
+
super();
|
|
314
|
+
this.annotations = annotations;
|
|
315
|
+
}
|
|
316
|
+
clone(newProperties) {
|
|
317
|
+
return new BooleanKeyword(newProperties.annotations ?? this.annotations);
|
|
318
|
+
}
|
|
319
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
320
|
+
return hasTag(that, 10) && context.comparator(this.annotations, that.annotations);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
308
323
|
/**
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
324
|
+
* @tsplus static fncts.schema.ASTOps booleanKeyword
|
|
325
|
+
*/
|
|
326
|
+
const booleanKeyword = new BooleanKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "boolean"));
|
|
312
327
|
/**
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
328
|
+
* @tsplus fluent fncts.schema.AST isBooleanKeyword
|
|
329
|
+
*/
|
|
330
|
+
function isBooleanKeyword(self) {
|
|
331
|
+
return self._tag === 10;
|
|
332
|
+
}
|
|
333
|
+
var BigIntKeyword = class BigIntKeyword extends AST {
|
|
334
|
+
annotations;
|
|
335
|
+
_tag = 11;
|
|
336
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
337
|
+
super();
|
|
338
|
+
this.annotations = annotations;
|
|
339
|
+
}
|
|
340
|
+
clone(newProperties) {
|
|
341
|
+
return new BigIntKeyword(newProperties.annotations ?? this.annotations);
|
|
342
|
+
}
|
|
343
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
344
|
+
return hasTag(that, 11) && context.comparator(this.annotations, that.annotations);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
332
347
|
/**
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
348
|
+
* @tsplus static fncts.schema.ASTOps bigIntKeyword
|
|
349
|
+
*/
|
|
350
|
+
const bigIntKeyword = new BigIntKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "bigint"));
|
|
336
351
|
/**
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
352
|
+
* @tsplus fluent fncts.schema.AST isBigIntKeyword
|
|
353
|
+
*/
|
|
354
|
+
function isBigIntKeyword(self) {
|
|
355
|
+
return self._tag === 11;
|
|
356
|
+
}
|
|
357
|
+
var SymbolKeyword = class SymbolKeyword extends AST {
|
|
358
|
+
annotations;
|
|
359
|
+
_tag = 12;
|
|
360
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
361
|
+
super();
|
|
362
|
+
this.annotations = annotations;
|
|
363
|
+
}
|
|
364
|
+
clone(newProperties) {
|
|
365
|
+
return new SymbolKeyword(newProperties.annotations ?? this.annotations);
|
|
366
|
+
}
|
|
367
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
368
|
+
return hasTag(that, 12) && context.comparator(this.annotations, that.annotations);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
356
371
|
/**
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const symbolKeyword_1 =
|
|
360
|
-
|
|
372
|
+
* @tsplus static fncts.schema.ASTOps symbolKeyword
|
|
373
|
+
*/
|
|
374
|
+
const symbolKeyword_1 = new SymbolKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "symbol"));
|
|
375
|
+
const symbolKeyword = symbolKeyword_1;
|
|
361
376
|
/**
|
|
362
|
-
|
|
363
|
-
|
|
377
|
+
* @tsplus fluent fncts.schema.AST isSymbolKeyword
|
|
378
|
+
*/
|
|
364
379
|
function isSymbolKeyword_1(self) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
380
|
+
return self._tag === 12;
|
|
381
|
+
}
|
|
382
|
+
var ObjectKeyword = class ObjectKeyword extends AST {
|
|
383
|
+
annotations;
|
|
384
|
+
_tag = 13;
|
|
385
|
+
constructor(annotations = ASTAnnotationMap.empty) {
|
|
386
|
+
super();
|
|
387
|
+
this.annotations = annotations;
|
|
388
|
+
}
|
|
389
|
+
clone(newProperties) {
|
|
390
|
+
return new ObjectKeyword(newProperties.annotations ?? this.annotations);
|
|
391
|
+
}
|
|
392
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
393
|
+
return hasTag(that, 13) && context.comparator(this.annotations, that.annotations);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
381
396
|
/**
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
* @tsplus static fncts.schema.ASTOps objectKeyword
|
|
398
|
+
*/
|
|
399
|
+
const objectKeyword = new ObjectKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "object"));
|
|
400
|
+
var Enum = class Enum extends AST {
|
|
401
|
+
enums;
|
|
402
|
+
annotations;
|
|
403
|
+
_tag = 14;
|
|
404
|
+
constructor(enums, annotations = ASTAnnotationMap.empty) {
|
|
405
|
+
super();
|
|
406
|
+
this.enums = enums;
|
|
407
|
+
this.annotations = annotations;
|
|
408
|
+
}
|
|
409
|
+
clone(newProperties) {
|
|
410
|
+
return new Enum(newProperties.enums ?? this.enums, newProperties.annotations ?? this.annotations);
|
|
411
|
+
}
|
|
412
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
413
|
+
return hasTag(that, 14) && tsplus_module_5.corresponds(that.enums, ([leftName, leftValue], [rightName, rightValue]) => context.comparator(leftName, rightName) && context.comparator(leftValue, rightValue))(this.enums) && context.comparator(this.annotations, that.annotations);
|
|
414
|
+
}
|
|
415
|
+
};
|
|
399
416
|
/**
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
417
|
+
* @tsplus static fncts.schema.ASTOps createEnum
|
|
418
|
+
*/
|
|
419
|
+
function createEnum(enums, annotations = ASTAnnotationMap.empty) {
|
|
420
|
+
return new Enum(enums, annotations);
|
|
421
|
+
}
|
|
422
|
+
var TemplateLiteralSpan = class TemplateLiteralSpan {
|
|
423
|
+
type;
|
|
424
|
+
literal;
|
|
425
|
+
constructor(type, literal) {
|
|
426
|
+
this.type = type;
|
|
427
|
+
this.literal = literal;
|
|
428
|
+
}
|
|
429
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
430
|
+
return that instanceof TemplateLiteralSpan && context.comparator(this.type, that.type) && context.comparator(this.literal, that.literal);
|
|
431
|
+
}
|
|
432
|
+
toString() {
|
|
433
|
+
switch (this.type._tag) {
|
|
434
|
+
case 8: return "${string}";
|
|
435
|
+
case 9: return "${number}";
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
var TemplateLiteral = class extends AST {
|
|
440
|
+
head;
|
|
441
|
+
spans;
|
|
442
|
+
annotations;
|
|
443
|
+
_tag = 15;
|
|
444
|
+
constructor(head, spans, annotations = ASTAnnotationMap.empty) {
|
|
445
|
+
super();
|
|
446
|
+
this.head = head;
|
|
447
|
+
this.spans = spans;
|
|
448
|
+
this.annotations = annotations;
|
|
449
|
+
}
|
|
450
|
+
clone(newProperties) {
|
|
451
|
+
return createTemplateLiteral_1(newProperties.head ?? this.head, newProperties.spans ?? this.spans, newProperties.annotations ?? this.annotations);
|
|
452
|
+
}
|
|
453
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
454
|
+
return hasTag(that, 15) && context.comparator(this.head, that.head) && context.comparator(this.spans, that.spans) && context.comparator(this.annotations, that.annotations);
|
|
455
|
+
}
|
|
456
|
+
};
|
|
434
457
|
/**
|
|
435
|
-
|
|
436
|
-
|
|
458
|
+
* @tsplus static fncts.schema.ASTOps createTemplateLiteral
|
|
459
|
+
*/
|
|
437
460
|
function createTemplateLiteral_1(head, spans, annotations = ASTAnnotationMap.empty) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
461
|
+
if (tsplus_module_6.isNonEmpty(spans)) return new TemplateLiteral(head, spans, annotations);
|
|
462
|
+
else return createLiteral_1(head, annotations);
|
|
463
|
+
}
|
|
464
|
+
var Element = class Element {
|
|
465
|
+
type;
|
|
466
|
+
isOptional;
|
|
467
|
+
constructor(type, isOptional) {
|
|
468
|
+
this.type = type;
|
|
469
|
+
this.isOptional = isOptional;
|
|
470
|
+
}
|
|
471
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
472
|
+
return that instanceof Element && context.comparator(this.type, that.type) && context.comparator(this.isOptional, that.isOptional);
|
|
473
|
+
}
|
|
474
|
+
toString() {
|
|
475
|
+
return String(this.type) + (this.isOptional ? "?" : "");
|
|
476
|
+
}
|
|
477
|
+
};
|
|
456
478
|
/**
|
|
457
|
-
|
|
458
|
-
|
|
479
|
+
* @tsplus static fncts.schema.ASTOps createElement
|
|
480
|
+
*/
|
|
459
481
|
function createElement_1(type, isOptional) {
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
482
|
+
return new Element(type, isOptional);
|
|
483
|
+
}
|
|
484
|
+
var Tuple = class Tuple extends AST {
|
|
485
|
+
elements;
|
|
486
|
+
rest;
|
|
487
|
+
isReadonly;
|
|
488
|
+
annotations;
|
|
489
|
+
_tag = 16;
|
|
490
|
+
constructor(elements, rest, isReadonly, annotations = ASTAnnotationMap.empty) {
|
|
491
|
+
super();
|
|
492
|
+
this.elements = elements;
|
|
493
|
+
this.rest = rest;
|
|
494
|
+
this.isReadonly = isReadonly;
|
|
495
|
+
this.annotations = annotations;
|
|
496
|
+
}
|
|
497
|
+
clone(newProperties) {
|
|
498
|
+
return new Tuple(newProperties.elements ?? this.elements, newProperties.rest ?? this.rest, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
|
|
499
|
+
}
|
|
500
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
501
|
+
return hasTag(that, 16) && context.comparator(this.elements, that.elements) && context.comparator(this.rest, that.rest) && context.comparator(this.isReadonly, that.isReadonly) && context.comparator(this.annotations, that.annotations);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
478
504
|
/**
|
|
479
|
-
|
|
480
|
-
|
|
505
|
+
* @tsplus static fncts.schema.ASTOps createTuple
|
|
506
|
+
*/
|
|
481
507
|
function createTuple_1(elements, rest, isReadonly, annotations = ASTAnnotationMap.empty) {
|
|
482
|
-
|
|
508
|
+
return new Tuple(elements, rest, isReadonly, annotations);
|
|
483
509
|
}
|
|
484
510
|
/**
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
511
|
+
* @tsplus static fncts.schema.ASTOps unknownArray
|
|
512
|
+
*/
|
|
513
|
+
const unknownArray = createTuple_1(tsplus_module_6.empty(), tsplus_module_7.just(tsplus_module_6.vector(unknownKeyword_1), fileName_1 + ":779:65"), true);
|
|
514
|
+
var PropertySignature = class PropertySignature {
|
|
515
|
+
name;
|
|
516
|
+
type;
|
|
517
|
+
isOptional;
|
|
518
|
+
isReadonly;
|
|
519
|
+
annotations;
|
|
520
|
+
constructor(name, type, isOptional, isReadonly, annotations = ASTAnnotationMap.empty) {
|
|
521
|
+
this.name = name;
|
|
522
|
+
this.type = type;
|
|
523
|
+
this.isOptional = isOptional;
|
|
524
|
+
this.isReadonly = isReadonly;
|
|
525
|
+
this.annotations = annotations;
|
|
526
|
+
}
|
|
527
|
+
clone(newProperties) {
|
|
528
|
+
return new PropertySignature(newProperties.name ?? this.name, newProperties.type ?? this.type, newProperties.isOptional ?? this.isOptional, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
|
|
529
|
+
}
|
|
530
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
531
|
+
return that instanceof PropertySignature && context.comparator(this.name, that.name) && context.comparator(this.type, that.type) && context.comparator(this.isOptional, that.isOptional) && context.comparator(this.isReadonly, that.isReadonly) && context.comparator(this.annotations, that.annotations);
|
|
532
|
+
}
|
|
533
|
+
};
|
|
503
534
|
/**
|
|
504
|
-
|
|
505
|
-
|
|
535
|
+
* @tsplus static fncts.schema.ASTOps createPropertySignature
|
|
536
|
+
*/
|
|
506
537
|
function createPropertySignature_1(name, type, isOptional, isReadonly, annotations = ASTAnnotationMap.empty) {
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
538
|
+
return new PropertySignature(name, type, isOptional, isReadonly, annotations);
|
|
539
|
+
}
|
|
540
|
+
var IndexSignature = class IndexSignature {
|
|
541
|
+
parameter;
|
|
542
|
+
type;
|
|
543
|
+
isReadonly;
|
|
544
|
+
constructor(parameter, type, isReadonly) {
|
|
545
|
+
this.parameter = parameter;
|
|
546
|
+
this.type = type;
|
|
547
|
+
this.isReadonly = isReadonly;
|
|
548
|
+
}
|
|
549
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
550
|
+
return that instanceof IndexSignature && context.comparator(this.parameter, that.parameter) && context.comparator(this.type, that.type) && context.comparator(this.isReadonly, that.isReadonly);
|
|
551
|
+
}
|
|
552
|
+
};
|
|
519
553
|
/**
|
|
520
|
-
|
|
521
|
-
|
|
554
|
+
* @tsplus static fncts.schema.ASTOps createIndexSignature
|
|
555
|
+
*/
|
|
522
556
|
function createIndexSignature_1(parameter, type, isReadonly) {
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
557
|
+
return new IndexSignature(parameter, type, isReadonly);
|
|
558
|
+
}
|
|
559
|
+
var TypeLiteral = class TypeLiteral extends AST {
|
|
560
|
+
annotations;
|
|
561
|
+
_tag = 17;
|
|
562
|
+
propertySignatures;
|
|
563
|
+
indexSignatures;
|
|
564
|
+
constructor(propertySignatures, indexSignatures, annotations = ASTAnnotationMap.empty) {
|
|
565
|
+
super();
|
|
566
|
+
this.annotations = annotations;
|
|
567
|
+
this.propertySignatures = sortByAscendingCardinality(propertySignatures);
|
|
568
|
+
this.indexSignatures = sortByAscendingCardinality(indexSignatures);
|
|
569
|
+
}
|
|
570
|
+
clone(newProperties) {
|
|
571
|
+
return new TypeLiteral(newProperties.propertySignatures ?? this.propertySignatures, newProperties.indexSignatures ?? this.indexSignatures, newProperties.annotations ?? this.annotations);
|
|
572
|
+
}
|
|
573
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
574
|
+
return hasTag(that, 17) && context.comparator(this.propertySignatures, that.propertySignatures) && context.comparator(this.indexSignatures, that.indexSignatures) && context.comparator(this.annotations, that.annotations);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
540
577
|
/**
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
return self._tag === 17 /* ASTTag.TypeLiteral */;
|
|
578
|
+
* @tsplus static fncts.schema.ASTOps isTypeLiteral
|
|
579
|
+
* @tsplus fluent fncts.schema.AST isTypeLiteral
|
|
580
|
+
*/
|
|
581
|
+
function isTypeLiteral(self) {
|
|
582
|
+
return self._tag === 17;
|
|
547
583
|
}
|
|
548
584
|
/**
|
|
549
|
-
|
|
550
|
-
|
|
585
|
+
* @tsplus static fncts.schema.ASTOps createTypeLiteral
|
|
586
|
+
*/
|
|
551
587
|
function createTypeLiteral_1(propertySignatures, indexSignatures, annotations) {
|
|
552
|
-
|
|
588
|
+
return new TypeLiteral(propertySignatures, indexSignatures, annotations);
|
|
553
589
|
}
|
|
554
590
|
/**
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
591
|
+
* @tsplus static fncts.schema.ASTOps unknownRecord
|
|
592
|
+
*/
|
|
593
|
+
const unknownRecord = createTypeLiteral_1(tsplus_module_6.empty(), tsplus_module_6.vector(createIndexSignature_1(stringKeyword_1, unknownKeyword_1, true), createIndexSignature_1(symbolKeyword_1, unknownKeyword_1, true)));
|
|
594
|
+
var Union = class extends AST {
|
|
595
|
+
types;
|
|
596
|
+
annotations;
|
|
597
|
+
_tag = 18;
|
|
598
|
+
constructor(types, annotations = ASTAnnotationMap.empty) {
|
|
599
|
+
super();
|
|
600
|
+
this.types = types;
|
|
601
|
+
this.annotations = annotations;
|
|
602
|
+
}
|
|
603
|
+
clone(newProperties) {
|
|
604
|
+
return createUnion_1(newProperties.types ?? this.types, newProperties.annotations ?? this.annotations);
|
|
605
|
+
}
|
|
606
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
607
|
+
return hasTag(that, 18) && context.comparator(this.types, that.types) && context.comparator(this.annotations, that.annotations);
|
|
608
|
+
}
|
|
609
|
+
};
|
|
572
610
|
/**
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
return self._tag === 18 /* ASTTag.Union */;
|
|
611
|
+
* @tsplus fluent fncts.schema.AST isUnion
|
|
612
|
+
*/
|
|
613
|
+
function isUnion(self) {
|
|
614
|
+
return self._tag === 18;
|
|
578
615
|
}
|
|
579
616
|
/**
|
|
580
|
-
|
|
581
|
-
|
|
617
|
+
* @tsplus static fncts.schema.ASTOps createUnion
|
|
618
|
+
*/
|
|
582
619
|
function createUnion_1(candidates, annotations = ASTAnnotationMap.empty) {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
}
|
|
620
|
+
const types = unify(candidates);
|
|
621
|
+
switch (types.length) {
|
|
622
|
+
case 0: return neverKeyword_1;
|
|
623
|
+
case 1: return tsplus_module_6.unsafeGet(0)(types);
|
|
624
|
+
default: return new Union(sortByDescendingWeight(types), annotations);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
var Lazy = class Lazy extends AST {
|
|
628
|
+
getAST;
|
|
629
|
+
annotations;
|
|
630
|
+
_tag = 19;
|
|
631
|
+
constructor(getAST, annotations = ASTAnnotationMap.empty) {
|
|
632
|
+
super();
|
|
633
|
+
this.getAST = getAST;
|
|
634
|
+
this.annotations = annotations;
|
|
635
|
+
}
|
|
636
|
+
clone(newProperties) {
|
|
637
|
+
return new Lazy(newProperties.getAST ?? this.getAST, newProperties.annotations ?? this.annotations);
|
|
638
|
+
}
|
|
639
|
+
[tsplus_module_1.equalsSymbol](that) {
|
|
640
|
+
return this === that;
|
|
641
|
+
}
|
|
642
|
+
};
|
|
607
643
|
/**
|
|
608
|
-
|
|
609
|
-
|
|
644
|
+
* @tsplus static fncts.schema.ASTOps createLazy
|
|
645
|
+
*/
|
|
610
646
|
function createLazy_1(getAST, annotations) {
|
|
611
|
-
|
|
647
|
+
return new Lazy(getAST, annotations);
|
|
612
648
|
}
|
|
613
649
|
/**
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
650
|
+
* @tsplus fluent fncts.schema.AST isLazy
|
|
651
|
+
*/
|
|
652
|
+
function isLazy(self) {
|
|
653
|
+
return self._tag === 19;
|
|
654
|
+
}
|
|
655
|
+
var Refinement = class Refinement extends AST {
|
|
656
|
+
from;
|
|
657
|
+
predicate;
|
|
658
|
+
annotations;
|
|
659
|
+
_tag = 20;
|
|
660
|
+
constructor(from, predicate, annotations = ASTAnnotationMap.empty) {
|
|
661
|
+
super();
|
|
662
|
+
this.from = from;
|
|
663
|
+
this.predicate = predicate;
|
|
664
|
+
this.annotations = annotations;
|
|
665
|
+
}
|
|
666
|
+
decode(input, options) {
|
|
667
|
+
return this.predicate(input) ? tsplus_module_8.succeed(input) : tsplus_module_8.fail(tsplus_module_9.typeError(this, input));
|
|
668
|
+
}
|
|
669
|
+
clone(newProperties) {
|
|
670
|
+
return new Refinement(newProperties.from ?? this.from, newProperties.predicate ?? this.predicate, newProperties.annotations ?? this.annotations);
|
|
671
|
+
}
|
|
672
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
673
|
+
return hasTag(that, 20) && context.comparator(this.from, that.from) && context.comparator(this.predicate, that.predicate) && context.comparator(this.annotations, that.annotations);
|
|
674
|
+
}
|
|
675
|
+
};
|
|
638
676
|
/**
|
|
639
|
-
|
|
640
|
-
|
|
677
|
+
* @tsplus static fncts.schema.ASTOps createRefinement
|
|
678
|
+
*/
|
|
641
679
|
function createRefinement_1(from, predicate, annotations) {
|
|
642
|
-
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
}
|
|
680
|
+
return new Refinement(from, predicate, annotations);
|
|
681
|
+
}
|
|
682
|
+
function isRefinement(self) {
|
|
683
|
+
return self._tag === 20;
|
|
684
|
+
}
|
|
685
|
+
var Transform = class Transform extends AST {
|
|
686
|
+
from;
|
|
687
|
+
to;
|
|
688
|
+
decode;
|
|
689
|
+
encode;
|
|
690
|
+
annotations;
|
|
691
|
+
_tag = 21;
|
|
692
|
+
constructor(from, to, decode, encode, annotations = ASTAnnotationMap.empty) {
|
|
693
|
+
super();
|
|
694
|
+
this.from = from;
|
|
695
|
+
this.to = to;
|
|
696
|
+
this.decode = decode;
|
|
697
|
+
this.encode = encode;
|
|
698
|
+
this.annotations = annotations;
|
|
699
|
+
}
|
|
700
|
+
clone(newProperties) {
|
|
701
|
+
return new Transform(newProperties.from ?? this.from, newProperties.to ?? this.to, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
|
|
702
|
+
}
|
|
703
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
704
|
+
return hasTag(that, 21) && context.comparator(this.from, that.from) && context.comparator(this.to, that.to) && context.comparator(this.decode, that.decode) && context.comparator(this.encode, that.encode) && context.comparator(this.annotations, that.annotations);
|
|
705
|
+
}
|
|
706
|
+
};
|
|
665
707
|
/**
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
708
|
+
* @tsplus static fncts.schema.ASTOps createTransform
|
|
709
|
+
*/
|
|
710
|
+
function createTransform(from, to, decode, encode, annotations) {
|
|
711
|
+
return new Transform(from, getTo_1(to), decode, encode, annotations);
|
|
712
|
+
}
|
|
713
|
+
var Validation = class Validation extends AST {
|
|
714
|
+
from;
|
|
715
|
+
validation;
|
|
716
|
+
annotations;
|
|
717
|
+
_tag = 22;
|
|
718
|
+
constructor(from, validation, annotations = ASTAnnotationMap.empty) {
|
|
719
|
+
super();
|
|
720
|
+
this.from = from;
|
|
721
|
+
this.validation = validation;
|
|
722
|
+
this.annotations = annotations;
|
|
723
|
+
}
|
|
724
|
+
clone(newProperties) {
|
|
725
|
+
return new Validation(newProperties.from ?? this.from, newProperties.validation ?? this.validation, newProperties.annotations ?? this.annotations);
|
|
726
|
+
}
|
|
727
|
+
[tsplus_module_1.equalsSymbol](that, context) {
|
|
728
|
+
return hasTag(that, 22) && context.comparator(this.from, that.from) && context.comparator(this.validation, that.validation) && context.comparator(this.annotations, that.annotations);
|
|
729
|
+
}
|
|
730
|
+
};
|
|
686
731
|
/**
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
732
|
+
* @tsplus static fncts.schema.ASTOps createValidation
|
|
733
|
+
*/
|
|
734
|
+
function createValidation(from, validation, annotations) {
|
|
735
|
+
return new Validation(from, validation, annotations);
|
|
691
736
|
}
|
|
692
737
|
/**
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
ast_1 = ast_2;
|
|
723
|
-
continue;
|
|
724
|
-
case 21 /* ASTTag.Transform */:
|
|
725
|
-
ast_2 = ast_1.to;
|
|
726
|
-
ast_1 = ast_2;
|
|
727
|
-
continue;
|
|
728
|
-
default:
|
|
729
|
-
return 4;
|
|
730
|
-
}
|
|
731
|
-
}
|
|
738
|
+
* @tsplus tailRec
|
|
739
|
+
*/
|
|
740
|
+
function getCardinality(ast) {
|
|
741
|
+
var ast_1 = ast;
|
|
742
|
+
var ast_2 = ast;
|
|
743
|
+
while (1) switch (ast_1._tag) {
|
|
744
|
+
case 5: return 0;
|
|
745
|
+
case 1:
|
|
746
|
+
case 3:
|
|
747
|
+
case 4:
|
|
748
|
+
case 2: return 1;
|
|
749
|
+
case 10: return 2;
|
|
750
|
+
case 8:
|
|
751
|
+
case 9:
|
|
752
|
+
case 11:
|
|
753
|
+
case 12: return 3;
|
|
754
|
+
case 13: return 5;
|
|
755
|
+
case 6:
|
|
756
|
+
case 7: return 6;
|
|
757
|
+
case 20:
|
|
758
|
+
ast_2 = ast_1.from;
|
|
759
|
+
ast_1 = ast_2;
|
|
760
|
+
continue;
|
|
761
|
+
case 21:
|
|
762
|
+
ast_2 = ast_1.to;
|
|
763
|
+
ast_1 = ast_2;
|
|
764
|
+
continue;
|
|
765
|
+
default: return 4;
|
|
766
|
+
}
|
|
732
767
|
}
|
|
733
768
|
function sortByAscendingCardinality(types) {
|
|
734
|
-
|
|
735
|
-
type
|
|
736
|
-
}) => getCardinality(type))(tsplus_module_7.Ord))(types);
|
|
769
|
+
return tsplus_module_6.sort(tsplus_module_11.contramap(({ type }) => getCardinality(type))(tsplus_module_10.Ord))(types);
|
|
737
770
|
}
|
|
738
|
-
const OrdWeight =
|
|
739
|
-
const maxWeight =
|
|
771
|
+
const OrdWeight = tsplus_module_12.tuple(tsplus_module_10.Ord, tsplus_module_10.Ord, tsplus_module_10.Ord);
|
|
772
|
+
const maxWeight = tsplus_module_13.max(OrdWeight);
|
|
740
773
|
function maxWeightAll(weights) {
|
|
741
|
-
|
|
742
|
-
}
|
|
743
|
-
const emptyWeight = [
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
774
|
+
return tsplus_module_14.foldLeft(emptyWeight, (b, a) => maxWeight(b)(a))(weights);
|
|
775
|
+
}
|
|
776
|
+
const emptyWeight = [
|
|
777
|
+
0,
|
|
778
|
+
0,
|
|
779
|
+
0
|
|
780
|
+
];
|
|
781
|
+
function getWeight(ast) {
|
|
782
|
+
switch (ast._tag) {
|
|
783
|
+
case 0: return tsplus_module_15.match(() => [
|
|
784
|
+
6,
|
|
785
|
+
0,
|
|
786
|
+
0
|
|
787
|
+
], (ast) => {
|
|
788
|
+
const [_, y, z] = getWeight(ast);
|
|
789
|
+
return [
|
|
790
|
+
6,
|
|
791
|
+
y,
|
|
792
|
+
z
|
|
793
|
+
];
|
|
794
|
+
})(ast.annotations.get(tsplus_module_4.Surrogate));
|
|
795
|
+
case 16: return [
|
|
796
|
+
2,
|
|
797
|
+
ast.elements.length,
|
|
798
|
+
tsplus_module_15.match(() => 0, (rest) => rest.length)(ast.rest)
|
|
799
|
+
];
|
|
800
|
+
case 17: {
|
|
801
|
+
const y = ast.propertySignatures.length;
|
|
802
|
+
const z = ast.indexSignatures.length;
|
|
803
|
+
return y + z === 0 ? [
|
|
804
|
+
-4,
|
|
805
|
+
0,
|
|
806
|
+
0
|
|
807
|
+
] : [
|
|
808
|
+
4,
|
|
809
|
+
y,
|
|
810
|
+
z
|
|
811
|
+
];
|
|
812
|
+
}
|
|
813
|
+
case 18: return maxWeightAll(tsplus_module_6.map(getWeight)(ast.types));
|
|
814
|
+
case 19: return [
|
|
815
|
+
8,
|
|
816
|
+
0,
|
|
817
|
+
0
|
|
818
|
+
];
|
|
819
|
+
case 20:
|
|
820
|
+
const [x, y, z] = getWeight(ast.from);
|
|
821
|
+
return [
|
|
822
|
+
x + 1,
|
|
823
|
+
y,
|
|
824
|
+
z
|
|
825
|
+
];
|
|
826
|
+
case 21: return getWeight(ast.from);
|
|
827
|
+
case 13: return [
|
|
828
|
+
-2,
|
|
829
|
+
0,
|
|
830
|
+
0
|
|
831
|
+
];
|
|
832
|
+
case 6:
|
|
833
|
+
case 7: return [
|
|
834
|
+
-4,
|
|
835
|
+
0,
|
|
836
|
+
0
|
|
837
|
+
];
|
|
838
|
+
default: return emptyWeight;
|
|
839
|
+
}
|
|
777
840
|
}
|
|
778
841
|
function sortByDescendingWeight(types) {
|
|
779
|
-
|
|
842
|
+
return tsplus_module_6.sort(tsplus_module_11.contramap(getWeight)(OrdWeight))(types);
|
|
780
843
|
}
|
|
781
844
|
function unify(candidates) {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
if (tsplus_module_3.some(isStringKeyword_1)(out)) {
|
|
794
|
-
out = tsplus_module_3.filter(m => !(isLiteral_1(m) && typeof m.literal === "string"))(out);
|
|
795
|
-
}
|
|
796
|
-
if (tsplus_module_3.some(isNumberKeyword_1)(out)) {
|
|
797
|
-
out = tsplus_module_3.filter(m => !(isLiteral_1(m) && typeof m.literal === "number"))(out);
|
|
798
|
-
}
|
|
799
|
-
if (tsplus_module_3.some(isSymbolKeyword_1)(out)) {
|
|
800
|
-
out = tsplus_module_3.filter(m => !isUniqueSymbol_1(m))(out);
|
|
801
|
-
}
|
|
802
|
-
return out;
|
|
845
|
+
let out = tsplus_module_6.flatMap((ast) => {
|
|
846
|
+
switch (ast._tag) {
|
|
847
|
+
case 5: return tsplus_module_6.empty();
|
|
848
|
+
case 18: return ast.types;
|
|
849
|
+
default: return tsplus_module_6.vector(ast);
|
|
850
|
+
}
|
|
851
|
+
})(candidates);
|
|
852
|
+
if (tsplus_module_6.some(isStringKeyword_1)(out)) out = tsplus_module_6.filter((m) => !(isLiteral_1(m) && typeof m.literal === "string"))(out);
|
|
853
|
+
if (tsplus_module_6.some(isNumberKeyword_1)(out)) out = tsplus_module_6.filter((m) => !(isLiteral_1(m) && typeof m.literal === "number"))(out);
|
|
854
|
+
if (tsplus_module_6.some(isSymbolKeyword_1)(out)) out = tsplus_module_6.filter((m) => !isUniqueSymbol_1(m))(out);
|
|
855
|
+
return out;
|
|
803
856
|
}
|
|
804
857
|
/**
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
});
|
|
812
|
-
};
|
|
858
|
+
* @tsplus pipeable fncts.schema.AST combineAnnotations
|
|
859
|
+
*/
|
|
860
|
+
function combineAnnotations(annotations) {
|
|
861
|
+
return (self) => {
|
|
862
|
+
return self.clone({ annotations: self.annotations.combine(annotations) });
|
|
863
|
+
};
|
|
813
864
|
}
|
|
814
865
|
/**
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
});
|
|
822
|
-
};
|
|
866
|
+
* @tsplus pipeable fncts.schema.AST setAnnotation
|
|
867
|
+
*/
|
|
868
|
+
function setAnnotation(annotation, value) {
|
|
869
|
+
return (self) => {
|
|
870
|
+
return self.clone({ annotations: self.annotations.annotate(annotation, value) });
|
|
871
|
+
};
|
|
823
872
|
}
|
|
824
873
|
/**
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
return createTuple_1(self.elements, tsplus_module_4.just(tsplus_module_3.vector(restElement), fileName_1 + ":1115:43"), self.isReadonly, self.annotations);
|
|
833
|
-
};
|
|
874
|
+
* @tsplus pipeable fncts.schema.AST appendRestElement
|
|
875
|
+
*/
|
|
876
|
+
function appendRestElement(restElement) {
|
|
877
|
+
return (self) => {
|
|
878
|
+
if (tsplus_module_16.isJust(self.rest)) throw new Error("A rest element cannot follow another rest element. ts(1265)");
|
|
879
|
+
return createTuple_1(self.elements, tsplus_module_7.just(tsplus_module_6.vector(restElement), fileName_1 + ":1313:43"), self.isReadonly, self.annotations);
|
|
880
|
+
};
|
|
834
881
|
}
|
|
835
882
|
/**
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
};
|
|
850
|
-
}
|
|
851
|
-
export function getParameter(x) {
|
|
852
|
-
return isRefinement(x) ? getParameter(x.from) : x;
|
|
883
|
+
* @tsplus pipeable fncts.schema.AST appendElement
|
|
884
|
+
*/
|
|
885
|
+
function appendElement(element) {
|
|
886
|
+
return (self) => {
|
|
887
|
+
if (tsplus_module_6.some((e) => e.isOptional)(self.elements) && !element.isOptional) throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
888
|
+
return tsplus_module_15.match(() => createTuple_1(tsplus_module_6.append(element)(self.elements), tsplus_module_7.nothing(fileName_1 + ":1326:63"), self.isReadonly, self.annotations), (rest) => {
|
|
889
|
+
if (element.isOptional) throw new Error("A required element cannot follow an optional element. ts(1257)");
|
|
890
|
+
return createTuple_1(self.elements, tsplus_module_7.just(tsplus_module_6.append(element.type)(rest), fileName_1 + ":1331:47"), self.isReadonly, self.annotations);
|
|
891
|
+
})(self.rest);
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
function getParameter(x) {
|
|
895
|
+
return isRefinement(x) ? getParameter(x.from) : x;
|
|
853
896
|
}
|
|
854
897
|
/**
|
|
855
|
-
|
|
856
|
-
|
|
898
|
+
* @tsplus getter fncts.schema.AST getPropertySignatures
|
|
899
|
+
*/
|
|
857
900
|
function getPropertySignatures_1(self) {
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
case 17 /* ASTTag.TypeLiteral */:
|
|
878
|
-
return self.propertySignatures;
|
|
879
|
-
case 19 /* ASTTag.Lazy */:
|
|
880
|
-
return getPropertySignatures_1(self.getAST());
|
|
881
|
-
case 20 /* ASTTag.Refinement */:
|
|
882
|
-
return getPropertySignatures_1(self.from);
|
|
883
|
-
case 21 /* ASTTag.Transform */:
|
|
884
|
-
return getPropertySignatures_1(self.to);
|
|
885
|
-
default:
|
|
886
|
-
return tsplus_module_3.empty();
|
|
887
|
-
}
|
|
901
|
+
switch (self._tag) {
|
|
902
|
+
case 0: return tsplus_module_15.match(() => tsplus_module_6.empty(), (surrogate) => getPropertySignatures_1(surrogate))(self.annotations.get(tsplus_module_4.Surrogate));
|
|
903
|
+
case 16: return tsplus_module_6.mapWithIndex((i, element) => createPropertySignature_1(i, element.type, element.isOptional, self.isReadonly))(self.elements);
|
|
904
|
+
case 18: {
|
|
905
|
+
const propertySignatures = tsplus_module_6.map(getPropertySignatures_1)(self.types);
|
|
906
|
+
return tsplus_module_6.filterMap(({ name }) => {
|
|
907
|
+
if (tsplus_module_6.every((ps) => tsplus_module_6.some((p) => p.name === name)(ps))(propertySignatures)) {
|
|
908
|
+
const members = tsplus_module_6.flatMap((ps) => tsplus_module_6.filter((p) => p.name === name)(ps))(propertySignatures);
|
|
909
|
+
return tsplus_module_7.just(createPropertySignature_1(name, createUnion_1(tsplus_module_6.map((p) => p.type)(members)), tsplus_module_6.some((p) => p.isOptional)(members), tsplus_module_6.some((p) => p.isReadonly)(members)), fileName_1 + ":1363:22");
|
|
910
|
+
}
|
|
911
|
+
return tsplus_module_7.nothing(fileName_1 + ":1372:23");
|
|
912
|
+
})(tsplus_module_6.unsafeGet(0)(propertySignatures));
|
|
913
|
+
}
|
|
914
|
+
case 17: return self.propertySignatures;
|
|
915
|
+
case 19: return getPropertySignatures_1(self.getAST());
|
|
916
|
+
case 20: return getPropertySignatures_1(self.from);
|
|
917
|
+
case 21: return getPropertySignatures_1(self.to);
|
|
918
|
+
default: return tsplus_module_6.empty();
|
|
919
|
+
}
|
|
888
920
|
}
|
|
889
921
|
/**
|
|
890
|
-
|
|
891
|
-
|
|
922
|
+
* @tsplus getter fncts.schema.AST keysof
|
|
923
|
+
*/
|
|
892
924
|
function keysOf_1(ast) {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
return tsplus_module_3.map(p => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(getPropertySignatures_1(ast));
|
|
906
|
-
case 19 /* ASTTag.Lazy */:
|
|
907
|
-
return keysOf_1(ast.getAST());
|
|
908
|
-
case 20 /* ASTTag.Refinement */:
|
|
909
|
-
return keysOf_1(ast.from);
|
|
910
|
-
case 21 /* ASTTag.Transform */:
|
|
911
|
-
return keysOf_1(ast.to);
|
|
912
|
-
default:
|
|
913
|
-
return tsplus_module_3.empty();
|
|
914
|
-
}
|
|
925
|
+
switch (ast._tag) {
|
|
926
|
+
case 0: return tsplus_module_15.match(() => tsplus_module_6.empty(), (surrogate) => keysOf_1(surrogate))(ast.annotations.get(tsplus_module_4.Surrogate));
|
|
927
|
+
case 5:
|
|
928
|
+
case 7: return tsplus_module_6.vector(stringKeyword_1, numberKeyword_1, symbolKeyword_1);
|
|
929
|
+
case 8: return tsplus_module_6.vector(createLiteral_1("length"));
|
|
930
|
+
case 17: return tsplus_module_6.concat(tsplus_module_6.map((is) => getParameter(is.parameter))(ast.indexSignatures))(tsplus_module_6.map((p) => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(ast.propertySignatures));
|
|
931
|
+
case 18: return tsplus_module_6.map((p) => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(getPropertySignatures_1(ast));
|
|
932
|
+
case 19: return keysOf_1(ast.getAST());
|
|
933
|
+
case 20: return keysOf_1(ast.from);
|
|
934
|
+
case 21: return keysOf_1(ast.to);
|
|
935
|
+
default: return tsplus_module_6.empty();
|
|
936
|
+
}
|
|
915
937
|
}
|
|
916
938
|
/**
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
939
|
+
* @tsplus getter fncts.schema.AST keyof
|
|
940
|
+
*/
|
|
941
|
+
function keyof(self) {
|
|
942
|
+
return createUnion_1(keysOf_1(self));
|
|
921
943
|
}
|
|
922
944
|
/**
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
throw new Error(`createRecord: Unsupported key\n${show(key)}`);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
go(key);
|
|
955
|
-
return createTypeLiteral_1(propertySignatures, indexSignatures);
|
|
945
|
+
* @tsplus static fncts.schema.ASTOps createRecord
|
|
946
|
+
*/
|
|
947
|
+
function createRecord(key, value, isReadonly) {
|
|
948
|
+
const propertySignatures = tsplus_module_6.emptyPushable();
|
|
949
|
+
const indexSignatures = tsplus_module_6.emptyPushable();
|
|
950
|
+
function go(key) {
|
|
951
|
+
switch (key._tag) {
|
|
952
|
+
case 5: break;
|
|
953
|
+
case 8:
|
|
954
|
+
case 12:
|
|
955
|
+
case 15:
|
|
956
|
+
case 20:
|
|
957
|
+
tsplus_module_17.push(createIndexSignature_1(key, value, isReadonly))(indexSignatures);
|
|
958
|
+
break;
|
|
959
|
+
case 1:
|
|
960
|
+
if (typeof key.literal === "string" || typeof key.literal === "number") tsplus_module_17.push(createPropertySignature_1(key.literal, value, false, isReadonly))(propertySignatures);
|
|
961
|
+
break;
|
|
962
|
+
case 2:
|
|
963
|
+
tsplus_module_17.push(createPropertySignature_1(key.symbol, value, false, isReadonly))(propertySignatures);
|
|
964
|
+
break;
|
|
965
|
+
case 18:
|
|
966
|
+
tsplus_module_6.forEach(go)(key.types);
|
|
967
|
+
break;
|
|
968
|
+
default: throw new Error(`createRecord: Unsupported key\n${show(key)}`);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
go(key);
|
|
972
|
+
return createTypeLiteral_1(propertySignatures, indexSignatures);
|
|
956
973
|
}
|
|
957
974
|
/**
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
975
|
+
* @tsplus pipeable fncts.schema.AST pick
|
|
976
|
+
*/
|
|
977
|
+
function pick(keys) {
|
|
978
|
+
return (self) => {
|
|
979
|
+
return createTypeLiteral_1(tsplus_module_6.filter((ps) => tsplus_module_6.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_6.empty());
|
|
980
|
+
};
|
|
964
981
|
}
|
|
965
982
|
/**
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
983
|
+
* @tsplus pipeable fncts.schema.AST omit
|
|
984
|
+
*/
|
|
985
|
+
function omit(keys) {
|
|
986
|
+
return (self) => {
|
|
987
|
+
return createTypeLiteral_1(tsplus_module_6.filter((ps) => !tsplus_module_6.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_6.empty());
|
|
988
|
+
};
|
|
972
989
|
}
|
|
973
990
|
/**
|
|
974
|
-
|
|
975
|
-
|
|
991
|
+
* @tsplus getter fncts.schema.AST partial
|
|
992
|
+
*/
|
|
976
993
|
function partial_1(self) {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
return createLazy_1(() => partial_1(self.getAST()));
|
|
987
|
-
case 20 /* ASTTag.Refinement */:
|
|
988
|
-
return partial_1(self.from);
|
|
989
|
-
case 21 /* ASTTag.Transform */:
|
|
990
|
-
return partial_1(self.to);
|
|
991
|
-
default:
|
|
992
|
-
return self;
|
|
993
|
-
}
|
|
994
|
+
switch (self._tag) {
|
|
995
|
+
case 16: return createTuple_1(tsplus_module_6.map((e) => createElement_1(e.type, true))(self.elements), tsplus_module_18.map((rest) => tsplus_module_6.vector(createUnion_1(tsplus_module_6.append(undefinedKeyword_1)(rest))))(self.rest), self.isReadonly);
|
|
996
|
+
case 17: return createTypeLiteral_1(tsplus_module_6.map((f) => createPropertySignature_1(f.name, f.type, true, f.isReadonly, f.annotations))(self.propertySignatures), self.indexSignatures);
|
|
997
|
+
case 18: return createUnion_1(tsplus_module_6.map(partial_1)(self.types));
|
|
998
|
+
case 19: return createLazy_1(() => partial_1(self.getAST()));
|
|
999
|
+
case 20: return partial_1(self.from);
|
|
1000
|
+
case 21: return partial_1(self.to);
|
|
1001
|
+
default: return self;
|
|
1002
|
+
}
|
|
994
1003
|
}
|
|
995
1004
|
/**
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1005
|
+
* @tsplus static fncts.schema.AST createKey
|
|
1006
|
+
*/
|
|
1007
|
+
function createKey(key) {
|
|
1008
|
+
return typeof key === "symbol" ? createUniqueSymbol_1(key) : createLiteral_1(key);
|
|
1000
1009
|
}
|
|
1001
1010
|
/**
|
|
1002
|
-
|
|
1003
|
-
|
|
1011
|
+
* @tsplus getter fncts.schema.AST getFrom
|
|
1012
|
+
*/
|
|
1004
1013
|
function getFrom_1(ast) {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
case 18 /* ASTTag.Union */:
|
|
1020
|
-
return createUnion_1(tsplus_module_3.map(getFrom_1)(ast.types), ast.annotations);
|
|
1021
|
-
case 19 /* ASTTag.Lazy */:
|
|
1022
|
-
return createLazy_1(() => getFrom_1(ast.getAST()), ast.annotations);
|
|
1023
|
-
case 20 /* ASTTag.Refinement */:
|
|
1024
|
-
case 21 /* ASTTag.Transform */:
|
|
1025
|
-
return getFrom_1(ast.from);
|
|
1026
|
-
}
|
|
1027
|
-
return ast;
|
|
1014
|
+
switch (ast._tag) {
|
|
1015
|
+
case 0: {
|
|
1016
|
+
const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
|
|
1017
|
+
if (tsplus_module_16.isJust(surrogate)) return getFrom_1(surrogate.value);
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
case 16: return createTuple_1(tsplus_module_6.map((element) => createElement_1(getFrom_1(element.type), element.isOptional))(ast.elements), tsplus_module_18.map((restElement) => tsplus_module_6.map(getFrom_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
|
|
1021
|
+
case 17: return createTypeLiteral_1(tsplus_module_6.map((ps) => createPropertySignature_1(ps.name, getFrom_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_6.map((is) => createIndexSignature_1(is.parameter, getFrom_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
|
|
1022
|
+
case 18: return createUnion_1(tsplus_module_6.map(getFrom_1)(ast.types), ast.annotations);
|
|
1023
|
+
case 19: return createLazy_1(() => getFrom_1(ast.getAST()), ast.annotations);
|
|
1024
|
+
case 20:
|
|
1025
|
+
case 21: return getFrom_1(ast.from);
|
|
1026
|
+
}
|
|
1027
|
+
return ast;
|
|
1028
1028
|
}
|
|
1029
1029
|
/**
|
|
1030
|
-
|
|
1031
|
-
|
|
1030
|
+
* @tsplus getter fncts.schema.AST getTo
|
|
1031
|
+
*/
|
|
1032
1032
|
function getTo_1(ast) {
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
case 18 /* ASTTag.Union */:
|
|
1048
|
-
return createUnion_1(tsplus_module_3.map(getTo_1)(ast.types), ast.annotations);
|
|
1049
|
-
case 19 /* ASTTag.Lazy */:
|
|
1050
|
-
return createLazy_1(() => getTo_1(ast.getAST()), ast.annotations);
|
|
1051
|
-
case 20 /* ASTTag.Refinement */:
|
|
1052
|
-
return createRefinement_1(getTo_1(ast.from), ast.predicate, ast.annotations);
|
|
1053
|
-
case 21 /* ASTTag.Transform */:
|
|
1054
|
-
return getTo_1(ast.to);
|
|
1055
|
-
}
|
|
1056
|
-
return ast;
|
|
1033
|
+
switch (ast._tag) {
|
|
1034
|
+
case 0: {
|
|
1035
|
+
const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
|
|
1036
|
+
if (tsplus_module_16.isJust(surrogate)) return getTo_1(surrogate.value);
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
case 16: return createTuple_1(tsplus_module_6.map((element) => createElement_1(getTo_1(element.type), element.isOptional))(ast.elements), tsplus_module_18.map((restElement) => tsplus_module_6.map(getTo_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
|
|
1040
|
+
case 17: return createTypeLiteral_1(tsplus_module_6.map((ps) => createPropertySignature_1(ps.name, getTo_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_6.map((is) => createIndexSignature_1(is.parameter, getTo_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
|
|
1041
|
+
case 18: return createUnion_1(tsplus_module_6.map(getTo_1)(ast.types), ast.annotations);
|
|
1042
|
+
case 19: return createLazy_1(() => getTo_1(ast.getAST()), ast.annotations);
|
|
1043
|
+
case 20: return createRefinement_1(getTo_1(ast.from), ast.predicate, ast.annotations);
|
|
1044
|
+
case 21: return getTo_1(ast.to);
|
|
1045
|
+
}
|
|
1046
|
+
return ast;
|
|
1057
1047
|
}
|
|
1058
1048
|
/**
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
} else {
|
|
1121
|
-
buckets[hash] = [member];
|
|
1122
|
-
keys[key].ast = createUnion_1(tsplus_module_3.vector(keys[key].ast, literal));
|
|
1123
|
-
keys[key].literals.push(literal);
|
|
1124
|
-
break;
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
} else {
|
|
1128
|
-
otherwise.push(member);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
return {
|
|
1132
|
-
keys,
|
|
1133
|
-
otherwise
|
|
1134
|
-
};
|
|
1049
|
+
* @tsplus static fncts.schema.AST getCompiler
|
|
1050
|
+
*/
|
|
1051
|
+
function getCompiler(match) {
|
|
1052
|
+
const compile = memoize((ast) => {
|
|
1053
|
+
return match[ast._tag](ast, compile);
|
|
1054
|
+
});
|
|
1055
|
+
return compile;
|
|
1056
|
+
}
|
|
1057
|
+
function getLiterals(ast, isDecoding) {
|
|
1058
|
+
switch (ast._tag) {
|
|
1059
|
+
case 0: {
|
|
1060
|
+
const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
|
|
1061
|
+
if (tsplus_module_16.isJust(surrogate)) return getLiterals(surrogate.value, isDecoding);
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
case 17: {
|
|
1065
|
+
const out = [];
|
|
1066
|
+
for (let i = 0; i < ast.propertySignatures.length; i++) {
|
|
1067
|
+
const propertySignature = tsplus_module_6.unsafeGet(i)(ast.propertySignatures);
|
|
1068
|
+
if (isLiteral_1(propertySignature.type) && !propertySignature.isOptional) out.push([propertySignature.name, propertySignature.type]);
|
|
1069
|
+
}
|
|
1070
|
+
return out;
|
|
1071
|
+
}
|
|
1072
|
+
case 20: return getLiterals(ast.from, isDecoding);
|
|
1073
|
+
case 21: return getLiterals(isDecoding ? ast.from : ast.to, isDecoding);
|
|
1074
|
+
}
|
|
1075
|
+
return [];
|
|
1076
|
+
}
|
|
1077
|
+
function getSearchTree(members, isDecoding) {
|
|
1078
|
+
const keys = {};
|
|
1079
|
+
const otherwise = [];
|
|
1080
|
+
for (let i = 0; i < members.length; i++) {
|
|
1081
|
+
const member = tsplus_module_6.unsafeGet(i)(members);
|
|
1082
|
+
const tags = getLiterals(member, isDecoding);
|
|
1083
|
+
if (tags.length > 0) for (let j = 0; j < tags.length; j++) {
|
|
1084
|
+
const [key, literal] = tags[j];
|
|
1085
|
+
const hash = String(literal.literal);
|
|
1086
|
+
keys[key] ||= {
|
|
1087
|
+
buckets: {},
|
|
1088
|
+
ast: neverKeyword_1,
|
|
1089
|
+
literals: []
|
|
1090
|
+
};
|
|
1091
|
+
const buckets = keys[key].buckets;
|
|
1092
|
+
if (Object.prototype.hasOwnProperty.call(buckets, hash)) {
|
|
1093
|
+
if (j < tags.length - 1) continue;
|
|
1094
|
+
buckets[hash].push(member);
|
|
1095
|
+
keys[key].ast = createUnion_1(tsplus_module_6.vector(keys[key].ast, literal));
|
|
1096
|
+
keys[key].literals.push(literal);
|
|
1097
|
+
} else {
|
|
1098
|
+
buckets[hash] = [member];
|
|
1099
|
+
keys[key].ast = createUnion_1(tsplus_module_6.vector(keys[key].ast, literal));
|
|
1100
|
+
keys[key].literals.push(literal);
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
else otherwise.push(member);
|
|
1105
|
+
}
|
|
1106
|
+
return {
|
|
1107
|
+
keys,
|
|
1108
|
+
otherwise
|
|
1109
|
+
};
|
|
1135
1110
|
}
|
|
1136
1111
|
/**
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
}
|
|
1112
|
+
* @tsplus pipeable fncts.schema.AST getFormattedExpected
|
|
1113
|
+
*/
|
|
1114
|
+
function getFormattedExpected(verbose = false) {
|
|
1115
|
+
return (self) => {
|
|
1116
|
+
if (verbose) {
|
|
1117
|
+
const description = tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Title))(self.annotations.get(tsplus_module_4.Description));
|
|
1118
|
+
return tsplus_module_15.match(() => description, (identifier) => tsplus_module_15.match(() => tsplus_module_7.just(identifier, fileName_1 + ":1710:23"), (description) => tsplus_module_7.just(`${identifier} (${description})`, fileName_1 + ":1711:34"))(description))(self.annotations.get(tsplus_module_4.Identifier));
|
|
1119
|
+
} else return tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Description))(tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Title))(self.annotations.get(tsplus_module_4.Identifier)));
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
//#endregion
|
|
1123
|
+
export { AST, ASTTypeId, Annotated, AnyKeyword, BigIntKeyword, BooleanKeyword, Declaration, Element, Enum, IndexSignature, Lazy, Literal, NeverKeyword, NumberKeyword, ObjectKeyword, PropertySignature, Refinement, StringKeyword, SymbolKeyword, TemplateLiteral, TemplateLiteralSpan, Transform, Tuple, TypeLiteral, UndefinedKeyword, Union, UniqueSymbol, UnknownKeyword, Validation, VoidKeyword, anyKeyword, appendElement, appendRestElement, bigIntKeyword, booleanKeyword, combineAnnotations, concrete, createDeclaration, createElement, createEnum, createIndexSignature, createKey, createLazy, createLiteral, createPropertySignature, createRecord, createRefinement, createTemplateLiteral, createTransform, createTuple, createTypeLiteral, createUnion, createUniqueSymbol, createValidation, getAnnotations, getCardinality, getCompiler, getFormattedExpected, getFrom, getLiterals, getParameter, getPropertySignatures, getSearchTree, getTo, getWeight, isAST, isBigIntKeyword, isBooleanKeyword, isDeclaration, isLazy, isLiteral, isNumberKeyword, isRefinement, isStringKeyword, isSymbolKeyword, isTypeLiteral, isUnion, isUniqueSymbol, keyof, keysOf, neverKeyword, numberKeyword, objectKeyword, omit, partial, pick, setAnnotation, stringKeyword, symbolKeyword, undefinedKeyword, unknownArray, unknownKeyword, unknownRecord, voidKeyword };
|
|
1124
|
+
|
|
1149
1125
|
//# sourceMappingURL=AST.mjs.map
|