@elaraai/east 0.0.1-beta.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +15 -666
- package/README.md +113 -88
- package/dist/src/analyze.d.ts +3 -0
- package/dist/src/analyze.d.ts.map +1 -1
- package/dist/src/analyze.js +223 -111
- package/dist/src/analyze.js.map +1 -1
- package/dist/src/analyze.spec.d.ts +2 -0
- package/dist/src/analyze.spec.d.ts.map +1 -0
- package/dist/src/analyze.spec.js +445 -0
- package/dist/src/analyze.spec.js.map +1 -0
- package/dist/src/ast.d.ts +54 -35
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast_to_ir.coerce_to.spec.d.ts +15 -0
- package/dist/src/ast_to_ir.coerce_to.spec.d.ts.map +1 -0
- package/dist/src/ast_to_ir.coerce_to.spec.js +420 -0
- package/dist/src/ast_to_ir.coerce_to.spec.js.map +1 -0
- package/dist/src/ast_to_ir.d.ts +18 -4
- package/dist/src/ast_to_ir.d.ts.map +1 -1
- package/dist/src/ast_to_ir.js +233 -178
- 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 +194 -2
- package/dist/src/builtins.js.map +1 -1
- package/dist/src/comparison.d.ts +2 -2
- package/dist/src/comparison.d.ts.map +1 -1
- package/dist/src/comparison.js +115 -40
- package/dist/src/comparison.js.map +1 -1
- package/dist/src/comparison.spec.d.ts +2 -0
- package/dist/src/comparison.spec.d.ts.map +1 -0
- package/dist/src/comparison.spec.js +1200 -0
- package/dist/src/comparison.spec.js.map +1 -0
- package/dist/src/compile.d.ts +31 -9
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +1048 -548
- package/dist/src/compile.js.map +1 -1
- package/dist/src/containers/matrix.d.ts +15 -0
- package/dist/src/containers/matrix.d.ts.map +1 -0
- package/dist/src/containers/matrix.js +15 -0
- package/dist/src/containers/matrix.js.map +1 -0
- package/dist/src/containers/ref.d.ts.map +1 -1
- package/dist/src/containers/ref.js +1 -1
- package/dist/src/containers/ref.js.map +1 -1
- package/dist/src/containers/sortedmap.spec.d.ts +2 -0
- package/dist/src/containers/sortedmap.spec.d.ts.map +1 -0
- package/dist/src/containers/sortedmap.spec.js +180 -0
- package/dist/src/containers/sortedmap.spec.js.map +1 -0
- package/dist/src/containers/sortedset.spec.d.ts +2 -0
- package/dist/src/containers/sortedset.spec.d.ts.map +1 -0
- package/dist/src/containers/sortedset.spec.js +228 -0
- package/dist/src/containers/sortedset.spec.js.map +1 -0
- package/dist/src/containers/variant.d.ts.map +1 -1
- package/dist/src/containers/variant.js +1 -1
- package/dist/src/containers/variant.js.map +1 -1
- package/dist/src/containers/variant.spec.d.ts +2 -0
- package/dist/src/containers/variant.spec.d.ts.map +1 -0
- package/dist/src/containers/variant.spec.js +217 -0
- package/dist/src/containers/variant.spec.js.map +1 -0
- package/dist/src/datetime_format/parse.spec.d.ts +6 -0
- package/dist/src/datetime_format/parse.spec.d.ts.map +1 -0
- package/dist/src/datetime_format/parse.spec.js +379 -0
- package/dist/src/datetime_format/parse.spec.js.map +1 -0
- package/dist/src/datetime_format/print.spec.d.ts +6 -0
- package/dist/src/datetime_format/print.spec.d.ts.map +1 -0
- package/dist/src/datetime_format/print.spec.js +257 -0
- package/dist/src/datetime_format/print.spec.js.map +1 -0
- package/dist/src/datetime_format/tokenize.spec.d.ts +2 -0
- package/dist/src/datetime_format/tokenize.spec.d.ts.map +1 -0
- package/dist/src/datetime_format/tokenize.spec.js +508 -0
- package/dist/src/datetime_format/tokenize.spec.js.map +1 -0
- package/dist/src/datetime_format/types.d.ts +23 -23
- package/dist/src/default.d.ts.map +1 -1
- package/dist/src/default.js +33 -0
- package/dist/src/default.js.map +1 -1
- package/dist/src/default.spec.d.ts +2 -0
- package/dist/src/default.spec.d.ts.map +1 -0
- package/dist/src/default.spec.js +178 -0
- package/dist/src/default.spec.js.map +1 -0
- package/dist/src/eastir.d.ts +7 -0
- package/dist/src/eastir.d.ts.map +1 -1
- package/dist/src/eastir.js +55 -7
- package/dist/src/eastir.js.map +1 -1
- package/dist/src/error.d.ts +14 -4
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +28 -3
- package/dist/src/error.js.map +1 -1
- package/dist/src/example.d.ts +87 -0
- package/dist/src/example.d.ts.map +1 -0
- package/dist/src/example.js +18 -0
- package/dist/src/example.js.map +1 -0
- package/dist/src/expr/array.d.ts +43 -1
- package/dist/src/expr/array.d.ts.map +1 -1
- package/dist/src/expr/array.js +103 -53
- 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 +112 -54
- package/dist/src/expr/ast.js.map +1 -1
- package/dist/src/expr/asyncfunction.d.ts.map +1 -1
- package/dist/src/expr/asyncfunction.js +6 -4
- package/dist/src/expr/asyncfunction.js.map +1 -1
- package/dist/src/expr/blob.d.ts +48 -0
- package/dist/src/expr/blob.d.ts.map +1 -1
- package/dist/src/expr/blob.js +63 -8
- package/dist/src/expr/blob.js.map +1 -1
- package/dist/src/expr/block.d.ts +213 -12
- package/dist/src/expr/block.d.ts.map +1 -1
- package/dist/src/expr/block.js +796 -293
- 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 +58 -6
- 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 +184 -34
- package/dist/src/expr/datetime.js.map +1 -1
- package/dist/src/expr/dict.d.ts +47 -2
- package/dist/src/expr/dict.d.ts.map +1 -1
- package/dist/src/expr/dict.js +122 -61
- package/dist/src/expr/dict.js.map +1 -1
- package/dist/src/expr/expr.d.ts +3 -1
- package/dist/src/expr/expr.d.ts.map +1 -1
- package/dist/src/expr/expr.js +4 -3
- 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 +191 -17
- 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 +6 -4
- package/dist/src/expr/function.js.map +1 -1
- package/dist/src/expr/index.d.ts +186 -2
- package/dist/src/expr/index.d.ts.map +1 -1
- package/dist/src/expr/index.js +183 -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 +189 -18
- package/dist/src/expr/integer.js.map +1 -1
- package/dist/src/expr/libs/array.js +3 -3
- package/dist/src/expr/libs/array.js.map +1 -1
- package/dist/src/expr/libs/blob.js +3 -3
- package/dist/src/expr/libs/blob.js.map +1 -1
- package/dist/src/expr/libs/dict.js +1 -1
- package/dist/src/expr/libs/dict.js.map +1 -1
- package/dist/src/expr/libs/matrix.d.ts +17 -0
- package/dist/src/expr/libs/matrix.d.ts.map +1 -0
- package/dist/src/expr/libs/matrix.js +60 -0
- package/dist/src/expr/libs/matrix.js.map +1 -0
- package/dist/src/expr/libs/set.js +1 -1
- package/dist/src/expr/libs/set.js.map +1 -1
- package/dist/src/expr/libs/string.d.ts.map +1 -1
- package/dist/src/expr/libs/string.js +2 -1
- package/dist/src/expr/libs/string.js.map +1 -1
- package/dist/src/expr/libs/vector.d.ts +16 -0
- package/dist/src/expr/libs/vector.d.ts.map +1 -0
- package/dist/src/expr/libs/vector.js +44 -0
- package/dist/src/expr/libs/vector.js.map +1 -0
- package/dist/src/expr/matrix.d.ts +109 -0
- package/dist/src/expr/matrix.d.ts.map +1 -0
- package/dist/src/expr/matrix.js +224 -0
- package/dist/src/expr/matrix.js.map +1 -0
- 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 +5 -5
- 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 +102 -52
- 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 +173 -23
- 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 +2 -2
- package/dist/src/expr/struct.js.map +1 -1
- package/dist/src/expr/types.d.ts +12 -9
- package/dist/src/expr/types.d.ts.map +1 -1
- package/dist/src/expr/variant.d.ts +108 -11
- package/dist/src/expr/variant.d.ts.map +1 -1
- package/dist/src/expr/variant.js +76 -38
- package/dist/src/expr/variant.js.map +1 -1
- package/dist/src/expr/vector.d.ts +102 -0
- package/dist/src/expr/vector.d.ts.map +1 -0
- package/dist/src/expr/vector.js +202 -0
- package/dist/src/expr/vector.js.map +1 -0
- package/dist/src/fuzz.d.ts +36 -2
- package/dist/src/fuzz.d.ts.map +1 -1
- package/dist/src/fuzz.js +409 -77
- package/dist/src/fuzz.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal.d.ts +12 -2
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +13 -2
- package/dist/src/internal.js.map +1 -1
- package/dist/src/ir.d.ts +1754 -1484
- package/dist/src/ir.d.ts.map +1 -1
- package/dist/src/ir.js +51 -34
- package/dist/src/ir.js.map +1 -1
- package/dist/src/ir.spec.d.ts +2 -0
- package/dist/src/ir.spec.d.ts.map +1 -0
- package/dist/src/ir.spec.js +35 -0
- package/dist/src/ir.spec.js.map +1 -0
- package/dist/src/location.d.ts +56 -17
- package/dist/src/location.d.ts.map +1 -1
- package/dist/src/location.js +226 -29
- package/dist/src/location.js.map +1 -1
- package/dist/src/location.spec.d.ts +2 -0
- package/dist/src/location.spec.d.ts.map +1 -0
- package/dist/src/location.spec.js +102 -0
- package/dist/src/location.spec.js.map +1 -0
- 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 +352 -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 +448 -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 +347 -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 +32 -0
- package/dist/src/patch/index.d.ts.map +1 -0
- package/dist/src/patch/index.js +48 -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 +284 -0
- package/dist/src/patch/invert.js.map +1 -0
- package/dist/src/patch/merge.d.ts +56 -0
- package/dist/src/patch/merge.d.ts.map +1 -0
- package/dist/src/patch/merge.js +586 -0
- package/dist/src/patch/merge.js.map +1 -0
- package/dist/src/patch/merge.spec.d.ts +2 -0
- package/dist/src/patch/merge.spec.d.ts.map +1 -0
- package/dist/src/patch/merge.spec.js +1139 -0
- package/dist/src/patch/merge.spec.js.map +1 -0
- package/dist/src/patch/patch.spec.d.ts +2 -0
- package/dist/src/patch/patch.spec.d.ts.map +1 -0
- package/dist/src/patch/patch.spec.js +452 -0
- package/dist/src/patch/patch.spec.js.map +1 -0
- package/dist/src/patch/path.d.ts +115 -0
- package/dist/src/patch/path.d.ts.map +1 -0
- package/dist/src/patch/path.js +192 -0
- package/dist/src/patch/path.js.map +1 -0
- package/dist/src/patch/path.spec.d.ts +6 -0
- package/dist/src/patch/path.spec.d.ts.map +1 -0
- package/dist/src/patch/path.spec.js +322 -0
- package/dist/src/patch/path.spec.js.map +1 -0
- package/dist/src/patch/prune.d.ts +77 -0
- package/dist/src/patch/prune.d.ts.map +1 -0
- package/dist/src/patch/prune.js +115 -0
- package/dist/src/patch/prune.js.map +1 -0
- package/dist/src/patch/prune.spec.d.ts +6 -0
- package/dist/src/patch/prune.spec.d.ts.map +1 -0
- package/dist/src/patch/prune.spec.js +473 -0
- package/dist/src/patch/prune.spec.js.map +1 -0
- package/dist/src/patch/type_of_patch.d.ts +25 -0
- package/dist/src/patch/type_of_patch.d.ts.map +1 -0
- package/dist/src/patch/type_of_patch.js +144 -0
- package/dist/src/patch/type_of_patch.js.map +1 -0
- package/dist/src/patch/types.d.ts +220 -0
- package/dist/src/patch/types.d.ts.map +1 -0
- package/dist/src/patch/types.js +62 -0
- package/dist/src/patch/types.js.map +1 -0
- package/dist/src/patch/validate.d.ts +44 -0
- package/dist/src/patch/validate.d.ts.map +1 -0
- package/dist/src/patch/validate.js +190 -0
- package/dist/src/patch/validate.js.map +1 -0
- package/dist/src/patch/validate.spec.d.ts +6 -0
- package/dist/src/patch/validate.spec.d.ts.map +1 -0
- package/dist/src/patch/validate.spec.js +225 -0
- package/dist/src/patch/validate.spec.js.map +1 -0
- package/dist/src/patch/walk.d.ts +121 -0
- package/dist/src/patch/walk.d.ts.map +1 -0
- package/dist/src/patch/walk.js +385 -0
- package/dist/src/patch/walk.js.map +1 -0
- package/dist/src/patch/walk.spec.d.ts +6 -0
- package/dist/src/patch/walk.spec.d.ts.map +1 -0
- package/dist/src/patch/walk.spec.js +621 -0
- package/dist/src/patch/walk.spec.js.map +1 -0
- package/dist/src/platform.d.ts +6 -0
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/platform.spec.d.ts +2 -0
- package/dist/src/platform.spec.d.ts.map +1 -0
- package/dist/src/platform.spec.js +330 -0
- package/dist/src/platform.spec.js.map +1 -0
- package/dist/src/serialization/beast.d.ts.map +1 -1
- package/dist/src/serialization/beast.js +12 -0
- package/dist/src/serialization/beast.js.map +1 -1
- package/dist/src/serialization/beast.spec.d.ts +6 -0
- package/dist/src/serialization/beast.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast.spec.js +406 -0
- package/dist/src/serialization/beast.spec.js.map +1 -0
- package/dist/src/serialization/beast2/index.d.ts +50 -0
- package/dist/src/serialization/beast2/index.d.ts.map +1 -0
- package/dist/src/serialization/beast2/index.js +756 -0
- package/dist/src/serialization/beast2/index.js.map +1 -0
- package/dist/src/serialization/beast2/index.spec.d.ts +6 -0
- package/dist/src/serialization/beast2/index.spec.d.ts.map +1 -0
- package/dist/src/serialization/beast2/index.spec.js +528 -0
- package/dist/src/serialization/beast2/index.spec.js.map +1 -0
- package/dist/src/serialization/beast2/sourcemap-table.d.ts +29 -0
- package/dist/src/serialization/beast2/sourcemap-table.d.ts.map +1 -0
- package/dist/src/serialization/beast2/sourcemap-table.js +82 -0
- package/dist/src/serialization/beast2/sourcemap-table.js.map +1 -0
- package/dist/src/serialization/beast2/string-table.d.ts +16 -0
- package/dist/src/serialization/beast2/string-table.d.ts.map +1 -0
- package/dist/src/serialization/beast2/string-table.js +38 -0
- package/dist/src/serialization/beast2/string-table.js.map +1 -0
- package/dist/src/serialization/beast2/type-table.d.ts +86 -0
- package/dist/src/serialization/beast2/type-table.d.ts.map +1 -0
- package/dist/src/serialization/beast2/type-table.js +618 -0
- package/dist/src/serialization/beast2/type-table.js.map +1 -0
- package/dist/src/serialization/beast2/value-table.d.ts +40 -0
- package/dist/src/serialization/beast2/value-table.d.ts.map +1 -0
- package/dist/src/serialization/beast2/value-table.js +157 -0
- package/dist/src/serialization/beast2/value-table.js.map +1 -0
- package/dist/src/serialization/binary-utils.d.ts +33 -0
- package/dist/src/serialization/binary-utils.d.ts.map +1 -1
- package/dist/src/serialization/binary-utils.js +157 -0
- package/dist/src/serialization/binary-utils.js.map +1 -1
- package/dist/src/serialization/csv.d.ts +17 -17
- package/dist/src/serialization/csv.d.ts.map +1 -1
- package/dist/src/serialization/csv.js +10 -8
- package/dist/src/serialization/csv.js.map +1 -1
- package/dist/src/serialization/csv.spec.d.ts +2 -0
- package/dist/src/serialization/csv.spec.d.ts.map +1 -0
- package/dist/src/serialization/csv.spec.js +556 -0
- package/dist/src/serialization/csv.spec.js.map +1 -0
- package/dist/src/serialization/east-inferred.spec.d.ts +2 -0
- package/dist/src/serialization/east-inferred.spec.d.ts.map +1 -0
- package/dist/src/serialization/east-inferred.spec.js +322 -0
- package/dist/src/serialization/east-inferred.spec.js.map +1 -0
- package/dist/src/serialization/east.d.ts +1 -1
- package/dist/src/serialization/east.d.ts.map +1 -1
- package/dist/src/serialization/east.js +178 -26
- package/dist/src/serialization/east.js.map +1 -1
- package/dist/src/serialization/east.spec.d.ts +2 -0
- package/dist/src/serialization/east.spec.d.ts.map +1 -0
- package/dist/src/serialization/east.spec.js +1548 -0
- package/dist/src/serialization/east.spec.js.map +1 -0
- package/dist/src/serialization/index.d.ts +1 -2
- package/dist/src/serialization/index.d.ts.map +1 -1
- package/dist/src/serialization/index.js +1 -2
- package/dist/src/serialization/index.js.map +1 -1
- package/dist/src/serialization/json.d.ts +1 -1
- package/dist/src/serialization/json.d.ts.map +1 -1
- package/dist/src/serialization/json.js +123 -24
- package/dist/src/serialization/json.js.map +1 -1
- package/dist/src/serialization/json.spec.d.ts +2 -0
- package/dist/src/serialization/json.spec.d.ts.map +1 -0
- package/dist/src/serialization/json.spec.js +1297 -0
- package/dist/src/serialization/json.spec.js.map +1 -0
- package/dist/src/type_of_type.d.ts +72 -35
- package/dist/src/type_of_type.d.ts.map +1 -1
- package/dist/src/type_of_type.is_data.spec.d.ts +6 -0
- package/dist/src/type_of_type.is_data.spec.d.ts.map +1 -0
- package/dist/src/type_of_type.is_data.spec.js +221 -0
- package/dist/src/type_of_type.is_data.spec.js.map +1 -0
- package/dist/src/type_of_type.js +355 -80
- package/dist/src/type_of_type.js.map +1 -1
- package/dist/src/type_of_type.to_etv.spec.d.ts +6 -0
- package/dist/src/type_of_type.to_etv.spec.d.ts.map +1 -0
- package/dist/src/type_of_type.to_etv.spec.js +263 -0
- package/dist/src/type_of_type.to_etv.spec.js.map +1 -0
- package/dist/src/types.d.ts +82 -12
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.error.spec.d.ts +2 -0
- package/dist/src/types.error.spec.d.ts.map +1 -0
- package/dist/src/types.error.spec.js +665 -0
- package/dist/src/types.error.spec.js.map +1 -0
- package/dist/src/types.js +663 -156
- package/dist/src/types.js.map +1 -1
- package/dist/src/types.spec.d.ts +2 -0
- package/dist/src/types.spec.d.ts.map +1 -0
- package/dist/src/types.spec.js +946 -0
- package/dist/src/types.spec.js.map +1 -0
- package/dist/src/walker.d.ts +65 -0
- package/dist/src/walker.d.ts.map +1 -0
- package/dist/src/walker.js +165 -0
- package/dist/src/walker.js.map +1 -0
- package/dist/src/walker.spec.d.ts +6 -0
- package/dist/src/walker.spec.d.ts.map +1 -0
- package/dist/src/walker.spec.js +109 -0
- package/dist/src/walker.spec.js.map +1 -0
- package/package.json +16 -38
- package/dist/src/serialization/beast2-stream.d.ts +0 -38
- package/dist/src/serialization/beast2-stream.d.ts.map +0 -1
- package/dist/src/serialization/beast2-stream.js +0 -670
- package/dist/src/serialization/beast2-stream.js.map +0 -1
- package/dist/src/serialization/beast2.d.ts +0 -41
- package/dist/src/serialization/beast2.d.ts.map +0 -1
- package/dist/src/serialization/beast2.js +0 -495
- package/dist/src/serialization/beast2.js.map +0 -1
package/dist/src/expr/array.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { get_location_id } from "../location.js";
|
|
2
2
|
import { ArrayType, BooleanType, FunctionType, IntegerType, NullType, StringType, isSubtype, isTypeEqual, printType, NeverType, OptionType, isDataType, StructType, VariantType, SetType, FloatType, DictType } from "../types.js";
|
|
3
3
|
import { valueOrExprToAst, valueOrExprToAstTyped } from "./ast.js";
|
|
4
4
|
import { AstSymbol, Expr, FactorySymbol, TypeSymbol } from "./expr.js";
|
|
5
|
+
import { equal, notEqual } from "./block.js";
|
|
5
6
|
import { none, some } from "../containers/variant.js";
|
|
6
7
|
import { CsvSerializeConfigType, csvSerializeOptionsToValue } from "../serialization/csv.js";
|
|
7
8
|
import { BlobType } from "../types.js";
|
|
@@ -58,7 +59,7 @@ export class ArrayExpr extends Expr {
|
|
|
58
59
|
return this[FactorySymbol]({
|
|
59
60
|
ast_type: "Builtin",
|
|
60
61
|
type: IntegerType,
|
|
61
|
-
|
|
62
|
+
loc_id: get_location_id(),
|
|
62
63
|
builtin: "ArraySize",
|
|
63
64
|
type_parameters: [this.value_type],
|
|
64
65
|
arguments: [this[AstSymbol]],
|
|
@@ -83,7 +84,7 @@ export class ArrayExpr extends Expr {
|
|
|
83
84
|
return this[FactorySymbol]({
|
|
84
85
|
ast_type: "Builtin",
|
|
85
86
|
type: IntegerType,
|
|
86
|
-
|
|
87
|
+
loc_id: get_location_id(),
|
|
87
88
|
builtin: "ArraySize",
|
|
88
89
|
type_parameters: [this.value_type],
|
|
89
90
|
arguments: [this[AstSymbol]],
|
|
@@ -111,7 +112,7 @@ export class ArrayExpr extends Expr {
|
|
|
111
112
|
return this[FactorySymbol]({
|
|
112
113
|
ast_type: "Builtin",
|
|
113
114
|
type: BooleanType,
|
|
114
|
-
|
|
115
|
+
loc_id: get_location_id(),
|
|
115
116
|
builtin: "ArrayHas",
|
|
116
117
|
type_parameters: [this.value_type],
|
|
117
118
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -150,7 +151,7 @@ export class ArrayExpr extends Expr {
|
|
|
150
151
|
return this[FactorySymbol]({
|
|
151
152
|
ast_type: "Builtin",
|
|
152
153
|
type: this.value_type,
|
|
153
|
-
|
|
154
|
+
loc_id: get_location_id(),
|
|
154
155
|
builtin: "ArrayGetOrDefault",
|
|
155
156
|
type_parameters: [this.value_type],
|
|
156
157
|
arguments: [this[AstSymbol], keyAst, defaultFnAst],
|
|
@@ -160,7 +161,7 @@ export class ArrayExpr extends Expr {
|
|
|
160
161
|
return this[FactorySymbol]({
|
|
161
162
|
ast_type: "Builtin",
|
|
162
163
|
type: this.value_type,
|
|
163
|
-
|
|
164
|
+
loc_id: get_location_id(),
|
|
164
165
|
builtin: "ArrayGet",
|
|
165
166
|
type_parameters: [this.value_type],
|
|
166
167
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -200,7 +201,7 @@ export class ArrayExpr extends Expr {
|
|
|
200
201
|
return this[FactorySymbol]({
|
|
201
202
|
ast_type: "Builtin",
|
|
202
203
|
type: this.value_type,
|
|
203
|
-
|
|
204
|
+
loc_id: get_location_id(),
|
|
204
205
|
builtin: "ArrayGetOrDefault",
|
|
205
206
|
type_parameters: [this.value_type],
|
|
206
207
|
arguments: [this[AstSymbol], keyAst, defaultFnAst],
|
|
@@ -210,7 +211,7 @@ export class ArrayExpr extends Expr {
|
|
|
210
211
|
return this[FactorySymbol]({
|
|
211
212
|
ast_type: "Builtin",
|
|
212
213
|
type: this.value_type,
|
|
213
|
-
|
|
214
|
+
loc_id: get_location_id(),
|
|
214
215
|
builtin: "ArrayGet",
|
|
215
216
|
type_parameters: [this.value_type],
|
|
216
217
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -238,7 +239,7 @@ export class ArrayExpr extends Expr {
|
|
|
238
239
|
return this[FactorySymbol]({
|
|
239
240
|
ast_type: "Builtin",
|
|
240
241
|
type: OptionType(this.value_type),
|
|
241
|
-
|
|
242
|
+
loc_id: get_location_id(),
|
|
242
243
|
builtin: "ArrayTryGet",
|
|
243
244
|
type_parameters: [this.value_type],
|
|
244
245
|
arguments: [this[AstSymbol], keyAst],
|
|
@@ -269,7 +270,7 @@ export class ArrayExpr extends Expr {
|
|
|
269
270
|
return this[FactorySymbol]({
|
|
270
271
|
ast_type: "Builtin",
|
|
271
272
|
type: NullType,
|
|
272
|
-
|
|
273
|
+
loc_id: get_location_id(),
|
|
273
274
|
builtin: "ArrayUpdate",
|
|
274
275
|
type_parameters: [this.value_type],
|
|
275
276
|
arguments: [this[AstSymbol], keyAst, valueAst],
|
|
@@ -282,14 +283,14 @@ export class ArrayExpr extends Expr {
|
|
|
282
283
|
* @see {@link update} for simply replacing the value.
|
|
283
284
|
*/
|
|
284
285
|
merge(key, value, updateFn) {
|
|
285
|
-
const
|
|
286
|
+
const loc_id = get_location_id();
|
|
286
287
|
const keyAst = valueOrExprToAstTyped(key, IntegerType);
|
|
287
288
|
const value2Type = value[TypeSymbol];
|
|
288
289
|
const updateFnExpr = Expr.from(updateFn, FunctionType([value2Type, this.value_type, IntegerType], this.value_type));
|
|
289
290
|
return this[FactorySymbol]({
|
|
290
291
|
ast_type: "Builtin",
|
|
291
292
|
type: NullType,
|
|
292
|
-
|
|
293
|
+
loc_id,
|
|
293
294
|
builtin: "ArrayMerge",
|
|
294
295
|
type_parameters: [this.value_type, value2Type],
|
|
295
296
|
arguments: [this[AstSymbol], keyAst, value[AstSymbol], updateFnExpr[AstSymbol]],
|
|
@@ -316,7 +317,7 @@ export class ArrayExpr extends Expr {
|
|
|
316
317
|
return this[FactorySymbol]({
|
|
317
318
|
ast_type: "Builtin",
|
|
318
319
|
type: NullType,
|
|
319
|
-
|
|
320
|
+
loc_id: get_location_id(),
|
|
320
321
|
builtin: "ArrayPushLast",
|
|
321
322
|
type_parameters: [this.value_type],
|
|
322
323
|
arguments: [this[AstSymbol], valueAst],
|
|
@@ -342,7 +343,7 @@ export class ArrayExpr extends Expr {
|
|
|
342
343
|
return this[FactorySymbol]({
|
|
343
344
|
ast_type: "Builtin",
|
|
344
345
|
type: this.value_type,
|
|
345
|
-
|
|
346
|
+
loc_id: get_location_id(),
|
|
346
347
|
builtin: "ArrayPopLast",
|
|
347
348
|
type_parameters: [this.value_type],
|
|
348
349
|
arguments: [this[AstSymbol]],
|
|
@@ -369,7 +370,7 @@ export class ArrayExpr extends Expr {
|
|
|
369
370
|
return this[FactorySymbol]({
|
|
370
371
|
ast_type: "Builtin",
|
|
371
372
|
type: NullType,
|
|
372
|
-
|
|
373
|
+
loc_id: get_location_id(),
|
|
373
374
|
builtin: "ArrayPushFirst",
|
|
374
375
|
type_parameters: [this.value_type],
|
|
375
376
|
arguments: [this[AstSymbol], valueAst],
|
|
@@ -395,7 +396,7 @@ export class ArrayExpr extends Expr {
|
|
|
395
396
|
return this[FactorySymbol]({
|
|
396
397
|
ast_type: "Builtin",
|
|
397
398
|
type: this.value_type,
|
|
398
|
-
|
|
399
|
+
loc_id: get_location_id(),
|
|
399
400
|
builtin: "ArrayPopFirst",
|
|
400
401
|
type_parameters: [this.value_type],
|
|
401
402
|
arguments: [this[AstSymbol]],
|
|
@@ -422,7 +423,7 @@ export class ArrayExpr extends Expr {
|
|
|
422
423
|
return this[FactorySymbol]({
|
|
423
424
|
ast_type: "Builtin",
|
|
424
425
|
type: NullType,
|
|
425
|
-
|
|
426
|
+
loc_id: get_location_id(),
|
|
426
427
|
builtin: "ArrayAppend",
|
|
427
428
|
type_parameters: [this.value_type],
|
|
428
429
|
arguments: [this[AstSymbol], arrayExpr[AstSymbol]],
|
|
@@ -450,7 +451,7 @@ export class ArrayExpr extends Expr {
|
|
|
450
451
|
return this[FactorySymbol]({
|
|
451
452
|
ast_type: "Builtin",
|
|
452
453
|
type: NullType,
|
|
453
|
-
|
|
454
|
+
loc_id: get_location_id(),
|
|
454
455
|
builtin: "ArrayPrepend",
|
|
455
456
|
type_parameters: [this.value_type],
|
|
456
457
|
arguments: [this[AstSymbol], arrayExpr[AstSymbol]],
|
|
@@ -498,7 +499,7 @@ export class ArrayExpr extends Expr {
|
|
|
498
499
|
return this[FactorySymbol]({
|
|
499
500
|
ast_type: "Builtin",
|
|
500
501
|
type: NullType,
|
|
501
|
-
|
|
502
|
+
loc_id: get_location_id(),
|
|
502
503
|
builtin: "ArrayMergeAll",
|
|
503
504
|
type_parameters: [this.value_type, value2Type],
|
|
504
505
|
arguments: [this[AstSymbol], array[AstSymbol], mergeFnExpr[AstSymbol]],
|
|
@@ -523,7 +524,7 @@ export class ArrayExpr extends Expr {
|
|
|
523
524
|
return this[FactorySymbol]({
|
|
524
525
|
ast_type: "Builtin",
|
|
525
526
|
type: NullType,
|
|
526
|
-
|
|
527
|
+
loc_id: get_location_id(),
|
|
527
528
|
builtin: "ArrayClear",
|
|
528
529
|
type_parameters: [this.value_type],
|
|
529
530
|
arguments: [this[AstSymbol]],
|
|
@@ -579,7 +580,7 @@ export class ArrayExpr extends Expr {
|
|
|
579
580
|
return this[FactorySymbol]({
|
|
580
581
|
ast_type: "Builtin",
|
|
581
582
|
type: NullType,
|
|
582
|
-
|
|
583
|
+
loc_id: get_location_id(),
|
|
583
584
|
builtin: "ArraySortInPlace",
|
|
584
585
|
type_parameters: [this.value_type, projectedType],
|
|
585
586
|
arguments: [this[AstSymbol], byExpr[AstSymbol]],
|
|
@@ -634,7 +635,7 @@ export class ArrayExpr extends Expr {
|
|
|
634
635
|
return this[FactorySymbol]({
|
|
635
636
|
ast_type: "Builtin",
|
|
636
637
|
type: this[TypeSymbol],
|
|
637
|
-
|
|
638
|
+
loc_id: get_location_id(),
|
|
638
639
|
builtin: "ArraySort",
|
|
639
640
|
type_parameters: [this.value_type, projectedType],
|
|
640
641
|
arguments: [this[AstSymbol], byExpr[AstSymbol]],
|
|
@@ -661,7 +662,7 @@ export class ArrayExpr extends Expr {
|
|
|
661
662
|
return this[FactorySymbol]({
|
|
662
663
|
ast_type: "Builtin",
|
|
663
664
|
type: NullType,
|
|
664
|
-
|
|
665
|
+
loc_id: get_location_id(),
|
|
665
666
|
builtin: "ArrayReverseInPlace",
|
|
666
667
|
type_parameters: [this.value_type],
|
|
667
668
|
arguments: [this[AstSymbol]],
|
|
@@ -690,7 +691,7 @@ export class ArrayExpr extends Expr {
|
|
|
690
691
|
return this[FactorySymbol]({
|
|
691
692
|
ast_type: "Builtin",
|
|
692
693
|
type: this[TypeSymbol],
|
|
693
|
-
|
|
694
|
+
loc_id: get_location_id(),
|
|
694
695
|
builtin: "ArrayReverse",
|
|
695
696
|
type_parameters: [this.value_type],
|
|
696
697
|
arguments: [this[AstSymbol]],
|
|
@@ -739,7 +740,7 @@ export class ArrayExpr extends Expr {
|
|
|
739
740
|
return this[FactorySymbol]({
|
|
740
741
|
ast_type: "Builtin",
|
|
741
742
|
type: BooleanType,
|
|
742
|
-
|
|
743
|
+
loc_id: get_location_id(),
|
|
743
744
|
builtin: "ArrayIsSorted",
|
|
744
745
|
type_parameters: [this.value_type, projectedType],
|
|
745
746
|
arguments: [this[AstSymbol], byExpr[AstSymbol]],
|
|
@@ -796,7 +797,7 @@ export class ArrayExpr extends Expr {
|
|
|
796
797
|
return this[FactorySymbol]({
|
|
797
798
|
ast_type: "Builtin",
|
|
798
799
|
type: IntegerType,
|
|
799
|
-
|
|
800
|
+
loc_id: get_location_id(),
|
|
800
801
|
builtin: "ArrayFindSortedFirst",
|
|
801
802
|
type_parameters: [this.value_type, projectedType],
|
|
802
803
|
arguments: [this[AstSymbol], valueAst, byExpr[AstSymbol]],
|
|
@@ -841,7 +842,7 @@ export class ArrayExpr extends Expr {
|
|
|
841
842
|
return this[FactorySymbol]({
|
|
842
843
|
ast_type: "Builtin",
|
|
843
844
|
type: IntegerType,
|
|
844
|
-
|
|
845
|
+
loc_id: get_location_id(),
|
|
845
846
|
builtin: "ArrayFindSortedLast",
|
|
846
847
|
type_parameters: [this.value_type, projectedType],
|
|
847
848
|
arguments: [this[AstSymbol], valueAst, byExpr[AstSymbol]],
|
|
@@ -885,7 +886,7 @@ export class ArrayExpr extends Expr {
|
|
|
885
886
|
return this[FactorySymbol]({
|
|
886
887
|
ast_type: "Builtin",
|
|
887
888
|
type: StructType({ start: IntegerType, end: IntegerType }),
|
|
888
|
-
|
|
889
|
+
loc_id: get_location_id(),
|
|
889
890
|
builtin: "ArrayFindSortedRange",
|
|
890
891
|
type_parameters: [this.value_type, projectedType],
|
|
891
892
|
arguments: [this[AstSymbol], valueAst, byExpr[AstSymbol]],
|
|
@@ -917,7 +918,7 @@ export class ArrayExpr extends Expr {
|
|
|
917
918
|
return this[FactorySymbol]({
|
|
918
919
|
ast_type: "Builtin",
|
|
919
920
|
type: this[TypeSymbol],
|
|
920
|
-
|
|
921
|
+
loc_id: get_location_id(),
|
|
921
922
|
builtin: "ArraySlice",
|
|
922
923
|
type_parameters: [this.value_type],
|
|
923
924
|
arguments: [this[AstSymbol], startExpr[AstSymbol], endExpr[AstSymbol]],
|
|
@@ -946,7 +947,7 @@ export class ArrayExpr extends Expr {
|
|
|
946
947
|
return this[FactorySymbol]({
|
|
947
948
|
ast_type: "Builtin",
|
|
948
949
|
type: this[TypeSymbol],
|
|
949
|
-
|
|
950
|
+
loc_id: get_location_id(),
|
|
950
951
|
builtin: "ArrayConcat",
|
|
951
952
|
type_parameters: [this.value_type],
|
|
952
953
|
arguments: [this[AstSymbol], otherExpr[AstSymbol]],
|
|
@@ -984,8 +985,8 @@ export class ArrayExpr extends Expr {
|
|
|
984
985
|
const keysExpr = Expr.from(keys, ArrayType(IntegerType));
|
|
985
986
|
let default_function_ast;
|
|
986
987
|
if (onMissing === undefined) {
|
|
987
|
-
const
|
|
988
|
-
const default_function = Expr.function([IntegerType], this.value_type, ($, key) => $.error(Expr.str `Cannot get key ${key} from array`,
|
|
988
|
+
const loc_id = get_location_id();
|
|
989
|
+
const default_function = Expr.function([IntegerType], this.value_type, ($, key) => $.error(Expr.str `Cannot get key ${key} from array`, loc_id));
|
|
989
990
|
default_function_ast = Expr.ast(default_function);
|
|
990
991
|
}
|
|
991
992
|
else {
|
|
@@ -995,7 +996,7 @@ export class ArrayExpr extends Expr {
|
|
|
995
996
|
return this[FactorySymbol]({
|
|
996
997
|
ast_type: "Builtin",
|
|
997
998
|
type: this[TypeSymbol],
|
|
998
|
-
|
|
999
|
+
loc_id: get_location_id(),
|
|
999
1000
|
builtin: "ArrayGetKeys",
|
|
1000
1001
|
type_parameters: [this.value_type],
|
|
1001
1002
|
arguments: [this[AstSymbol], keysExpr[AstSymbol], default_function_ast],
|
|
@@ -1030,7 +1031,7 @@ export class ArrayExpr extends Expr {
|
|
|
1030
1031
|
return this[FactorySymbol]({
|
|
1031
1032
|
ast_type: "Builtin",
|
|
1032
1033
|
type: NullType,
|
|
1033
|
-
|
|
1034
|
+
loc_id: get_location_id(),
|
|
1034
1035
|
builtin: "ArrayForEach",
|
|
1035
1036
|
type_parameters: [this.value_type, returnType],
|
|
1036
1037
|
arguments: [this[AstSymbol], fn[AstSymbol]],
|
|
@@ -1061,7 +1062,7 @@ export class ArrayExpr extends Expr {
|
|
|
1061
1062
|
return this[FactorySymbol]({
|
|
1062
1063
|
ast_type: "Builtin",
|
|
1063
1064
|
type: this[TypeSymbol],
|
|
1064
|
-
|
|
1065
|
+
loc_id: get_location_id(),
|
|
1065
1066
|
builtin: "ArrayCopy",
|
|
1066
1067
|
type_parameters: [this.value_type],
|
|
1067
1068
|
arguments: [this[AstSymbol]],
|
|
@@ -1087,7 +1088,7 @@ export class ArrayExpr extends Expr {
|
|
|
1087
1088
|
return this[FactorySymbol]({
|
|
1088
1089
|
ast_type: "Builtin",
|
|
1089
1090
|
type: ArrayType(output_type),
|
|
1090
|
-
|
|
1091
|
+
loc_id: get_location_id(),
|
|
1091
1092
|
builtin: "ArrayMap",
|
|
1092
1093
|
type_parameters: [this.value_type, output_type],
|
|
1093
1094
|
arguments: [this[AstSymbol], fn[AstSymbol]],
|
|
@@ -1159,7 +1160,7 @@ export class ArrayExpr extends Expr {
|
|
|
1159
1160
|
}
|
|
1160
1161
|
return this[FactorySymbol]({
|
|
1161
1162
|
ast_type: "Builtin",
|
|
1162
|
-
|
|
1163
|
+
loc_id: get_location_id(),
|
|
1163
1164
|
type: this[TypeSymbol],
|
|
1164
1165
|
builtin: "ArrayFilter",
|
|
1165
1166
|
type_parameters: [this.value_type],
|
|
@@ -1183,7 +1184,7 @@ export class ArrayExpr extends Expr {
|
|
|
1183
1184
|
return this[FactorySymbol]({
|
|
1184
1185
|
ast_type: "Builtin",
|
|
1185
1186
|
type: ArrayType(someType),
|
|
1186
|
-
|
|
1187
|
+
loc_id: get_location_id(),
|
|
1187
1188
|
builtin: "ArrayFilterMap",
|
|
1188
1189
|
type_parameters: [this.value_type, someType],
|
|
1189
1190
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1202,7 +1203,7 @@ export class ArrayExpr extends Expr {
|
|
|
1202
1203
|
return this[FactorySymbol]({
|
|
1203
1204
|
ast_type: "Builtin",
|
|
1204
1205
|
type: returnType,
|
|
1205
|
-
|
|
1206
|
+
loc_id: get_location_id(),
|
|
1206
1207
|
builtin: "ArrayFirstMap",
|
|
1207
1208
|
type_parameters: [this.value_type, someType],
|
|
1208
1209
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1289,7 +1290,7 @@ export class ArrayExpr extends Expr {
|
|
|
1289
1290
|
return this[FactorySymbol]({
|
|
1290
1291
|
ast_type: "Builtin",
|
|
1291
1292
|
type: returnType,
|
|
1292
|
-
|
|
1293
|
+
loc_id: get_location_id(),
|
|
1293
1294
|
builtin: "ArrayFold",
|
|
1294
1295
|
type_parameters: [this.value_type, returnType],
|
|
1295
1296
|
arguments: [this[AstSymbol], initAst, combineAst],
|
|
@@ -1302,7 +1303,7 @@ export class ArrayExpr extends Expr {
|
|
|
1302
1303
|
return this[FactorySymbol]({
|
|
1303
1304
|
ast_type: "Builtin",
|
|
1304
1305
|
type: mapType,
|
|
1305
|
-
|
|
1306
|
+
loc_id: get_location_id(),
|
|
1306
1307
|
builtin: "ArrayMapReduce",
|
|
1307
1308
|
type_parameters: [this.value_type, mapType],
|
|
1308
1309
|
arguments: [this[AstSymbol], mapAst, combineAst],
|
|
@@ -1592,7 +1593,7 @@ export class ArrayExpr extends Expr {
|
|
|
1592
1593
|
return this[FactorySymbol]({
|
|
1593
1594
|
ast_type: "Builtin",
|
|
1594
1595
|
type: StringType,
|
|
1595
|
-
|
|
1596
|
+
loc_id: get_location_id(),
|
|
1596
1597
|
builtin: "ArrayStringJoin",
|
|
1597
1598
|
type_parameters: [],
|
|
1598
1599
|
arguments: [this[AstSymbol], stringAst],
|
|
@@ -1604,7 +1605,7 @@ export class ArrayExpr extends Expr {
|
|
|
1604
1605
|
return this[FactorySymbol]({
|
|
1605
1606
|
ast_type: "Builtin",
|
|
1606
1607
|
type: SetType(keyType),
|
|
1607
|
-
|
|
1608
|
+
loc_id: get_location_id(),
|
|
1608
1609
|
builtin: "ArrayToSet",
|
|
1609
1610
|
type_parameters: [this.value_type, keyType],
|
|
1610
1611
|
arguments: [this[AstSymbol], keyFnAst],
|
|
@@ -1617,8 +1618,8 @@ export class ArrayExpr extends Expr {
|
|
|
1617
1618
|
const valueType = valueFnAst.type.output;
|
|
1618
1619
|
let onConflictAst;
|
|
1619
1620
|
if (onConflictFn === undefined) {
|
|
1620
|
-
const
|
|
1621
|
-
const onConflictFunction = Expr.function([valueType, valueType, keyType], valueType, ($, existing, value, key) => $.error(Expr.str `Cannot insert duplicate key ${key} into dict`,
|
|
1621
|
+
const loc_id = get_location_id();
|
|
1622
|
+
const onConflictFunction = Expr.function([valueType, valueType, keyType], valueType, ($, existing, value, key) => $.error(Expr.str `Cannot insert duplicate key ${key} into dict`, loc_id));
|
|
1622
1623
|
onConflictAst = Expr.ast(onConflictFunction);
|
|
1623
1624
|
}
|
|
1624
1625
|
else {
|
|
@@ -1627,7 +1628,7 @@ export class ArrayExpr extends Expr {
|
|
|
1627
1628
|
return this[FactorySymbol]({
|
|
1628
1629
|
ast_type: "Builtin",
|
|
1629
1630
|
type: DictType(keyType, valueType),
|
|
1630
|
-
|
|
1631
|
+
loc_id: get_location_id(),
|
|
1631
1632
|
builtin: "ArrayToDict",
|
|
1632
1633
|
type_parameters: [this.value_type, keyType, valueType],
|
|
1633
1634
|
arguments: [this[AstSymbol], keyFnAst, valueFnAst, onConflictAst],
|
|
@@ -1643,7 +1644,7 @@ export class ArrayExpr extends Expr {
|
|
|
1643
1644
|
return this[FactorySymbol]({
|
|
1644
1645
|
ast_type: "Builtin",
|
|
1645
1646
|
type: ArrayType(elementType),
|
|
1646
|
-
|
|
1647
|
+
loc_id: get_location_id(),
|
|
1647
1648
|
builtin: "ArrayFlattenToArray",
|
|
1648
1649
|
type_parameters: [this.value_type, elementType],
|
|
1649
1650
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1659,7 +1660,7 @@ export class ArrayExpr extends Expr {
|
|
|
1659
1660
|
return this[FactorySymbol]({
|
|
1660
1661
|
ast_type: "Builtin",
|
|
1661
1662
|
type: SetType(elementType),
|
|
1662
|
-
|
|
1663
|
+
loc_id: get_location_id(),
|
|
1663
1664
|
builtin: "ArrayFlattenToSet",
|
|
1664
1665
|
type_parameters: [this.value_type, elementType],
|
|
1665
1666
|
arguments: [this[AstSymbol], fnAst],
|
|
@@ -1675,8 +1676,8 @@ export class ArrayExpr extends Expr {
|
|
|
1675
1676
|
const valueType = returnType.value;
|
|
1676
1677
|
let onConflictAst;
|
|
1677
1678
|
if (onConflictFn === undefined) {
|
|
1678
|
-
const
|
|
1679
|
-
const onConflictFunction = Expr.function([valueType, valueType, keyType], valueType, ($, existing, value, key) => $.error(Expr.str `Cannot insert duplicate key ${key} into dict`,
|
|
1679
|
+
const loc_id = get_location_id();
|
|
1680
|
+
const onConflictFunction = Expr.function([valueType, valueType, keyType], valueType, ($, existing, value, key) => $.error(Expr.str `Cannot insert duplicate key ${key} into dict`, loc_id));
|
|
1680
1681
|
onConflictAst = Expr.ast(onConflictFunction);
|
|
1681
1682
|
}
|
|
1682
1683
|
else {
|
|
@@ -1685,7 +1686,7 @@ export class ArrayExpr extends Expr {
|
|
|
1685
1686
|
return this[FactorySymbol]({
|
|
1686
1687
|
ast_type: "Builtin",
|
|
1687
1688
|
type: DictType(keyType, valueType),
|
|
1688
|
-
|
|
1689
|
+
loc_id: get_location_id(),
|
|
1689
1690
|
builtin: "ArrayFlattenToDict",
|
|
1690
1691
|
type_parameters: [this.value_type, keyType, valueType],
|
|
1691
1692
|
arguments: [this[AstSymbol], fnAst, onConflictAst],
|
|
@@ -1701,7 +1702,7 @@ export class ArrayExpr extends Expr {
|
|
|
1701
1702
|
return this[FactorySymbol]({
|
|
1702
1703
|
ast_type: "Builtin",
|
|
1703
1704
|
type: DictType(keyType, initType),
|
|
1704
|
-
|
|
1705
|
+
loc_id: get_location_id(),
|
|
1705
1706
|
builtin: "ArrayGroupFold",
|
|
1706
1707
|
type_parameters: [this.value_type, keyType, initType],
|
|
1707
1708
|
arguments: [this[AstSymbol], keyFnAst, initFnAst, reduceFnAst],
|
|
@@ -1905,11 +1906,60 @@ export class ArrayExpr extends Expr {
|
|
|
1905
1906
|
return this[FactorySymbol]({
|
|
1906
1907
|
ast_type: "Builtin",
|
|
1907
1908
|
type: BlobType,
|
|
1908
|
-
|
|
1909
|
+
loc_id: get_location_id(),
|
|
1909
1910
|
builtin: "ArrayEncodeCsv",
|
|
1910
1911
|
type_parameters: [this.value_type, CsvSerializeConfigType],
|
|
1911
1912
|
arguments: [this[AstSymbol], configAst],
|
|
1912
1913
|
});
|
|
1913
1914
|
}
|
|
1915
|
+
/**
|
|
1916
|
+
* Checks if this array equals another array (deep comparison).
|
|
1917
|
+
*
|
|
1918
|
+
* @param other - The array to compare against
|
|
1919
|
+
* @returns A BooleanExpr that is true if the arrays are deeply equal
|
|
1920
|
+
*
|
|
1921
|
+
* @example
|
|
1922
|
+
* ```ts
|
|
1923
|
+
* const isEqual = East.function([ArrayType(IntegerType), ArrayType(IntegerType)], BooleanType, ($, a, b) => {
|
|
1924
|
+
* $.return(a.equals(b));
|
|
1925
|
+
* });
|
|
1926
|
+
* const compiled = East.compile(isEqual.toIR(), []);
|
|
1927
|
+
* compiled([1n, 2n, 3n], [1n, 2n, 3n]); // true
|
|
1928
|
+
* compiled([1n, 2n], [1n, 2n, 3n]); // false
|
|
1929
|
+
* ```
|
|
1930
|
+
*/
|
|
1931
|
+
equals(other) {
|
|
1932
|
+
return equal(this, other);
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Checks if this array does not equal another array.
|
|
1936
|
+
*
|
|
1937
|
+
* @param other - The array to compare against
|
|
1938
|
+
* @returns A BooleanExpr that is true if the arrays are not equal
|
|
1939
|
+
*
|
|
1940
|
+
* @example
|
|
1941
|
+
* ```ts
|
|
1942
|
+
* const isNotEqual = East.function([ArrayType(IntegerType), ArrayType(IntegerType)], BooleanType, ($, a, b) => {
|
|
1943
|
+
* $.return(a.notEquals(b));
|
|
1944
|
+
* });
|
|
1945
|
+
* const compiled = East.compile(isNotEqual.toIR(), []);
|
|
1946
|
+
* compiled([1n, 2n], [1n, 2n, 3n]); // true
|
|
1947
|
+
* compiled([1n, 2n, 3n], [1n, 2n, 3n]); // false
|
|
1948
|
+
* ```
|
|
1949
|
+
*/
|
|
1950
|
+
notEquals(other) {
|
|
1951
|
+
return notEqual(this, other);
|
|
1952
|
+
}
|
|
1953
|
+
// ============================================================================
|
|
1954
|
+
// Aliases for comparison operations
|
|
1955
|
+
// ============================================================================
|
|
1956
|
+
/** Alias for {@link equals} */
|
|
1957
|
+
eq = this.equals;
|
|
1958
|
+
/** Alias for {@link equals} */
|
|
1959
|
+
equal = this.equals;
|
|
1960
|
+
/** Alias for {@link notEquals} */
|
|
1961
|
+
ne = this.notEquals;
|
|
1962
|
+
/** Alias for {@link notEquals} */
|
|
1963
|
+
notEqual = this.notEquals;
|
|
1914
1964
|
}
|
|
1915
1965
|
//# sourceMappingURL=array.js.map
|