@elaraai/east 0.0.1-beta.28 → 0.0.1-beta.29
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/src/analyze.d.ts.map +1 -1
- package/dist/src/analyze.js +12 -4
- package/dist/src/analyze.js.map +1 -1
- package/dist/src/ast.d.ts +33 -33
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast_to_ir.d.ts +2 -2
- package/dist/src/ast_to_ir.d.ts.map +1 -1
- package/dist/src/ast_to_ir.js +100 -100
- package/dist/src/ast_to_ir.js.map +1 -1
- package/dist/src/compile.d.ts +20 -1
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +103 -84
- package/dist/src/compile.js.map +1 -1
- package/dist/src/error.d.ts +8 -1
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +11 -1
- package/dist/src/error.js.map +1 -1
- package/dist/src/expr/array.js +48 -48
- package/dist/src/expr/array.js.map +1 -1
- package/dist/src/expr/ast.d.ts +1 -1
- package/dist/src/expr/ast.d.ts.map +1 -1
- package/dist/src/expr/ast.js +14 -14
- package/dist/src/expr/ast.js.map +1 -1
- package/dist/src/expr/asyncfunction.js +1 -1
- package/dist/src/expr/asyncfunction.js.map +1 -1
- package/dist/src/expr/blob.js +7 -7
- package/dist/src/expr/blob.js.map +1 -1
- package/dist/src/expr/block.d.ts +2 -2
- package/dist/src/expr/block.d.ts.map +1 -1
- package/dist/src/expr/block.js +131 -131
- package/dist/src/expr/block.js.map +1 -1
- package/dist/src/expr/boolean.js +5 -5
- package/dist/src/expr/boolean.js.map +1 -1
- package/dist/src/expr/datetime.js +33 -33
- package/dist/src/expr/datetime.js.map +1 -1
- package/dist/src/expr/dict.js +55 -55
- package/dist/src/expr/dict.js.map +1 -1
- package/dist/src/expr/expr.d.ts +1 -1
- package/dist/src/expr/expr.d.ts.map +1 -1
- package/dist/src/expr/expr.js.map +1 -1
- package/dist/src/expr/float.js +16 -16
- package/dist/src/expr/float.js.map +1 -1
- package/dist/src/expr/function.js +1 -1
- package/dist/src/expr/function.js.map +1 -1
- package/dist/src/expr/integer.js +17 -17
- package/dist/src/expr/integer.js.map +1 -1
- package/dist/src/expr/libs/blob.js +2 -2
- package/dist/src/expr/libs/blob.js.map +1 -1
- package/dist/src/expr/libs/string.js +1 -1
- package/dist/src/expr/libs/string.js.map +1 -1
- package/dist/src/expr/recursive.js +2 -2
- package/dist/src/expr/recursive.js.map +1 -1
- package/dist/src/expr/ref.js +3 -3
- package/dist/src/expr/ref.js.map +1 -1
- package/dist/src/expr/set.js +45 -45
- package/dist/src/expr/set.js.map +1 -1
- package/dist/src/expr/string.js +22 -22
- package/dist/src/expr/string.js.map +1 -1
- package/dist/src/expr/struct.d.ts +1 -1
- package/dist/src/expr/struct.d.ts.map +1 -1
- package/dist/src/expr/struct.js +1 -1
- package/dist/src/expr/struct.js.map +1 -1
- package/dist/src/expr/variant.js +2 -2
- package/dist/src/expr/variant.js.map +1 -1
- package/dist/src/ir.d.ts +121 -114
- package/dist/src/ir.d.ts.map +1 -1
- package/dist/src/ir.js +49 -34
- package/dist/src/ir.js.map +1 -1
- package/dist/src/location.d.ts +30 -10
- package/dist/src/location.d.ts.map +1 -1
- package/dist/src/location.js +70 -28
- package/dist/src/location.js.map +1 -1
- package/dist/src/serialization/beast2.d.ts +1 -1
- package/dist/src/serialization/beast2.d.ts.map +1 -1
- package/dist/src/serialization/beast2.js +131 -22
- package/dist/src/serialization/beast2.js.map +1 -1
- package/dist/src/serialization/index.d.ts +1 -1
- package/dist/src/serialization/index.d.ts.map +1 -1
- package/dist/src/serialization/index.js +1 -1
- package/dist/src/serialization/index.js.map +1 -1
- package/package.json +1 -1
package/dist/src/error.d.ts
CHANGED
|
@@ -3,12 +3,19 @@
|
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import type { LocationValue } from "./ir.js";
|
|
6
|
+
/**
|
|
7
|
+
* Internal error for invariant violations in the East compiler/runtime.
|
|
8
|
+
* These indicate bugs in East itself, not user errors.
|
|
9
|
+
*/
|
|
10
|
+
export declare class InternalError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
6
13
|
export declare class EastError extends Error {
|
|
7
14
|
location: LocationValue[];
|
|
8
15
|
eastMessage: string;
|
|
9
16
|
constructor(message: string, options: {
|
|
10
17
|
cause?: any;
|
|
11
|
-
location: LocationValue;
|
|
18
|
+
location: LocationValue[];
|
|
12
19
|
});
|
|
13
20
|
toString(): string;
|
|
14
21
|
/** Format for use with Error.message */
|
package/dist/src/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,SAAU,SAAQ,KAAK;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,aAAa,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,SAAU,SAAQ,KAAK;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,KAAK,CAAC,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;KAAE;IAMvE,QAAQ,IAAI,MAAM;IAkB3B,wCAAwC;IACxC,IAAI,gBAAgB,IAAI,MAAM,CAE7B;CACF"}
|
package/dist/src/error.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal error for invariant violations in the East compiler/runtime.
|
|
3
|
+
* These indicate bugs in East itself, not user errors.
|
|
4
|
+
*/
|
|
5
|
+
export class InternalError extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(`Internal East error: ${message}`);
|
|
8
|
+
this.name = "InternalError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
1
11
|
export class EastError extends Error {
|
|
2
12
|
location;
|
|
3
13
|
eastMessage;
|
|
4
14
|
constructor(message, options) {
|
|
5
15
|
super(message, options.cause === undefined ? undefined : { cause: options.cause });
|
|
6
16
|
this.eastMessage = message;
|
|
7
|
-
this.location = [options.location];
|
|
17
|
+
this.location = [...options.location];
|
|
8
18
|
}
|
|
9
19
|
toString() {
|
|
10
20
|
const loc = this.location[0];
|
package/dist/src/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAC3B,QAAQ,CAAkB;IAC1B,WAAW,CAAS;IAE3B,YAAY,OAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,SAAU,SAAQ,KAAK;IAC3B,QAAQ,CAAkB;IAC1B,WAAW,CAAS;IAE3B,YAAY,OAAe,EAAE,OAAmD;QAC9E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAEQ,QAAQ;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;QAEhF,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,0DAA0D;QAC1D,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACvC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACnD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,wCAAwC;IACxC,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;CACF"}
|
package/dist/src/expr/array.js
CHANGED
|
@@ -59,7 +59,7 @@ export class ArrayExpr extends Expr {
|
|
|
59
59
|
return this[FactorySymbol]({
|
|
60
60
|
ast_type: "Builtin",
|
|
61
61
|
type: IntegerType,
|
|
62
|
-
location: get_location(
|
|
62
|
+
location: get_location(),
|
|
63
63
|
builtin: "ArraySize",
|
|
64
64
|
type_parameters: [this.value_type],
|
|
65
65
|
arguments: [this[AstSymbol]],
|
|
@@ -84,7 +84,7 @@ export class ArrayExpr extends Expr {
|
|
|
84
84
|
return this[FactorySymbol]({
|
|
85
85
|
ast_type: "Builtin",
|
|
86
86
|
type: IntegerType,
|
|
87
|
-
location: get_location(
|
|
87
|
+
location: get_location(),
|
|
88
88
|
builtin: "ArraySize",
|
|
89
89
|
type_parameters: [this.value_type],
|
|
90
90
|
arguments: [this[AstSymbol]],
|
|
@@ -112,7 +112,7 @@ export class ArrayExpr extends Expr {
|
|
|
112
112
|
return this[FactorySymbol]({
|
|
113
113
|
ast_type: "Builtin",
|
|
114
114
|
type: BooleanType,
|
|
115
|
-
location: get_location(
|
|
115
|
+
location: get_location(),
|
|
116
116
|
builtin: "ArrayHas",
|
|
117
117
|
type_parameters: [this.value_type],
|
|
118
118
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -151,7 +151,7 @@ export class ArrayExpr extends Expr {
|
|
|
151
151
|
return this[FactorySymbol]({
|
|
152
152
|
ast_type: "Builtin",
|
|
153
153
|
type: this.value_type,
|
|
154
|
-
location: get_location(
|
|
154
|
+
location: get_location(),
|
|
155
155
|
builtin: "ArrayGetOrDefault",
|
|
156
156
|
type_parameters: [this.value_type],
|
|
157
157
|
arguments: [this[AstSymbol], keyAst, defaultFnAst],
|
|
@@ -161,7 +161,7 @@ export class ArrayExpr extends Expr {
|
|
|
161
161
|
return this[FactorySymbol]({
|
|
162
162
|
ast_type: "Builtin",
|
|
163
163
|
type: this.value_type,
|
|
164
|
-
location: get_location(
|
|
164
|
+
location: get_location(),
|
|
165
165
|
builtin: "ArrayGet",
|
|
166
166
|
type_parameters: [this.value_type],
|
|
167
167
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -201,7 +201,7 @@ export class ArrayExpr extends Expr {
|
|
|
201
201
|
return this[FactorySymbol]({
|
|
202
202
|
ast_type: "Builtin",
|
|
203
203
|
type: this.value_type,
|
|
204
|
-
location: get_location(
|
|
204
|
+
location: get_location(),
|
|
205
205
|
builtin: "ArrayGetOrDefault",
|
|
206
206
|
type_parameters: [this.value_type],
|
|
207
207
|
arguments: [this[AstSymbol], keyAst, defaultFnAst],
|
|
@@ -211,7 +211,7 @@ export class ArrayExpr extends Expr {
|
|
|
211
211
|
return this[FactorySymbol]({
|
|
212
212
|
ast_type: "Builtin",
|
|
213
213
|
type: this.value_type,
|
|
214
|
-
location: get_location(
|
|
214
|
+
location: get_location(),
|
|
215
215
|
builtin: "ArrayGet",
|
|
216
216
|
type_parameters: [this.value_type],
|
|
217
217
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -239,7 +239,7 @@ export class ArrayExpr extends Expr {
|
|
|
239
239
|
return this[FactorySymbol]({
|
|
240
240
|
ast_type: "Builtin",
|
|
241
241
|
type: OptionType(this.value_type),
|
|
242
|
-
location: get_location(
|
|
242
|
+
location: get_location(),
|
|
243
243
|
builtin: "ArrayTryGet",
|
|
244
244
|
type_parameters: [this.value_type],
|
|
245
245
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -270,7 +270,7 @@ export class ArrayExpr extends Expr {
|
|
|
270
270
|
return this[FactorySymbol]({
|
|
271
271
|
ast_type: "Builtin",
|
|
272
272
|
type: NullType,
|
|
273
|
-
location: get_location(
|
|
273
|
+
location: get_location(),
|
|
274
274
|
builtin: "ArrayUpdate",
|
|
275
275
|
type_parameters: [this.value_type],
|
|
276
276
|
arguments: [this[AstSymbol], keyAst, valueAst],
|
|
@@ -283,7 +283,7 @@ export class ArrayExpr extends Expr {
|
|
|
283
283
|
* @see {@link update} for simply replacing the value.
|
|
284
284
|
*/
|
|
285
285
|
merge(key, value, updateFn) {
|
|
286
|
-
const location = get_location(
|
|
286
|
+
const location = get_location();
|
|
287
287
|
const keyAst = valueOrExprToAstTyped(key, IntegerType);
|
|
288
288
|
const value2Type = value[TypeSymbol];
|
|
289
289
|
const updateFnExpr = Expr.from(updateFn, FunctionType([value2Type, this.value_type, IntegerType], this.value_type));
|
|
@@ -317,7 +317,7 @@ export class ArrayExpr extends Expr {
|
|
|
317
317
|
return this[FactorySymbol]({
|
|
318
318
|
ast_type: "Builtin",
|
|
319
319
|
type: NullType,
|
|
320
|
-
location: get_location(
|
|
320
|
+
location: get_location(),
|
|
321
321
|
builtin: "ArrayPushLast",
|
|
322
322
|
type_parameters: [this.value_type],
|
|
323
323
|
arguments: [this[AstSymbol], valueAst],
|
|
@@ -343,7 +343,7 @@ export class ArrayExpr extends Expr {
|
|
|
343
343
|
return this[FactorySymbol]({
|
|
344
344
|
ast_type: "Builtin",
|
|
345
345
|
type: this.value_type,
|
|
346
|
-
location: get_location(
|
|
346
|
+
location: get_location(),
|
|
347
347
|
builtin: "ArrayPopLast",
|
|
348
348
|
type_parameters: [this.value_type],
|
|
349
349
|
arguments: [this[AstSymbol]],
|
|
@@ -370,7 +370,7 @@ export class ArrayExpr extends Expr {
|
|
|
370
370
|
return this[FactorySymbol]({
|
|
371
371
|
ast_type: "Builtin",
|
|
372
372
|
type: NullType,
|
|
373
|
-
location: get_location(
|
|
373
|
+
location: get_location(),
|
|
374
374
|
builtin: "ArrayPushFirst",
|
|
375
375
|
type_parameters: [this.value_type],
|
|
376
376
|
arguments: [this[AstSymbol], valueAst],
|
|
@@ -396,7 +396,7 @@ export class ArrayExpr extends Expr {
|
|
|
396
396
|
return this[FactorySymbol]({
|
|
397
397
|
ast_type: "Builtin",
|
|
398
398
|
type: this.value_type,
|
|
399
|
-
location: get_location(
|
|
399
|
+
location: get_location(),
|
|
400
400
|
builtin: "ArrayPopFirst",
|
|
401
401
|
type_parameters: [this.value_type],
|
|
402
402
|
arguments: [this[AstSymbol]],
|
|
@@ -423,7 +423,7 @@ export class ArrayExpr extends Expr {
|
|
|
423
423
|
return this[FactorySymbol]({
|
|
424
424
|
ast_type: "Builtin",
|
|
425
425
|
type: NullType,
|
|
426
|
-
location: get_location(
|
|
426
|
+
location: get_location(),
|
|
427
427
|
builtin: "ArrayAppend",
|
|
428
428
|
type_parameters: [this.value_type],
|
|
429
429
|
arguments: [this[AstSymbol], arrayExpr[AstSymbol]],
|
|
@@ -451,7 +451,7 @@ export class ArrayExpr extends Expr {
|
|
|
451
451
|
return this[FactorySymbol]({
|
|
452
452
|
ast_type: "Builtin",
|
|
453
453
|
type: NullType,
|
|
454
|
-
location: get_location(
|
|
454
|
+
location: get_location(),
|
|
455
455
|
builtin: "ArrayPrepend",
|
|
456
456
|
type_parameters: [this.value_type],
|
|
457
457
|
arguments: [this[AstSymbol], arrayExpr[AstSymbol]],
|
|
@@ -499,7 +499,7 @@ export class ArrayExpr extends Expr {
|
|
|
499
499
|
return this[FactorySymbol]({
|
|
500
500
|
ast_type: "Builtin",
|
|
501
501
|
type: NullType,
|
|
502
|
-
location: get_location(
|
|
502
|
+
location: get_location(),
|
|
503
503
|
builtin: "ArrayMergeAll",
|
|
504
504
|
type_parameters: [this.value_type, value2Type],
|
|
505
505
|
arguments: [this[AstSymbol], array[AstSymbol], mergeFnExpr[AstSymbol]],
|
|
@@ -524,7 +524,7 @@ export class ArrayExpr extends Expr {
|
|
|
524
524
|
return this[FactorySymbol]({
|
|
525
525
|
ast_type: "Builtin",
|
|
526
526
|
type: NullType,
|
|
527
|
-
location: get_location(
|
|
527
|
+
location: get_location(),
|
|
528
528
|
builtin: "ArrayClear",
|
|
529
529
|
type_parameters: [this.value_type],
|
|
530
530
|
arguments: [this[AstSymbol]],
|
|
@@ -580,7 +580,7 @@ export class ArrayExpr extends Expr {
|
|
|
580
580
|
return this[FactorySymbol]({
|
|
581
581
|
ast_type: "Builtin",
|
|
582
582
|
type: NullType,
|
|
583
|
-
location: get_location(
|
|
583
|
+
location: get_location(),
|
|
584
584
|
builtin: "ArraySortInPlace",
|
|
585
585
|
type_parameters: [this.value_type, projectedType],
|
|
586
586
|
arguments: [this[AstSymbol], byExpr[AstSymbol]],
|
|
@@ -635,7 +635,7 @@ export class ArrayExpr extends Expr {
|
|
|
635
635
|
return this[FactorySymbol]({
|
|
636
636
|
ast_type: "Builtin",
|
|
637
637
|
type: this[TypeSymbol],
|
|
638
|
-
location: get_location(
|
|
638
|
+
location: get_location(),
|
|
639
639
|
builtin: "ArraySort",
|
|
640
640
|
type_parameters: [this.value_type, projectedType],
|
|
641
641
|
arguments: [this[AstSymbol], byExpr[AstSymbol]],
|
|
@@ -662,7 +662,7 @@ export class ArrayExpr extends Expr {
|
|
|
662
662
|
return this[FactorySymbol]({
|
|
663
663
|
ast_type: "Builtin",
|
|
664
664
|
type: NullType,
|
|
665
|
-
location: get_location(
|
|
665
|
+
location: get_location(),
|
|
666
666
|
builtin: "ArrayReverseInPlace",
|
|
667
667
|
type_parameters: [this.value_type],
|
|
668
668
|
arguments: [this[AstSymbol]],
|
|
@@ -691,7 +691,7 @@ export class ArrayExpr extends Expr {
|
|
|
691
691
|
return this[FactorySymbol]({
|
|
692
692
|
ast_type: "Builtin",
|
|
693
693
|
type: this[TypeSymbol],
|
|
694
|
-
location: get_location(
|
|
694
|
+
location: get_location(),
|
|
695
695
|
builtin: "ArrayReverse",
|
|
696
696
|
type_parameters: [this.value_type],
|
|
697
697
|
arguments: [this[AstSymbol]],
|
|
@@ -740,7 +740,7 @@ export class ArrayExpr extends Expr {
|
|
|
740
740
|
return this[FactorySymbol]({
|
|
741
741
|
ast_type: "Builtin",
|
|
742
742
|
type: BooleanType,
|
|
743
|
-
location: get_location(
|
|
743
|
+
location: get_location(),
|
|
744
744
|
builtin: "ArrayIsSorted",
|
|
745
745
|
type_parameters: [this.value_type, projectedType],
|
|
746
746
|
arguments: [this[AstSymbol], byExpr[AstSymbol]],
|
|
@@ -797,7 +797,7 @@ export class ArrayExpr extends Expr {
|
|
|
797
797
|
return this[FactorySymbol]({
|
|
798
798
|
ast_type: "Builtin",
|
|
799
799
|
type: IntegerType,
|
|
800
|
-
location: get_location(
|
|
800
|
+
location: get_location(),
|
|
801
801
|
builtin: "ArrayFindSortedFirst",
|
|
802
802
|
type_parameters: [this.value_type, projectedType],
|
|
803
803
|
arguments: [this[AstSymbol], valueAst, byExpr[AstSymbol]],
|
|
@@ -842,7 +842,7 @@ export class ArrayExpr extends Expr {
|
|
|
842
842
|
return this[FactorySymbol]({
|
|
843
843
|
ast_type: "Builtin",
|
|
844
844
|
type: IntegerType,
|
|
845
|
-
location: get_location(
|
|
845
|
+
location: get_location(),
|
|
846
846
|
builtin: "ArrayFindSortedLast",
|
|
847
847
|
type_parameters: [this.value_type, projectedType],
|
|
848
848
|
arguments: [this[AstSymbol], valueAst, byExpr[AstSymbol]],
|
|
@@ -886,7 +886,7 @@ export class ArrayExpr extends Expr {
|
|
|
886
886
|
return this[FactorySymbol]({
|
|
887
887
|
ast_type: "Builtin",
|
|
888
888
|
type: StructType({ start: IntegerType, end: IntegerType }),
|
|
889
|
-
location: get_location(
|
|
889
|
+
location: get_location(),
|
|
890
890
|
builtin: "ArrayFindSortedRange",
|
|
891
891
|
type_parameters: [this.value_type, projectedType],
|
|
892
892
|
arguments: [this[AstSymbol], valueAst, byExpr[AstSymbol]],
|
|
@@ -918,7 +918,7 @@ export class ArrayExpr extends Expr {
|
|
|
918
918
|
return this[FactorySymbol]({
|
|
919
919
|
ast_type: "Builtin",
|
|
920
920
|
type: this[TypeSymbol],
|
|
921
|
-
location: get_location(
|
|
921
|
+
location: get_location(),
|
|
922
922
|
builtin: "ArraySlice",
|
|
923
923
|
type_parameters: [this.value_type],
|
|
924
924
|
arguments: [this[AstSymbol], startExpr[AstSymbol], endExpr[AstSymbol]],
|
|
@@ -947,7 +947,7 @@ export class ArrayExpr extends Expr {
|
|
|
947
947
|
return this[FactorySymbol]({
|
|
948
948
|
ast_type: "Builtin",
|
|
949
949
|
type: this[TypeSymbol],
|
|
950
|
-
location: get_location(
|
|
950
|
+
location: get_location(),
|
|
951
951
|
builtin: "ArrayConcat",
|
|
952
952
|
type_parameters: [this.value_type],
|
|
953
953
|
arguments: [this[AstSymbol], otherExpr[AstSymbol]],
|
|
@@ -985,7 +985,7 @@ export class ArrayExpr extends Expr {
|
|
|
985
985
|
const keysExpr = Expr.from(keys, ArrayType(IntegerType));
|
|
986
986
|
let default_function_ast;
|
|
987
987
|
if (onMissing === undefined) {
|
|
988
|
-
const location = get_location(
|
|
988
|
+
const location = get_location();
|
|
989
989
|
const default_function = Expr.function([IntegerType], this.value_type, ($, key) => $.error(Expr.str `Cannot get key ${key} from array`, location));
|
|
990
990
|
default_function_ast = Expr.ast(default_function);
|
|
991
991
|
}
|
|
@@ -996,7 +996,7 @@ export class ArrayExpr extends Expr {
|
|
|
996
996
|
return this[FactorySymbol]({
|
|
997
997
|
ast_type: "Builtin",
|
|
998
998
|
type: this[TypeSymbol],
|
|
999
|
-
location: get_location(
|
|
999
|
+
location: get_location(),
|
|
1000
1000
|
builtin: "ArrayGetKeys",
|
|
1001
1001
|
type_parameters: [this.value_type],
|
|
1002
1002
|
arguments: [this[AstSymbol], keysExpr[AstSymbol], default_function_ast],
|
|
@@ -1031,7 +1031,7 @@ export class ArrayExpr extends Expr {
|
|
|
1031
1031
|
return this[FactorySymbol]({
|
|
1032
1032
|
ast_type: "Builtin",
|
|
1033
1033
|
type: NullType,
|
|
1034
|
-
location: get_location(
|
|
1034
|
+
location: get_location(),
|
|
1035
1035
|
builtin: "ArrayForEach",
|
|
1036
1036
|
type_parameters: [this.value_type, returnType],
|
|
1037
1037
|
arguments: [this[AstSymbol], fn[AstSymbol]],
|
|
@@ -1062,7 +1062,7 @@ export class ArrayExpr extends Expr {
|
|
|
1062
1062
|
return this[FactorySymbol]({
|
|
1063
1063
|
ast_type: "Builtin",
|
|
1064
1064
|
type: this[TypeSymbol],
|
|
1065
|
-
location: get_location(
|
|
1065
|
+
location: get_location(),
|
|
1066
1066
|
builtin: "ArrayCopy",
|
|
1067
1067
|
type_parameters: [this.value_type],
|
|
1068
1068
|
arguments: [this[AstSymbol]],
|
|
@@ -1088,7 +1088,7 @@ export class ArrayExpr extends Expr {
|
|
|
1088
1088
|
return this[FactorySymbol]({
|
|
1089
1089
|
ast_type: "Builtin",
|
|
1090
1090
|
type: ArrayType(output_type),
|
|
1091
|
-
location: get_location(
|
|
1091
|
+
location: get_location(),
|
|
1092
1092
|
builtin: "ArrayMap",
|
|
1093
1093
|
type_parameters: [this.value_type, output_type],
|
|
1094
1094
|
arguments: [this[AstSymbol], fn[AstSymbol]],
|
|
@@ -1160,7 +1160,7 @@ export class ArrayExpr extends Expr {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
return this[FactorySymbol]({
|
|
1162
1162
|
ast_type: "Builtin",
|
|
1163
|
-
location: get_location(
|
|
1163
|
+
location: get_location(),
|
|
1164
1164
|
type: this[TypeSymbol],
|
|
1165
1165
|
builtin: "ArrayFilter",
|
|
1166
1166
|
type_parameters: [this.value_type],
|
|
@@ -1184,7 +1184,7 @@ export class ArrayExpr extends Expr {
|
|
|
1184
1184
|
return this[FactorySymbol]({
|
|
1185
1185
|
ast_type: "Builtin",
|
|
1186
1186
|
type: ArrayType(someType),
|
|
1187
|
-
location: get_location(
|
|
1187
|
+
location: get_location(),
|
|
1188
1188
|
builtin: "ArrayFilterMap",
|
|
1189
1189
|
type_parameters: [this.value_type, someType],
|
|
1190
1190
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1203,7 +1203,7 @@ export class ArrayExpr extends Expr {
|
|
|
1203
1203
|
return this[FactorySymbol]({
|
|
1204
1204
|
ast_type: "Builtin",
|
|
1205
1205
|
type: returnType,
|
|
1206
|
-
location: get_location(
|
|
1206
|
+
location: get_location(),
|
|
1207
1207
|
builtin: "ArrayFirstMap",
|
|
1208
1208
|
type_parameters: [this.value_type, someType],
|
|
1209
1209
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1290,7 +1290,7 @@ export class ArrayExpr extends Expr {
|
|
|
1290
1290
|
return this[FactorySymbol]({
|
|
1291
1291
|
ast_type: "Builtin",
|
|
1292
1292
|
type: returnType,
|
|
1293
|
-
location: get_location(
|
|
1293
|
+
location: get_location(),
|
|
1294
1294
|
builtin: "ArrayFold",
|
|
1295
1295
|
type_parameters: [this.value_type, returnType],
|
|
1296
1296
|
arguments: [this[AstSymbol], initAst, combineAst],
|
|
@@ -1303,7 +1303,7 @@ export class ArrayExpr extends Expr {
|
|
|
1303
1303
|
return this[FactorySymbol]({
|
|
1304
1304
|
ast_type: "Builtin",
|
|
1305
1305
|
type: mapType,
|
|
1306
|
-
location: get_location(
|
|
1306
|
+
location: get_location(),
|
|
1307
1307
|
builtin: "ArrayMapReduce",
|
|
1308
1308
|
type_parameters: [this.value_type, mapType],
|
|
1309
1309
|
arguments: [this[AstSymbol], mapAst, combineAst],
|
|
@@ -1593,7 +1593,7 @@ export class ArrayExpr extends Expr {
|
|
|
1593
1593
|
return this[FactorySymbol]({
|
|
1594
1594
|
ast_type: "Builtin",
|
|
1595
1595
|
type: StringType,
|
|
1596
|
-
location: get_location(
|
|
1596
|
+
location: get_location(),
|
|
1597
1597
|
builtin: "ArrayStringJoin",
|
|
1598
1598
|
type_parameters: [],
|
|
1599
1599
|
arguments: [this[AstSymbol], stringAst],
|
|
@@ -1605,7 +1605,7 @@ export class ArrayExpr extends Expr {
|
|
|
1605
1605
|
return this[FactorySymbol]({
|
|
1606
1606
|
ast_type: "Builtin",
|
|
1607
1607
|
type: SetType(keyType),
|
|
1608
|
-
location: get_location(
|
|
1608
|
+
location: get_location(),
|
|
1609
1609
|
builtin: "ArrayToSet",
|
|
1610
1610
|
type_parameters: [this.value_type, keyType],
|
|
1611
1611
|
arguments: [this[AstSymbol], keyFnAst],
|
|
@@ -1618,7 +1618,7 @@ export class ArrayExpr extends Expr {
|
|
|
1618
1618
|
const valueType = valueFnAst.type.output;
|
|
1619
1619
|
let onConflictAst;
|
|
1620
1620
|
if (onConflictFn === undefined) {
|
|
1621
|
-
const location = get_location(
|
|
1621
|
+
const location = get_location();
|
|
1622
1622
|
const onConflictFunction = Expr.function([valueType, valueType, keyType], valueType, ($, existing, value, key) => $.error(Expr.str `Cannot insert duplicate key ${key} into dict`, location));
|
|
1623
1623
|
onConflictAst = Expr.ast(onConflictFunction);
|
|
1624
1624
|
}
|
|
@@ -1628,7 +1628,7 @@ export class ArrayExpr extends Expr {
|
|
|
1628
1628
|
return this[FactorySymbol]({
|
|
1629
1629
|
ast_type: "Builtin",
|
|
1630
1630
|
type: DictType(keyType, valueType),
|
|
1631
|
-
location: get_location(
|
|
1631
|
+
location: get_location(),
|
|
1632
1632
|
builtin: "ArrayToDict",
|
|
1633
1633
|
type_parameters: [this.value_type, keyType, valueType],
|
|
1634
1634
|
arguments: [this[AstSymbol], keyFnAst, valueFnAst, onConflictAst],
|
|
@@ -1644,7 +1644,7 @@ export class ArrayExpr extends Expr {
|
|
|
1644
1644
|
return this[FactorySymbol]({
|
|
1645
1645
|
ast_type: "Builtin",
|
|
1646
1646
|
type: ArrayType(elementType),
|
|
1647
|
-
location: get_location(
|
|
1647
|
+
location: get_location(),
|
|
1648
1648
|
builtin: "ArrayFlattenToArray",
|
|
1649
1649
|
type_parameters: [this.value_type, elementType],
|
|
1650
1650
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1660,7 +1660,7 @@ export class ArrayExpr extends Expr {
|
|
|
1660
1660
|
return this[FactorySymbol]({
|
|
1661
1661
|
ast_type: "Builtin",
|
|
1662
1662
|
type: SetType(elementType),
|
|
1663
|
-
location: get_location(
|
|
1663
|
+
location: get_location(),
|
|
1664
1664
|
builtin: "ArrayFlattenToSet",
|
|
1665
1665
|
type_parameters: [this.value_type, elementType],
|
|
1666
1666
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1676,7 +1676,7 @@ export class ArrayExpr extends Expr {
|
|
|
1676
1676
|
const valueType = returnType.value;
|
|
1677
1677
|
let onConflictAst;
|
|
1678
1678
|
if (onConflictFn === undefined) {
|
|
1679
|
-
const location = get_location(
|
|
1679
|
+
const location = get_location();
|
|
1680
1680
|
const onConflictFunction = Expr.function([valueType, valueType, keyType], valueType, ($, existing, value, key) => $.error(Expr.str `Cannot insert duplicate key ${key} into dict`, location));
|
|
1681
1681
|
onConflictAst = Expr.ast(onConflictFunction);
|
|
1682
1682
|
}
|
|
@@ -1686,7 +1686,7 @@ export class ArrayExpr extends Expr {
|
|
|
1686
1686
|
return this[FactorySymbol]({
|
|
1687
1687
|
ast_type: "Builtin",
|
|
1688
1688
|
type: DictType(keyType, valueType),
|
|
1689
|
-
location: get_location(
|
|
1689
|
+
location: get_location(),
|
|
1690
1690
|
builtin: "ArrayFlattenToDict",
|
|
1691
1691
|
type_parameters: [this.value_type, keyType, valueType],
|
|
1692
1692
|
arguments: [this[AstSymbol], fnAst, onConflictAst],
|
|
@@ -1702,7 +1702,7 @@ export class ArrayExpr extends Expr {
|
|
|
1702
1702
|
return this[FactorySymbol]({
|
|
1703
1703
|
ast_type: "Builtin",
|
|
1704
1704
|
type: DictType(keyType, initType),
|
|
1705
|
-
location: get_location(
|
|
1705
|
+
location: get_location(),
|
|
1706
1706
|
builtin: "ArrayGroupFold",
|
|
1707
1707
|
type_parameters: [this.value_type, keyType, initType],
|
|
1708
1708
|
arguments: [this[AstSymbol], keyFnAst, initFnAst, reduceFnAst],
|
|
@@ -1906,7 +1906,7 @@ export class ArrayExpr extends Expr {
|
|
|
1906
1906
|
return this[FactorySymbol]({
|
|
1907
1907
|
ast_type: "Builtin",
|
|
1908
1908
|
type: BlobType,
|
|
1909
|
-
location: get_location(
|
|
1909
|
+
location: get_location(),
|
|
1910
1910
|
builtin: "ArrayEncodeCsv",
|
|
1911
1911
|
type_parameters: [this.value_type, CsvSerializeConfigType],
|
|
1912
1912
|
arguments: [this[AstSymbol], configAst],
|