@elaraai/east 0.0.1-beta.3 → 0.0.1-beta.31
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/LICENSE.md +15 -666
- package/README.md +30 -8
- package/dist/src/analyze.d.ts +3 -0
- package/dist/src/analyze.d.ts.map +1 -1
- package/dist/src/analyze.js +76 -15
- package/dist/src/analyze.js.map +1 -1
- package/dist/src/ast.d.ts +37 -33
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast_to_ir.d.ts +6 -0
- package/dist/src/ast_to_ir.d.ts.map +1 -1
- package/dist/src/ast_to_ir.js +135 -101
- package/dist/src/ast_to_ir.js.map +1 -1
- package/dist/src/builtins.d.ts +1 -1
- package/dist/src/builtins.d.ts.map +1 -1
- package/dist/src/builtins.js +32 -0
- package/dist/src/builtins.js.map +1 -1
- package/dist/src/comparison.d.ts.map +1 -1
- package/dist/src/comparison.js +12 -4
- package/dist/src/comparison.js.map +1 -1
- package/dist/src/compile.d.ts +26 -1
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +388 -257
- package/dist/src/compile.js.map +1 -1
- package/dist/src/datetime_format/types.d.ts +23 -23
- package/dist/src/eastir.d.ts +4 -0
- package/dist/src/eastir.d.ts.map +1 -1
- package/dist/src/eastir.js +27 -7
- package/dist/src/eastir.js.map +1 -1
- package/dist/src/error.d.ts +12 -1
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +31 -1
- package/dist/src/error.js.map +1 -1
- package/dist/src/expr/array.d.ts +109 -1
- package/dist/src/expr/array.d.ts.map +1 -1
- package/dist/src/expr/array.js +204 -44
- 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 +16 -28
- 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.d.ts +73 -1
- package/dist/src/expr/blob.d.ts.map +1 -1
- package/dist/src/expr/blob.js +97 -7
- package/dist/src/expr/blob.js.map +1 -1
- package/dist/src/expr/block.d.ts +232 -12
- package/dist/src/expr/block.d.ts.map +1 -1
- package/dist/src/expr/block.js +646 -140
- package/dist/src/expr/block.js.map +1 -1
- package/dist/src/expr/boolean.d.ts +44 -0
- package/dist/src/expr/boolean.d.ts.map +1 -1
- package/dist/src/expr/boolean.js +57 -5
- package/dist/src/expr/boolean.js.map +1 -1
- package/dist/src/expr/datetime.d.ts +135 -0
- package/dist/src/expr/datetime.d.ts.map +1 -1
- package/dist/src/expr/datetime.js +183 -33
- package/dist/src/expr/datetime.js.map +1 -1
- package/dist/src/expr/dict.d.ts +42 -0
- package/dist/src/expr/dict.d.ts.map +1 -1
- package/dist/src/expr/dict.js +105 -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.d.ts +153 -0
- package/dist/src/expr/float.d.ts.map +1 -1
- package/dist/src/expr/float.js +190 -16
- package/dist/src/expr/float.js.map +1 -1
- package/dist/src/expr/function.d.ts +7 -2
- package/dist/src/expr/function.d.ts.map +1 -1
- package/dist/src/expr/function.js +1 -1
- package/dist/src/expr/function.js.map +1 -1
- package/dist/src/expr/index.d.ts +202 -2
- package/dist/src/expr/index.d.ts.map +1 -1
- package/dist/src/expr/index.js +207 -2
- package/dist/src/expr/index.js.map +1 -1
- package/dist/src/expr/integer.d.ts +180 -0
- package/dist/src/expr/integer.d.ts.map +1 -1
- package/dist/src/expr/integer.js +188 -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/integer.d.ts +19 -0
- package/dist/src/expr/libs/integer.d.ts.map +1 -1
- package/dist/src/expr/libs/integer.js +47 -0
- package/dist/src/expr/libs/integer.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.d.ts +83 -0
- package/dist/src/expr/recursive.d.ts.map +1 -0
- package/dist/src/expr/recursive.js +99 -0
- package/dist/src/expr/recursive.js.map +1 -0
- package/dist/src/expr/ref.js +3 -3
- package/dist/src/expr/ref.js.map +1 -1
- package/dist/src/expr/set.d.ts +44 -2
- package/dist/src/expr/set.d.ts.map +1 -1
- package/dist/src/expr/set.js +97 -47
- package/dist/src/expr/set.js.map +1 -1
- package/dist/src/expr/string.d.ts +134 -0
- package/dist/src/expr/string.d.ts.map +1 -1
- package/dist/src/expr/string.js +172 -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/types.d.ts +7 -6
- package/dist/src/expr/types.d.ts.map +1 -1
- package/dist/src/expr/variant.d.ts +123 -1
- package/dist/src/expr/variant.d.ts.map +1 -1
- package/dist/src/expr/variant.js +66 -2
- package/dist/src/expr/variant.js.map +1 -1
- package/dist/src/fuzz.d.ts +36 -2
- package/dist/src/fuzz.d.ts.map +1 -1
- package/dist/src/fuzz.js +344 -77
- package/dist/src/fuzz.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +12 -0
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +13 -0
- package/dist/src/internal.js.map +1 -1
- package/dist/src/ir.d.ts +1551 -1505
- 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/patch/apply.d.ts +15 -0
- package/dist/src/patch/apply.d.ts.map +1 -0
- package/dist/src/patch/apply.js +380 -0
- package/dist/src/patch/apply.js.map +1 -0
- package/dist/src/patch/compose.d.ts +15 -0
- package/dist/src/patch/compose.d.ts.map +1 -0
- package/dist/src/patch/compose.js +480 -0
- package/dist/src/patch/compose.js.map +1 -0
- package/dist/src/patch/diff.d.ts +15 -0
- package/dist/src/patch/diff.d.ts.map +1 -0
- package/dist/src/patch/diff.js +328 -0
- package/dist/src/patch/diff.js.map +1 -0
- package/dist/src/patch/fuzz.d.ts +73 -0
- package/dist/src/patch/fuzz.d.ts.map +1 -0
- package/dist/src/patch/fuzz.js +159 -0
- package/dist/src/patch/fuzz.js.map +1 -0
- package/dist/src/patch/index.d.ts +18 -0
- package/dist/src/patch/index.d.ts.map +1 -0
- package/dist/src/patch/index.js +20 -0
- package/dist/src/patch/index.js.map +1 -0
- package/dist/src/patch/invert.d.ts +15 -0
- package/dist/src/patch/invert.d.ts.map +1 -0
- package/dist/src/patch/invert.js +302 -0
- package/dist/src/patch/invert.js.map +1 -0
- package/dist/src/patch/type_of_patch.d.ts +17 -0
- package/dist/src/patch/type_of_patch.d.ts.map +1 -0
- package/dist/src/patch/type_of_patch.js +143 -0
- package/dist/src/patch/type_of_patch.js.map +1 -0
- package/dist/src/patch/types.d.ts +166 -0
- package/dist/src/patch/types.d.ts.map +1 -0
- package/dist/src/patch/types.js +69 -0
- package/dist/src/patch/types.js.map +1 -0
- package/dist/src/platform.d.ts +6 -0
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/serialization/beast.d.ts.map +1 -1
- package/dist/src/serialization/beast.js +53 -18
- package/dist/src/serialization/beast.js.map +1 -1
- package/dist/src/serialization/beast2.d.ts +39 -3
- package/dist/src/serialization/beast2.d.ts.map +1 -1
- package/dist/src/serialization/beast2.js +241 -18
- package/dist/src/serialization/beast2.js.map +1 -1
- package/dist/src/serialization/csv.d.ts +139 -0
- package/dist/src/serialization/csv.d.ts.map +1 -0
- package/dist/src/serialization/csv.js +615 -0
- package/dist/src/serialization/csv.js.map +1 -0
- package/dist/src/serialization/index.d.ts +2 -1
- package/dist/src/serialization/index.d.ts.map +1 -1
- package/dist/src/serialization/index.js +2 -1
- package/dist/src/serialization/index.js.map +1 -1
- package/dist/src/type_of_type.d.ts +45 -34
- package/dist/src/type_of_type.d.ts.map +1 -1
- package/dist/src/type_of_type.js +62 -1
- package/dist/src/type_of_type.js.map +1 -1
- package/dist/src/types.d.ts +8 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +4 -4
- package/dist/src/types.js.map +1 -1
- package/package.json +4 -5
|
@@ -6,6 +6,7 @@ import type { AST } from "../ast.js";
|
|
|
6
6
|
import { FloatType, IntegerType } from "../types.js";
|
|
7
7
|
import { Expr, type ToExpr } from "./expr.js";
|
|
8
8
|
import type { FloatExpr } from "./float.js";
|
|
9
|
+
import type { BooleanExpr } from "./boolean.js";
|
|
9
10
|
/**
|
|
10
11
|
* Expression representing integer values and operations.
|
|
11
12
|
*
|
|
@@ -252,5 +253,184 @@ export declare class IntegerExpr extends Expr<IntegerType> {
|
|
|
252
253
|
* ```
|
|
253
254
|
*/
|
|
254
255
|
toFloat(): FloatExpr;
|
|
256
|
+
/**
|
|
257
|
+
* Checks if this integer equals another value.
|
|
258
|
+
*
|
|
259
|
+
* @param other - The value to compare against
|
|
260
|
+
* @returns A BooleanExpr that is true if the values are equal
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```ts
|
|
264
|
+
* const isEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
265
|
+
* $.return(a.equals(b));
|
|
266
|
+
* });
|
|
267
|
+
* const compiled = East.compile(isEqual.toIR(), []);
|
|
268
|
+
* compiled(5n, 5n); // true
|
|
269
|
+
* compiled(5n, 3n); // false
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
equals(other: IntegerExpr | bigint): BooleanExpr;
|
|
273
|
+
/**
|
|
274
|
+
* Checks if this integer does not equal another value.
|
|
275
|
+
*
|
|
276
|
+
* @param other - The value to compare against
|
|
277
|
+
* @returns A BooleanExpr that is true if the values are not equal
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```ts
|
|
281
|
+
* const isNotEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
282
|
+
* $.return(a.notEquals(b));
|
|
283
|
+
* });
|
|
284
|
+
* const compiled = East.compile(isNotEqual.toIR(), []);
|
|
285
|
+
* compiled(5n, 3n); // true
|
|
286
|
+
* compiled(5n, 5n); // false
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
notEquals(other: IntegerExpr | bigint): BooleanExpr;
|
|
290
|
+
/**
|
|
291
|
+
* Checks if this integer is greater than another value.
|
|
292
|
+
*
|
|
293
|
+
* @param other - The value to compare against
|
|
294
|
+
* @returns A BooleanExpr that is true if this value is greater
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```ts
|
|
298
|
+
* const isGreater = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
299
|
+
* $.return(a.greaterThan(b));
|
|
300
|
+
* });
|
|
301
|
+
* const compiled = East.compile(isGreater.toIR(), []);
|
|
302
|
+
* compiled(5n, 3n); // true
|
|
303
|
+
* compiled(3n, 5n); // false
|
|
304
|
+
* compiled(5n, 5n); // false
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
greaterThan(other: IntegerExpr | bigint): BooleanExpr;
|
|
308
|
+
/**
|
|
309
|
+
* Checks if this integer is less than another value.
|
|
310
|
+
*
|
|
311
|
+
* @param other - The value to compare against
|
|
312
|
+
* @returns A BooleanExpr that is true if this value is less
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```ts
|
|
316
|
+
* const isLess = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
317
|
+
* $.return(a.lessThan(b));
|
|
318
|
+
* });
|
|
319
|
+
* const compiled = East.compile(isLess.toIR(), []);
|
|
320
|
+
* compiled(3n, 5n); // true
|
|
321
|
+
* compiled(5n, 3n); // false
|
|
322
|
+
* compiled(5n, 5n); // false
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
lessThan(other: IntegerExpr | bigint): BooleanExpr;
|
|
326
|
+
/**
|
|
327
|
+
* Checks if this integer is greater than or equal to another value.
|
|
328
|
+
*
|
|
329
|
+
* @param other - The value to compare against
|
|
330
|
+
* @returns A BooleanExpr that is true if this value is greater than or equal
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```ts
|
|
334
|
+
* const isGreaterOrEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
335
|
+
* $.return(a.greaterThanOrEqual(b));
|
|
336
|
+
* });
|
|
337
|
+
* const compiled = East.compile(isGreaterOrEqual.toIR(), []);
|
|
338
|
+
* compiled(5n, 3n); // true
|
|
339
|
+
* compiled(5n, 5n); // true
|
|
340
|
+
* compiled(3n, 5n); // false
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
greaterThanOrEqual(other: IntegerExpr | bigint): BooleanExpr;
|
|
344
|
+
/**
|
|
345
|
+
* Checks if this integer is less than or equal to another value.
|
|
346
|
+
*
|
|
347
|
+
* @param other - The value to compare against
|
|
348
|
+
* @returns A BooleanExpr that is true if this value is less than or equal
|
|
349
|
+
*
|
|
350
|
+
* @example
|
|
351
|
+
* ```ts
|
|
352
|
+
* const isLessOrEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
353
|
+
* $.return(a.lessThanOrEqual(b));
|
|
354
|
+
* });
|
|
355
|
+
* const compiled = East.compile(isLessOrEqual.toIR(), []);
|
|
356
|
+
* compiled(3n, 5n); // true
|
|
357
|
+
* compiled(5n, 5n); // true
|
|
358
|
+
* compiled(5n, 3n); // false
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
lessThanOrEqual(other: IntegerExpr | bigint): BooleanExpr;
|
|
362
|
+
/** Alias for {@link equals} */
|
|
363
|
+
eq: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
364
|
+
/** Alias for {@link equals} */
|
|
365
|
+
equal: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
366
|
+
/** Alias for {@link notEquals} */
|
|
367
|
+
ne: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
368
|
+
/** Alias for {@link notEquals} */
|
|
369
|
+
notEqual: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
370
|
+
/** Alias for {@link greaterThan} */
|
|
371
|
+
gt: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
372
|
+
/** Alias for {@link greaterThan} */
|
|
373
|
+
greater: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
374
|
+
/** Alias for {@link lessThan} */
|
|
375
|
+
lt: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
376
|
+
/** Alias for {@link lessThan} */
|
|
377
|
+
less: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
378
|
+
/** Alias for {@link greaterThanOrEqual} */
|
|
379
|
+
gte: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
380
|
+
/** Alias for {@link greaterThanOrEqual} */
|
|
381
|
+
ge: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
382
|
+
/** Alias for {@link greaterThanOrEqual} */
|
|
383
|
+
greaterEqual: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
384
|
+
/** Alias for {@link lessThanOrEqual} */
|
|
385
|
+
lte: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
386
|
+
/** Alias for {@link lessThanOrEqual} */
|
|
387
|
+
le: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
388
|
+
/** Alias for {@link lessThanOrEqual} */
|
|
389
|
+
lessEqual: (other: IntegerExpr | bigint) => BooleanExpr;
|
|
390
|
+
/** Alias for {@link add} */
|
|
391
|
+
plus: {
|
|
392
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
393
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
394
|
+
};
|
|
395
|
+
/** Alias for {@link subtract} */
|
|
396
|
+
sub: {
|
|
397
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
398
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
399
|
+
};
|
|
400
|
+
/** Alias for {@link subtract} */
|
|
401
|
+
minus: {
|
|
402
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
403
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
404
|
+
};
|
|
405
|
+
/** Alias for {@link multiply} */
|
|
406
|
+
mul: {
|
|
407
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
408
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
409
|
+
};
|
|
410
|
+
/** Alias for {@link multiply} */
|
|
411
|
+
times: {
|
|
412
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
413
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
414
|
+
};
|
|
415
|
+
/** Alias for {@link divide} */
|
|
416
|
+
div: {
|
|
417
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
418
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
419
|
+
};
|
|
420
|
+
/** Alias for {@link remainder} */
|
|
421
|
+
mod: {
|
|
422
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
423
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
424
|
+
};
|
|
425
|
+
/** Alias for {@link remainder} */
|
|
426
|
+
rem: {
|
|
427
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
428
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
429
|
+
};
|
|
430
|
+
/** Alias for {@link remainder} */
|
|
431
|
+
modulo: {
|
|
432
|
+
(y: Expr<IntegerType> | bigint): IntegerExpr;
|
|
433
|
+
(y: Expr<FloatType> | number): FloatExpr;
|
|
434
|
+
};
|
|
255
435
|
}
|
|
256
436
|
//# sourceMappingURL=integer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../src/expr/integer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAe,MAAM,aAAa,CAAC;AAClE,OAAO,EAAa,IAAI,EAAiB,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../src/expr/integer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAe,MAAM,aAAa,CAAC;AAClE,OAAO,EAAa,IAAI,EAAiB,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC;gBACpC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM;IAIxC;;;;;;;;;;;;;;OAcG;IACH,MAAM,IAAI,WAAW;IAWrB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,WAAW;IAC/C,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS;IAwB3C;;;;;;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AAG;YAjXU,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,WAAW;YACxC,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS;MAgX5B;IACrB,kCAAkC;IAClC,GAAG;YAnXU,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,WAAW;YACxC,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS;MAkX5B;IACrB,kCAAkC;IAClC,MAAM;YArXO,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,GAAG,WAAW;YACxC,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS;MAoXzB;CACzB"}
|
package/dist/src/expr/integer.js
CHANGED
|
@@ -2,6 +2,7 @@ import { get_location } from "../location.js";
|
|
|
2
2
|
import { FloatType, IntegerType, isTypeEqual } from "../types.js";
|
|
3
3
|
import { AstSymbol, Expr, FactorySymbol } from "./expr.js";
|
|
4
4
|
import { valueOrExprToAst } from "./ast.js";
|
|
5
|
+
import { equal, notEqual, less, lessEqual, greater, greaterEqual } from "./block.js";
|
|
5
6
|
/**
|
|
6
7
|
* Expression representing integer values and operations.
|
|
7
8
|
*
|
|
@@ -52,7 +53,7 @@ export class IntegerExpr extends Expr {
|
|
|
52
53
|
return this[FactorySymbol]({
|
|
53
54
|
ast_type: "Builtin",
|
|
54
55
|
type: IntegerType,
|
|
55
|
-
location: get_location(
|
|
56
|
+
location: get_location(),
|
|
56
57
|
builtin: "IntegerNegate",
|
|
57
58
|
type_parameters: [],
|
|
58
59
|
arguments: [this[AstSymbol]],
|
|
@@ -64,7 +65,7 @@ export class IntegerExpr extends Expr {
|
|
|
64
65
|
return this[FactorySymbol]({
|
|
65
66
|
ast_type: "Builtin",
|
|
66
67
|
type: FloatType,
|
|
67
|
-
location: get_location(
|
|
68
|
+
location: get_location(),
|
|
68
69
|
builtin: "FloatAdd",
|
|
69
70
|
type_parameters: [],
|
|
70
71
|
arguments: [this.toFloat()[AstSymbol], rightAst],
|
|
@@ -74,7 +75,7 @@ export class IntegerExpr extends Expr {
|
|
|
74
75
|
return this[FactorySymbol]({
|
|
75
76
|
ast_type: "Builtin",
|
|
76
77
|
type: IntegerType,
|
|
77
|
-
location: get_location(
|
|
78
|
+
location: get_location(),
|
|
78
79
|
builtin: "IntegerAdd",
|
|
79
80
|
type_parameters: [],
|
|
80
81
|
arguments: [this[AstSymbol], rightAst],
|
|
@@ -87,7 +88,7 @@ export class IntegerExpr extends Expr {
|
|
|
87
88
|
return this[FactorySymbol]({
|
|
88
89
|
ast_type: "Builtin",
|
|
89
90
|
type: FloatType,
|
|
90
|
-
location: get_location(
|
|
91
|
+
location: get_location(),
|
|
91
92
|
builtin: "FloatSubtract",
|
|
92
93
|
type_parameters: [],
|
|
93
94
|
arguments: [this.toFloat()[AstSymbol], rightAst],
|
|
@@ -97,7 +98,7 @@ export class IntegerExpr extends Expr {
|
|
|
97
98
|
return this[FactorySymbol]({
|
|
98
99
|
ast_type: "Builtin",
|
|
99
100
|
type: IntegerType,
|
|
100
|
-
location: get_location(
|
|
101
|
+
location: get_location(),
|
|
101
102
|
builtin: "IntegerSubtract",
|
|
102
103
|
type_parameters: [],
|
|
103
104
|
arguments: [this[AstSymbol], rightAst],
|
|
@@ -110,7 +111,7 @@ export class IntegerExpr extends Expr {
|
|
|
110
111
|
return this[FactorySymbol]({
|
|
111
112
|
ast_type: "Builtin",
|
|
112
113
|
type: FloatType,
|
|
113
|
-
location: get_location(
|
|
114
|
+
location: get_location(),
|
|
114
115
|
builtin: "FloatMultiply",
|
|
115
116
|
type_parameters: [],
|
|
116
117
|
arguments: [this.toFloat()[AstSymbol], rightAst],
|
|
@@ -120,7 +121,7 @@ export class IntegerExpr extends Expr {
|
|
|
120
121
|
return this[FactorySymbol]({
|
|
121
122
|
ast_type: "Builtin",
|
|
122
123
|
type: IntegerType,
|
|
123
|
-
location: get_location(
|
|
124
|
+
location: get_location(),
|
|
124
125
|
builtin: "IntegerMultiply",
|
|
125
126
|
type_parameters: [],
|
|
126
127
|
arguments: [this[AstSymbol], rightAst],
|
|
@@ -133,7 +134,7 @@ export class IntegerExpr extends Expr {
|
|
|
133
134
|
return this[FactorySymbol]({
|
|
134
135
|
ast_type: "Builtin",
|
|
135
136
|
type: FloatType,
|
|
136
|
-
location: get_location(
|
|
137
|
+
location: get_location(),
|
|
137
138
|
builtin: "FloatDivide",
|
|
138
139
|
type_parameters: [],
|
|
139
140
|
arguments: [this.toFloat()[AstSymbol], rightAst],
|
|
@@ -143,7 +144,7 @@ export class IntegerExpr extends Expr {
|
|
|
143
144
|
return this[FactorySymbol]({
|
|
144
145
|
ast_type: "Builtin",
|
|
145
146
|
type: IntegerType,
|
|
146
|
-
location: get_location(
|
|
147
|
+
location: get_location(),
|
|
147
148
|
builtin: "IntegerDivide",
|
|
148
149
|
type_parameters: [],
|
|
149
150
|
arguments: [this[AstSymbol], rightAst],
|
|
@@ -156,7 +157,7 @@ export class IntegerExpr extends Expr {
|
|
|
156
157
|
return this[FactorySymbol]({
|
|
157
158
|
ast_type: "Builtin",
|
|
158
159
|
type: FloatType,
|
|
159
|
-
location: get_location(
|
|
160
|
+
location: get_location(),
|
|
160
161
|
builtin: "FloatRemainder",
|
|
161
162
|
type_parameters: [],
|
|
162
163
|
arguments: [this.toFloat()[AstSymbol], rightAst],
|
|
@@ -166,7 +167,7 @@ export class IntegerExpr extends Expr {
|
|
|
166
167
|
return this[FactorySymbol]({
|
|
167
168
|
ast_type: "Builtin",
|
|
168
169
|
type: IntegerType,
|
|
169
|
-
location: get_location(
|
|
170
|
+
location: get_location(),
|
|
170
171
|
builtin: "IntegerRemainder",
|
|
171
172
|
type_parameters: [],
|
|
172
173
|
arguments: [this[AstSymbol], rightAst],
|
|
@@ -179,7 +180,7 @@ export class IntegerExpr extends Expr {
|
|
|
179
180
|
return this[FactorySymbol]({
|
|
180
181
|
ast_type: "Builtin",
|
|
181
182
|
type: FloatType,
|
|
182
|
-
location: get_location(
|
|
183
|
+
location: get_location(),
|
|
183
184
|
builtin: "FloatPow",
|
|
184
185
|
type_parameters: [],
|
|
185
186
|
arguments: [this.toFloat()[AstSymbol], rightAst],
|
|
@@ -189,7 +190,7 @@ export class IntegerExpr extends Expr {
|
|
|
189
190
|
return this[FactorySymbol]({
|
|
190
191
|
ast_type: "Builtin",
|
|
191
192
|
type: IntegerType,
|
|
192
|
-
location: get_location(
|
|
193
|
+
location: get_location(),
|
|
193
194
|
builtin: "IntegerPow",
|
|
194
195
|
type_parameters: [],
|
|
195
196
|
arguments: [this[AstSymbol], rightAst],
|
|
@@ -216,7 +217,7 @@ export class IntegerExpr extends Expr {
|
|
|
216
217
|
return this[FactorySymbol]({
|
|
217
218
|
ast_type: "Builtin",
|
|
218
219
|
type: IntegerType,
|
|
219
|
-
location: get_location(
|
|
220
|
+
location: get_location(),
|
|
220
221
|
builtin: "IntegerAbs",
|
|
221
222
|
type_parameters: [],
|
|
222
223
|
arguments: [this[AstSymbol]],
|
|
@@ -242,7 +243,7 @@ export class IntegerExpr extends Expr {
|
|
|
242
243
|
return this[FactorySymbol]({
|
|
243
244
|
ast_type: "Builtin",
|
|
244
245
|
type: IntegerType,
|
|
245
|
-
location: get_location(
|
|
246
|
+
location: get_location(),
|
|
246
247
|
builtin: "IntegerSign",
|
|
247
248
|
type_parameters: [],
|
|
248
249
|
arguments: [this[AstSymbol]],
|
|
@@ -273,7 +274,7 @@ export class IntegerExpr extends Expr {
|
|
|
273
274
|
return this[FactorySymbol]({
|
|
274
275
|
ast_type: "Builtin",
|
|
275
276
|
type: IntegerType,
|
|
276
|
-
location: get_location(
|
|
277
|
+
location: get_location(),
|
|
277
278
|
builtin: "IntegerLog",
|
|
278
279
|
type_parameters: [],
|
|
279
280
|
arguments: [this[AstSymbol], baseAst],
|
|
@@ -301,11 +302,181 @@ export class IntegerExpr extends Expr {
|
|
|
301
302
|
return this[FactorySymbol]({
|
|
302
303
|
ast_type: "Builtin",
|
|
303
304
|
type: FloatType,
|
|
304
|
-
location: get_location(
|
|
305
|
+
location: get_location(),
|
|
305
306
|
builtin: "IntegerToFloat",
|
|
306
307
|
type_parameters: [],
|
|
307
308
|
arguments: [this[AstSymbol]],
|
|
308
309
|
});
|
|
309
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* Checks if this integer equals another value.
|
|
313
|
+
*
|
|
314
|
+
* @param other - The value to compare against
|
|
315
|
+
* @returns A BooleanExpr that is true if the values are equal
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```ts
|
|
319
|
+
* const isEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
320
|
+
* $.return(a.equals(b));
|
|
321
|
+
* });
|
|
322
|
+
* const compiled = East.compile(isEqual.toIR(), []);
|
|
323
|
+
* compiled(5n, 5n); // true
|
|
324
|
+
* compiled(5n, 3n); // false
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
equals(other) {
|
|
328
|
+
return equal(this, other);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Checks if this integer does not equal another value.
|
|
332
|
+
*
|
|
333
|
+
* @param other - The value to compare against
|
|
334
|
+
* @returns A BooleanExpr that is true if the values are not equal
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```ts
|
|
338
|
+
* const isNotEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
339
|
+
* $.return(a.notEquals(b));
|
|
340
|
+
* });
|
|
341
|
+
* const compiled = East.compile(isNotEqual.toIR(), []);
|
|
342
|
+
* compiled(5n, 3n); // true
|
|
343
|
+
* compiled(5n, 5n); // false
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
notEquals(other) {
|
|
347
|
+
return notEqual(this, other);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Checks if this integer is greater than another value.
|
|
351
|
+
*
|
|
352
|
+
* @param other - The value to compare against
|
|
353
|
+
* @returns A BooleanExpr that is true if this value is greater
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* ```ts
|
|
357
|
+
* const isGreater = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
358
|
+
* $.return(a.greaterThan(b));
|
|
359
|
+
* });
|
|
360
|
+
* const compiled = East.compile(isGreater.toIR(), []);
|
|
361
|
+
* compiled(5n, 3n); // true
|
|
362
|
+
* compiled(3n, 5n); // false
|
|
363
|
+
* compiled(5n, 5n); // false
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
greaterThan(other) {
|
|
367
|
+
return greater(this, other);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Checks if this integer is less than another value.
|
|
371
|
+
*
|
|
372
|
+
* @param other - The value to compare against
|
|
373
|
+
* @returns A BooleanExpr that is true if this value is less
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```ts
|
|
377
|
+
* const isLess = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
378
|
+
* $.return(a.lessThan(b));
|
|
379
|
+
* });
|
|
380
|
+
* const compiled = East.compile(isLess.toIR(), []);
|
|
381
|
+
* compiled(3n, 5n); // true
|
|
382
|
+
* compiled(5n, 3n); // false
|
|
383
|
+
* compiled(5n, 5n); // false
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
lessThan(other) {
|
|
387
|
+
return less(this, other);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Checks if this integer is greater than or equal to another value.
|
|
391
|
+
*
|
|
392
|
+
* @param other - The value to compare against
|
|
393
|
+
* @returns A BooleanExpr that is true if this value is greater than or equal
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* ```ts
|
|
397
|
+
* const isGreaterOrEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
398
|
+
* $.return(a.greaterThanOrEqual(b));
|
|
399
|
+
* });
|
|
400
|
+
* const compiled = East.compile(isGreaterOrEqual.toIR(), []);
|
|
401
|
+
* compiled(5n, 3n); // true
|
|
402
|
+
* compiled(5n, 5n); // true
|
|
403
|
+
* compiled(3n, 5n); // false
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
greaterThanOrEqual(other) {
|
|
407
|
+
return greaterEqual(this, other);
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Checks if this integer is less than or equal to another value.
|
|
411
|
+
*
|
|
412
|
+
* @param other - The value to compare against
|
|
413
|
+
* @returns A BooleanExpr that is true if this value is less than or equal
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```ts
|
|
417
|
+
* const isLessOrEqual = East.function([IntegerType, IntegerType], BooleanType, ($, a, b) => {
|
|
418
|
+
* $.return(a.lessThanOrEqual(b));
|
|
419
|
+
* });
|
|
420
|
+
* const compiled = East.compile(isLessOrEqual.toIR(), []);
|
|
421
|
+
* compiled(3n, 5n); // true
|
|
422
|
+
* compiled(5n, 5n); // true
|
|
423
|
+
* compiled(5n, 3n); // false
|
|
424
|
+
* ```
|
|
425
|
+
*/
|
|
426
|
+
lessThanOrEqual(other) {
|
|
427
|
+
return lessEqual(this, other);
|
|
428
|
+
}
|
|
429
|
+
// ============================================================================
|
|
430
|
+
// Aliases for comparison operations
|
|
431
|
+
// ============================================================================
|
|
432
|
+
/** Alias for {@link equals} */
|
|
433
|
+
eq = this.equals;
|
|
434
|
+
/** Alias for {@link equals} */
|
|
435
|
+
equal = this.equals;
|
|
436
|
+
/** Alias for {@link notEquals} */
|
|
437
|
+
ne = this.notEquals;
|
|
438
|
+
/** Alias for {@link notEquals} */
|
|
439
|
+
notEqual = this.notEquals;
|
|
440
|
+
/** Alias for {@link greaterThan} */
|
|
441
|
+
gt = this.greaterThan;
|
|
442
|
+
/** Alias for {@link greaterThan} */
|
|
443
|
+
greater = this.greaterThan;
|
|
444
|
+
/** Alias for {@link lessThan} */
|
|
445
|
+
lt = this.lessThan;
|
|
446
|
+
/** Alias for {@link lessThan} */
|
|
447
|
+
less = this.lessThan;
|
|
448
|
+
/** Alias for {@link greaterThanOrEqual} */
|
|
449
|
+
gte = this.greaterThanOrEqual;
|
|
450
|
+
/** Alias for {@link greaterThanOrEqual} */
|
|
451
|
+
ge = this.greaterThanOrEqual;
|
|
452
|
+
/** Alias for {@link greaterThanOrEqual} */
|
|
453
|
+
greaterEqual = this.greaterThanOrEqual;
|
|
454
|
+
/** Alias for {@link lessThanOrEqual} */
|
|
455
|
+
lte = this.lessThanOrEqual;
|
|
456
|
+
/** Alias for {@link lessThanOrEqual} */
|
|
457
|
+
le = this.lessThanOrEqual;
|
|
458
|
+
/** Alias for {@link lessThanOrEqual} */
|
|
459
|
+
lessEqual = this.lessThanOrEqual;
|
|
460
|
+
// ============================================================================
|
|
461
|
+
// Aliases for arithmetic operations
|
|
462
|
+
// ============================================================================
|
|
463
|
+
/** Alias for {@link add} */
|
|
464
|
+
plus = this.add;
|
|
465
|
+
/** Alias for {@link subtract} */
|
|
466
|
+
sub = this.subtract;
|
|
467
|
+
/** Alias for {@link subtract} */
|
|
468
|
+
minus = this.subtract;
|
|
469
|
+
/** Alias for {@link multiply} */
|
|
470
|
+
mul = this.multiply;
|
|
471
|
+
/** Alias for {@link multiply} */
|
|
472
|
+
times = this.multiply;
|
|
473
|
+
/** Alias for {@link divide} */
|
|
474
|
+
div = this.divide;
|
|
475
|
+
/** Alias for {@link remainder} */
|
|
476
|
+
mod = this.remainder;
|
|
477
|
+
/** Alias for {@link remainder} */
|
|
478
|
+
rem = this.remainder;
|
|
479
|
+
/** Alias for {@link remainder} */
|
|
480
|
+
modulo = this.remainder;
|
|
310
481
|
}
|
|
311
482
|
//# sourceMappingURL=integer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.js","sourceRoot":"","sources":["../../../src/expr/integer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW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IAAI,CAAC,eAAe,CAAC;IAC3B,wCAAwC;IACxC,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC;IAC1B,wCAAwC;IACxC,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;IAEjC,+EAA+E;IAC/E,oCAAoC;IACpC,+EAA+E;IAE/E,4BAA4B;IAC5B,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;IAEhB,iCAAiC;IACjC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;IACpB,iCAAiC;IACjC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;IAEtB,iCAAiC;IACjC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC;IACpB,iCAAiC;IACjC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;IAEtB,+BAA+B;IAC/B,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IAElB,kCAAkC;IAClC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IACrB,kCAAkC;IAClC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;IACrB,kCAAkC;IAClC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;CACzB"}
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
return Expr.fromAst({
|
|
47
47
|
ast_type: "Builtin",
|
|
48
48
|
type: BlobType,
|
|
49
|
-
location: get_location(
|
|
49
|
+
location: get_location(),
|
|
50
50
|
builtin: "BlobEncodeBeast",
|
|
51
51
|
type_parameters: [Expr.type(value)],
|
|
52
52
|
arguments: [Expr.ast(value)],
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
return Expr.fromAst({
|
|
57
57
|
ast_type: "Builtin",
|
|
58
58
|
type: BlobType,
|
|
59
|
-
location: get_location(
|
|
59
|
+
location: get_location(),
|
|
60
60
|
builtin: "BlobEncodeBeast2",
|
|
61
61
|
type_parameters: [Expr.type(value)],
|
|
62
62
|
arguments: [Expr.ast(value)],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.js","sourceRoot":"","sources":["../../../../src/expr/libs/blob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,iCAAiC;AACjC,eAAe;IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,WAAW,CAAC,KAAW,EAAE,UAAuB,IAAI;QAClD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"blob.js","sourceRoot":"","sources":["../../../../src/expr/libs/blob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,iCAAiC;AACjC,eAAe;IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,WAAW,CAAC,KAAW,EAAE,UAAuB,IAAI;QAClD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,YAAY,EAAE;gBACxB,OAAO,EAAE,iBAAiB;gBAC1B,eAAe,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACnC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aAC7B,CAAa,CAAC;QACjB,CAAC;aAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,YAAY,EAAE;gBACxB,OAAO,EAAE,kBAAkB;gBAC3B,eAAe,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACnC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aAC7B,CAAa,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -23,6 +23,25 @@ declare const _default: {
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
printCommaSeperated: import("../function.js").CallableFunctionExpr<[IntegerType], StringType>;
|
|
26
|
+
/**
|
|
27
|
+
* Formats a float as currency with comma separators and 2 decimal places.
|
|
28
|
+
*
|
|
29
|
+
* @param x - The float value to format as currency
|
|
30
|
+
* @returns A formatted currency string (e.g., `"$1,234.56"`)
|
|
31
|
+
* @throws {Error} When `x` is NaN, Infinity, or -Infinity
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const formatCurrency = East.function([IntegerType], StringType, ($, x) => {
|
|
36
|
+
* $.return(East.Integer.printCurrency(x));
|
|
37
|
+
* });
|
|
38
|
+
* const compiled = East.compile(formatCurrency.toIR(), []);
|
|
39
|
+
* compiled(1234n); // "$1,234"
|
|
40
|
+
* compiled(-42n); // "-$42"
|
|
41
|
+
* compiled(1000000n); // "$1,000,000"
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
printCurrency: import("../function.js").CallableFunctionExpr<[IntegerType], StringType>;
|
|
26
45
|
/**
|
|
27
46
|
* Formats an integer in compact form with business unit suffixes.
|
|
28
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/expr/libs/integer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGzD,8CAA8C;;IAE5C;;;;;;;;;;;;;;;;OAgBG;;
|
|
1
|
+
{"version":3,"file":"integer.d.ts","sourceRoot":"","sources":["../../../../src/expr/libs/integer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGzD,8CAA8C;;IAE5C;;;;;;;;;;;;;;;;OAgBG;;IA+CD;;;;;;;;;;;;;;;;;OAiBG;;IAiDL;;;;;;;;;;;;;;;;;;;;OAoBG;;IA6DH;;;;;;;;;;;;;;;;;;;;OAoBG;;IA+DH;;;;;;;;;;;;;;;;;;;;OAoBG;;IAgEH;;;;;;;;;;;;;;;;;;;OAmBG;;IAiCH;;;;;;;;;;;;;;;;;OAiBG;;IAMH;;;;;;;;;;;;;;;;;OAiBG;;IAiCH;;;;;;;;;;;;;;;;;OAiBG;;IAsBH;;;;;;;;;;;;;;;;;OAiBG;;IAuBH;;;;;;;;;;;;;;;;;OAiBG;;IAgBH;;;;;;;;;;;;;;;;OAgBG;;;AAvnBL,wBA2nBC"}
|