@elaraai/east 0.0.1-beta.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.
Files changed (251) hide show
  1. package/LICENSE.md +682 -0
  2. package/README.md +276 -0
  3. package/dist/src/analyze.d.ts +95 -0
  4. package/dist/src/analyze.d.ts.map +1 -0
  5. package/dist/src/analyze.js +1110 -0
  6. package/dist/src/analyze.js.map +1 -0
  7. package/dist/src/ast.d.ts +263 -0
  8. package/dist/src/ast.d.ts.map +1 -0
  9. package/dist/src/ast.js +151 -0
  10. package/dist/src/ast.js.map +1 -0
  11. package/dist/src/ast_to_ir.d.ts +24 -0
  12. package/dist/src/ast_to_ir.d.ts.map +1 -0
  13. package/dist/src/ast_to_ir.js +834 -0
  14. package/dist/src/ast_to_ir.js.map +1 -0
  15. package/dist/src/builtins.d.ts +18 -0
  16. package/dist/src/builtins.d.ts.map +1 -0
  17. package/dist/src/builtins.js +1105 -0
  18. package/dist/src/builtins.js.map +1 -0
  19. package/dist/src/comparison.d.ts +28 -0
  20. package/dist/src/comparison.d.ts.map +1 -0
  21. package/dist/src/comparison.js +1017 -0
  22. package/dist/src/comparison.js.map +1 -0
  23. package/dist/src/compile.d.ts +22 -0
  24. package/dist/src/compile.d.ts.map +1 -0
  25. package/dist/src/compile.js +3260 -0
  26. package/dist/src/compile.js.map +1 -0
  27. package/dist/src/containers/ref.d.ts +106 -0
  28. package/dist/src/containers/ref.d.ts.map +1 -0
  29. package/dist/src/containers/ref.js +100 -0
  30. package/dist/src/containers/ref.js.map +1 -0
  31. package/dist/src/containers/sortedmap.d.ts +165 -0
  32. package/dist/src/containers/sortedmap.d.ts.map +1 -0
  33. package/dist/src/containers/sortedmap.js +237 -0
  34. package/dist/src/containers/sortedmap.js.map +1 -0
  35. package/dist/src/containers/sortedset.d.ts +185 -0
  36. package/dist/src/containers/sortedset.d.ts.map +1 -0
  37. package/dist/src/containers/sortedset.js +312 -0
  38. package/dist/src/containers/sortedset.js.map +1 -0
  39. package/dist/src/containers/variant.d.ts +131 -0
  40. package/dist/src/containers/variant.d.ts.map +1 -0
  41. package/dist/src/containers/variant.js +68 -0
  42. package/dist/src/containers/variant.js.map +1 -0
  43. package/dist/src/datetime_format/parse.d.ts +50 -0
  44. package/dist/src/datetime_format/parse.d.ts.map +1 -0
  45. package/dist/src/datetime_format/parse.js +908 -0
  46. package/dist/src/datetime_format/parse.js.map +1 -0
  47. package/dist/src/datetime_format/print.d.ts +35 -0
  48. package/dist/src/datetime_format/print.d.ts.map +1 -0
  49. package/dist/src/datetime_format/print.js +157 -0
  50. package/dist/src/datetime_format/print.js.map +1 -0
  51. package/dist/src/datetime_format/tokenize.d.ts +76 -0
  52. package/dist/src/datetime_format/tokenize.d.ts.map +1 -0
  53. package/dist/src/datetime_format/tokenize.js +271 -0
  54. package/dist/src/datetime_format/tokenize.js.map +1 -0
  55. package/dist/src/datetime_format/types.d.ts +99 -0
  56. package/dist/src/datetime_format/types.d.ts.map +1 -0
  57. package/dist/src/datetime_format/types.js +103 -0
  58. package/dist/src/datetime_format/types.js.map +1 -0
  59. package/dist/src/datetime_format/validate.d.ts +51 -0
  60. package/dist/src/datetime_format/validate.d.ts.map +1 -0
  61. package/dist/src/datetime_format/validate.js +208 -0
  62. package/dist/src/datetime_format/validate.js.map +1 -0
  63. package/dist/src/default.d.ts +21 -0
  64. package/dist/src/default.d.ts.map +1 -0
  65. package/dist/src/default.js +82 -0
  66. package/dist/src/default.js.map +1 -0
  67. package/dist/src/eastir.d.ts +33 -0
  68. package/dist/src/eastir.d.ts.map +1 -0
  69. package/dist/src/eastir.js +92 -0
  70. package/dist/src/eastir.js.map +1 -0
  71. package/dist/src/error.d.ts +13 -0
  72. package/dist/src/error.d.ts.map +1 -0
  73. package/dist/src/error.js +8 -0
  74. package/dist/src/error.js.map +1 -0
  75. package/dist/src/expr/array.d.ts +1711 -0
  76. package/dist/src/expr/array.d.ts.map +1 -0
  77. package/dist/src/expr/array.js +1805 -0
  78. package/dist/src/expr/array.js.map +1 -0
  79. package/dist/src/expr/ast.d.ts +17 -0
  80. package/dist/src/expr/ast.d.ts.map +1 -0
  81. package/dist/src/expr/ast.js +302 -0
  82. package/dist/src/expr/ast.js.map +1 -0
  83. package/dist/src/expr/blob.d.ts +141 -0
  84. package/dist/src/expr/blob.d.ts.map +1 -0
  85. package/dist/src/expr/blob.js +198 -0
  86. package/dist/src/expr/blob.js.map +1 -0
  87. package/dist/src/expr/block.d.ts +201 -0
  88. package/dist/src/expr/block.d.ts.map +1 -0
  89. package/dist/src/expr/block.js +1505 -0
  90. package/dist/src/expr/block.js.map +1 -0
  91. package/dist/src/expr/boolean.d.ts +207 -0
  92. package/dist/src/expr/boolean.d.ts.map +1 -0
  93. package/dist/src/expr/boolean.js +261 -0
  94. package/dist/src/expr/boolean.js.map +1 -0
  95. package/dist/src/expr/datetime.d.ts +544 -0
  96. package/dist/src/expr/datetime.d.ts.map +1 -0
  97. package/dist/src/expr/datetime.js +980 -0
  98. package/dist/src/expr/datetime.js.map +1 -0
  99. package/dist/src/expr/dict.d.ts +1242 -0
  100. package/dist/src/expr/dict.d.ts.map +1 -0
  101. package/dist/src/expr/dict.js +1492 -0
  102. package/dist/src/expr/dict.js.map +1 -0
  103. package/dist/src/expr/expr.d.ts +95 -0
  104. package/dist/src/expr/expr.d.ts.map +1 -0
  105. package/dist/src/expr/expr.js +171 -0
  106. package/dist/src/expr/expr.js.map +1 -0
  107. package/dist/src/expr/float.d.ts +357 -0
  108. package/dist/src/expr/float.d.ts.map +1 -0
  109. package/dist/src/expr/float.js +637 -0
  110. package/dist/src/expr/float.js.map +1 -0
  111. package/dist/src/expr/function.d.ts +46 -0
  112. package/dist/src/expr/function.d.ts.map +1 -0
  113. package/dist/src/expr/function.js +58 -0
  114. package/dist/src/expr/function.js.map +1 -0
  115. package/dist/src/expr/index.d.ts +450 -0
  116. package/dist/src/expr/index.d.ts.map +1 -0
  117. package/dist/src/expr/index.js +423 -0
  118. package/dist/src/expr/index.js.map +1 -0
  119. package/dist/src/expr/integer.d.ts +256 -0
  120. package/dist/src/expr/integer.d.ts.map +1 -0
  121. package/dist/src/expr/integer.js +311 -0
  122. package/dist/src/expr/integer.js.map +1 -0
  123. package/dist/src/expr/libs/array.d.ts +106 -0
  124. package/dist/src/expr/libs/array.d.ts.map +1 -0
  125. package/dist/src/expr/libs/array.js +140 -0
  126. package/dist/src/expr/libs/array.js.map +1 -0
  127. package/dist/src/expr/libs/blob.d.ts +42 -0
  128. package/dist/src/expr/libs/blob.d.ts.map +1 -0
  129. package/dist/src/expr/libs/blob.js +70 -0
  130. package/dist/src/expr/libs/blob.js.map +1 -0
  131. package/dist/src/expr/libs/datetime.d.ts +479 -0
  132. package/dist/src/expr/libs/datetime.d.ts.map +1 -0
  133. package/dist/src/expr/libs/datetime.js +624 -0
  134. package/dist/src/expr/libs/datetime.js.map +1 -0
  135. package/dist/src/expr/libs/dict.d.ts +66 -0
  136. package/dist/src/expr/libs/dict.d.ts.map +1 -0
  137. package/dist/src/expr/libs/dict.js +77 -0
  138. package/dist/src/expr/libs/dict.js.map +1 -0
  139. package/dist/src/expr/libs/float.d.ts +299 -0
  140. package/dist/src/expr/libs/float.d.ts.map +1 -0
  141. package/dist/src/expr/libs/float.js +564 -0
  142. package/dist/src/expr/libs/float.js.map +1 -0
  143. package/dist/src/expr/libs/integer.d.ts +228 -0
  144. package/dist/src/expr/libs/integer.d.ts.map +1 -0
  145. package/dist/src/expr/libs/integer.js +398 -0
  146. package/dist/src/expr/libs/integer.js.map +1 -0
  147. package/dist/src/expr/libs/set.d.ts +59 -0
  148. package/dist/src/expr/libs/set.d.ts.map +1 -0
  149. package/dist/src/expr/libs/set.js +69 -0
  150. package/dist/src/expr/libs/set.js.map +1 -0
  151. package/dist/src/expr/libs/string.d.ts +71 -0
  152. package/dist/src/expr/libs/string.d.ts.map +1 -0
  153. package/dist/src/expr/libs/string.js +75 -0
  154. package/dist/src/expr/libs/string.js.map +1 -0
  155. package/dist/src/expr/never.d.ts +15 -0
  156. package/dist/src/expr/never.d.ts.map +1 -0
  157. package/dist/src/expr/never.js +12 -0
  158. package/dist/src/expr/never.js.map +1 -0
  159. package/dist/src/expr/null.d.ts +15 -0
  160. package/dist/src/expr/null.d.ts.map +1 -0
  161. package/dist/src/expr/null.js +12 -0
  162. package/dist/src/expr/null.js.map +1 -0
  163. package/dist/src/expr/ref.d.ts +103 -0
  164. package/dist/src/expr/ref.d.ts.map +1 -0
  165. package/dist/src/expr/ref.js +131 -0
  166. package/dist/src/expr/ref.js.map +1 -0
  167. package/dist/src/expr/regex_validation.d.ts +25 -0
  168. package/dist/src/expr/regex_validation.d.ts.map +1 -0
  169. package/dist/src/expr/regex_validation.js +130 -0
  170. package/dist/src/expr/regex_validation.js.map +1 -0
  171. package/dist/src/expr/set.d.ts +1071 -0
  172. package/dist/src/expr/set.d.ts.map +1 -0
  173. package/dist/src/expr/set.js +1137 -0
  174. package/dist/src/expr/set.js.map +1 -0
  175. package/dist/src/expr/string.d.ts +414 -0
  176. package/dist/src/expr/string.d.ts.map +1 -0
  177. package/dist/src/expr/string.js +683 -0
  178. package/dist/src/expr/string.js.map +1 -0
  179. package/dist/src/expr/struct.d.ts +48 -0
  180. package/dist/src/expr/struct.d.ts.map +1 -0
  181. package/dist/src/expr/struct.js +65 -0
  182. package/dist/src/expr/struct.js.map +1 -0
  183. package/dist/src/expr/types.d.ts +68 -0
  184. package/dist/src/expr/types.d.ts.map +1 -0
  185. package/dist/src/expr/types.js +6 -0
  186. package/dist/src/expr/types.js.map +1 -0
  187. package/dist/src/expr/variant.d.ts +137 -0
  188. package/dist/src/expr/variant.d.ts.map +1 -0
  189. package/dist/src/expr/variant.js +105 -0
  190. package/dist/src/expr/variant.js.map +1 -0
  191. package/dist/src/fuzz.d.ts +80 -0
  192. package/dist/src/fuzz.d.ts.map +1 -0
  193. package/dist/src/fuzz.js +300 -0
  194. package/dist/src/fuzz.js.map +1 -0
  195. package/dist/src/index.d.ts +21 -0
  196. package/dist/src/index.d.ts.map +1 -0
  197. package/dist/src/index.js +21 -0
  198. package/dist/src/index.js.map +1 -0
  199. package/dist/src/internal.d.ts +36 -0
  200. package/dist/src/internal.d.ts.map +1 -0
  201. package/dist/src/internal.js +11 -0
  202. package/dist/src/internal.js.map +1 -0
  203. package/dist/src/ir.d.ts +1571 -0
  204. package/dist/src/ir.d.ts.map +1 -0
  205. package/dist/src/ir.js +56 -0
  206. package/dist/src/ir.js.map +1 -0
  207. package/dist/src/location.d.ts +48 -0
  208. package/dist/src/location.d.ts.map +1 -0
  209. package/dist/src/location.js +62 -0
  210. package/dist/src/location.js.map +1 -0
  211. package/dist/src/platform.d.ts +21 -0
  212. package/dist/src/platform.d.ts.map +1 -0
  213. package/dist/src/platform.js +8 -0
  214. package/dist/src/platform.js.map +1 -0
  215. package/dist/src/serialization/beast.d.ts +39 -0
  216. package/dist/src/serialization/beast.d.ts.map +1 -0
  217. package/dist/src/serialization/beast.js +555 -0
  218. package/dist/src/serialization/beast.js.map +1 -0
  219. package/dist/src/serialization/beast2-stream.d.ts +38 -0
  220. package/dist/src/serialization/beast2-stream.d.ts.map +1 -0
  221. package/dist/src/serialization/beast2-stream.js +665 -0
  222. package/dist/src/serialization/beast2-stream.js.map +1 -0
  223. package/dist/src/serialization/beast2.d.ts +41 -0
  224. package/dist/src/serialization/beast2.d.ts.map +1 -0
  225. package/dist/src/serialization/beast2.js +489 -0
  226. package/dist/src/serialization/beast2.js.map +1 -0
  227. package/dist/src/serialization/binary-utils.d.ts +151 -0
  228. package/dist/src/serialization/binary-utils.d.ts.map +1 -0
  229. package/dist/src/serialization/binary-utils.js +929 -0
  230. package/dist/src/serialization/binary-utils.js.map +1 -0
  231. package/dist/src/serialization/east.d.ts +84 -0
  232. package/dist/src/serialization/east.d.ts.map +1 -0
  233. package/dist/src/serialization/east.js +1802 -0
  234. package/dist/src/serialization/east.js.map +1 -0
  235. package/dist/src/serialization/index.d.ts +11 -0
  236. package/dist/src/serialization/index.d.ts.map +1 -0
  237. package/dist/src/serialization/index.js +12 -0
  238. package/dist/src/serialization/index.js.map +1 -0
  239. package/dist/src/serialization/json.d.ts +36 -0
  240. package/dist/src/serialization/json.d.ts.map +1 -0
  241. package/dist/src/serialization/json.js +849 -0
  242. package/dist/src/serialization/json.js.map +1 -0
  243. package/dist/src/type_of_type.d.ts +115 -0
  244. package/dist/src/type_of_type.d.ts.map +1 -0
  245. package/dist/src/type_of_type.js +362 -0
  246. package/dist/src/type_of_type.js.map +1 -0
  247. package/dist/src/types.d.ts +648 -0
  248. package/dist/src/types.d.ts.map +1 -0
  249. package/dist/src/types.js +1631 -0
  250. package/dist/src/types.js.map +1 -0
  251. package/package.json +87 -0
@@ -0,0 +1,198 @@
1
+ import { get_location } from "../location.js";
2
+ import { IntegerType, StringType } from "../types.js";
3
+ import { valueOrExprToAstTyped } from "./ast.js";
4
+ import { AstSymbol, Expr, FactorySymbol } from "./expr.js";
5
+ /**
6
+ * Expression representing binary blob values and operations.
7
+ *
8
+ * BlobExpr provides methods for working with binary data including size queries,
9
+ * byte access, text encoding/decoding (UTF-8, UTF-16), and BEAST binary format operations.
10
+ * Blobs are immutable sequences of bytes.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // Encoding and decoding text
15
+ * const encodeText = East.function([StringType], BlobType, ($, text) => {
16
+ * $.return(text.encodeUtf8());
17
+ * });
18
+ *
19
+ * const decodeText = East.function([BlobType], StringType, ($, blob) => {
20
+ * $.return(blob.decodeUtf8());
21
+ * });
22
+ *
23
+ * // Working with blob bytes
24
+ * const getByte = East.function([BlobType, IntegerType], IntegerType, ($, blob, offset) => {
25
+ * $.return(blob.getUint8(offset));
26
+ * });
27
+ * ```
28
+ */
29
+ export class BlobExpr extends Expr {
30
+ constructor(ast, createExpr) {
31
+ super(ast.type, ast, createExpr);
32
+ }
33
+ /**
34
+ * Returns the size of the blob in bytes.
35
+ *
36
+ * @returns An IntegerExpr representing the number of bytes
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const getSize = East.function([BlobType], IntegerType, ($, blob) => {
41
+ * $.return(blob.size());
42
+ * });
43
+ * const compiled = East.compile(getSize.toIR(), []);
44
+ * const text = "hello";
45
+ * const blob = new TextEncoder().encode(text);
46
+ * compiled(blob); // 5n (5 bytes for "hello")
47
+ * ```
48
+ */
49
+ size() {
50
+ return this[FactorySymbol]({
51
+ ast_type: "Builtin",
52
+ type: IntegerType,
53
+ location: get_location(2),
54
+ builtin: "BlobSize",
55
+ type_parameters: [],
56
+ arguments: [this[AstSymbol]],
57
+ });
58
+ }
59
+ /**
60
+ * Gets the byte value at the specified offset.
61
+ *
62
+ * @param offset - The zero-based byte offset to read from
63
+ * @returns An IntegerExpr representing the unsigned 8-bit integer (0-255) at that offset
64
+ *
65
+ * @throws East runtime error if the offset is out of bounds (< 0 or >= blob size)
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const getByte = East.function([BlobType, IntegerType], IntegerType, ($, blob, offset) => {
70
+ * $.return(blob.getUint8(offset));
71
+ * });
72
+ * const compiled = East.compile(getByte.toIR(), []);
73
+ * const blob = new Uint8Array([72, 101, 108, 108, 111]); // "Hello"
74
+ * compiled(blob, 0n); // 72n (ASCII 'H')
75
+ * compiled(blob, 1n); // 101n (ASCII 'e')
76
+ * // compiled(blob, 10n) would throw error (out of bounds)
77
+ * ```
78
+ */
79
+ getUint8(offset) {
80
+ const offsetAst = valueOrExprToAstTyped(offset, IntegerType);
81
+ return this[FactorySymbol]({
82
+ ast_type: "Builtin",
83
+ type: IntegerType,
84
+ location: get_location(2),
85
+ builtin: "BlobGetUint8",
86
+ type_parameters: [],
87
+ arguments: [this[AstSymbol], offsetAst],
88
+ });
89
+ }
90
+ /**
91
+ * Decodes the blob as UTF-8 text, returning a string.
92
+ *
93
+ * @returns A StringExpr containing the decoded text
94
+ *
95
+ * @throws East runtime error if the blob contains invalid UTF-8 sequences
96
+ *
97
+ * @remarks UTF-8 is a superset of ASCII. No byte-order mark (BOM) is expected.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const decode = East.function([BlobType], StringType, ($, blob) => {
102
+ * $.return(blob.decodeUtf8());
103
+ * });
104
+ * const compiled = East.compile(decode.toIR(), []);
105
+ * const blob = new TextEncoder().encode("hello");
106
+ * compiled(blob); // "hello"
107
+ *
108
+ * const emojiBlob = new TextEncoder().encode("😀");
109
+ * compiled(emojiBlob); // "😀"
110
+ * ```
111
+ */
112
+ decodeUtf8() {
113
+ return this[FactorySymbol]({
114
+ ast_type: "Builtin",
115
+ type: StringType,
116
+ location: get_location(2),
117
+ builtin: "BlobDecodeUtf8",
118
+ type_parameters: [],
119
+ arguments: [this[AstSymbol]],
120
+ });
121
+ }
122
+ /**
123
+ * Decodes the blob as UTF-16 text, returning a string.
124
+ *
125
+ * @returns A StringExpr containing the decoded text
126
+ *
127
+ * @throws East runtime error if the blob contains invalid UTF-16 sequences
128
+ *
129
+ * @remarks UTF-16 is common on Windows. If no byte-order mark (BOM) is present, assumes little-endian.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * const decode = East.function([BlobType], StringType, ($, blob) => {
134
+ * $.return(blob.decodeUtf16());
135
+ * });
136
+ * const compiled = East.compile(decode.toIR(), []);
137
+ * // Assume blob contains UTF-16 LE encoded "hello" with BOM
138
+ * const blob = new Uint8Array([0xFF, 0xFE, 0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00]);
139
+ * compiled(blob); // "hello"
140
+ * ```
141
+ */
142
+ decodeUtf16() {
143
+ return this[FactorySymbol]({
144
+ ast_type: "Builtin",
145
+ type: StringType,
146
+ location: get_location(2),
147
+ builtin: "BlobDecodeUtf16",
148
+ type_parameters: [],
149
+ arguments: [this[AstSymbol]],
150
+ });
151
+ }
152
+ /**
153
+ * Decodes a value from East's binary format (BEAST).
154
+ *
155
+ * @param type - The expected East type of the decoded value
156
+ * @param version - The BEAST format version ('v1' or 'v2', default 'v1')
157
+ * @returns An expression of the specified type containing the decoded value
158
+ *
159
+ * @throws East runtime error if the blob does not contain a valid BEAST encoding of the specified type
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * const decode = East.function([BlobType], ArrayType(IntegerType), ($, blob) => {
164
+ * $.return(blob.decodeBeast(ArrayType(IntegerType), 'v2'));
165
+ * });
166
+ * const compiled = East.compile(decode.toIR(), []);
167
+ * // Assume blob contains BEAST v2 encoding of [1n, 2n, 3n]
168
+ * const encodedBlob = // ... BEAST encoded data ... ;
169
+ * compiled(encodedBlob); // [1n, 2n, 3n]
170
+ * ```
171
+ */
172
+ decodeBeast(type, version = 'v1') {
173
+ if (version === 'v1') {
174
+ return this[FactorySymbol]({
175
+ ast_type: "Builtin",
176
+ type,
177
+ location: get_location(2),
178
+ builtin: "BlobDecodeBeast",
179
+ type_parameters: [type],
180
+ arguments: [this[AstSymbol]],
181
+ });
182
+ }
183
+ else if (version === 'v2') {
184
+ return this[FactorySymbol]({
185
+ ast_type: "Builtin",
186
+ type,
187
+ location: get_location(2),
188
+ builtin: "BlobDecodeBeast2",
189
+ type_parameters: [type],
190
+ arguments: [this[AstSymbol]],
191
+ });
192
+ }
193
+ else {
194
+ throw new Error(`Unsupported Beast version: ${version}`);
195
+ }
196
+ }
197
+ }
198
+ //# sourceMappingURL=blob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.js","sourceRoot":"","sources":["../../../src/expr/blob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAe,MAAM,WAAW,CAAC;AAKxE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAc;IAC1C,YAAY,GAAQ,EAAE,UAAkB;QACtC,KAAK,CAAC,GAA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YAChB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;YACzB,OAAO,EAAE,iBAAiB;YAC1B,eAAe,EAAE,EAAE;YACnB,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC7B,CAAe,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAqB,IAAO,EAAE,UAAuB,IAAI;QAClE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;gBACzB,QAAQ,EAAE,SAAS;gBACnB,IAAI;gBACJ,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;gBACzB,OAAO,EAAE,iBAAiB;gBAC1B,eAAe,EAAE,CAAC,IAAI,CAAC;gBACvB,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC7B,CAAgB,CAAC;QACpB,CAAC;aAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;gBACzB,QAAQ,EAAE,SAAS;gBACnB,IAAI;gBACJ,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;gBACzB,OAAO,EAAE,kBAAkB;gBAC3B,eAAe,EAAE,CAAC,IAAI,CAAC;gBACvB,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC7B,CAAgB,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { type AST, type IfElseAST, type Label, type TryCatchAST, type VariableAST } from "../ast.js";
6
+ import { type Location } from "../location.js";
7
+ import { type EastType, NullType, StringType, NeverType, VariantType, TypeUnion, IntegerType, StructType, ArrayType, type ValueTypeOf } from "../types.js";
8
+ import type { ExprType, SubtypeExprOrValue, TypeOf } from "./types.js";
9
+ import { Expr } from "./expr.js";
10
+ import { NeverExpr } from "./never.js";
11
+ import { NullExpr } from "./null.js";
12
+ import { BooleanExpr } from "./boolean.js";
13
+ import { IntegerExpr } from "./integer.js";
14
+ import { StringExpr } from "./string.js";
15
+ import { ArrayExpr } from "./array.js";
16
+ import { SetExpr } from "./set.js";
17
+ import { DictExpr } from "./dict.js";
18
+ import { type CallableFunctionExpr } from "./function.js";
19
+ import type { PlatformFunction } from "../platform.js";
20
+ /** A factory function to help build `Expr` from AST.
21
+ * We inject this into each concrete `Expr` type so they can create new expressions recursively, without having circular dependencies between JavaScript modules.
22
+ */
23
+ export declare function fromAst<T extends AST>(ast: T): Expr<T["type"]>;
24
+ /**
25
+ * Create an East expression from a JavaScript value
26
+ */
27
+ export declare function from<T>(value: SubtypeExprOrValue<NoInfer<T>>, type: T): ExprType<T>;
28
+ export declare function from<V>(value: V): ExprType<TypeOf<V>>;
29
+ /** Define an East function.
30
+ *
31
+ * The function may either be a free function or a closure.
32
+ * A closure is a function defined within another function that "captures", or refers to, one or more variables from an outer function.
33
+ * Functions without captures are called free functions and can be compiled and executed.
34
+ */
35
+ export declare function func<const I extends EastType[], O extends EastType>(input_types: I, output_type: O, body: ($: BlockBuilder<O>, ...inputs: {
36
+ [K in keyof I]: ExprType<I[K]>;
37
+ }) => SubtypeExprOrValue<O> | void): CallableFunctionExpr<I, O>;
38
+ /** @internal */
39
+ export declare function func<const I extends EastType[], F extends ($: BlockBuilder<NeverType>, ...inputs: {
40
+ [K in keyof I]: ExprType<I[K]>;
41
+ }) => any>(input_types: I, output_type: undefined, body: F): CallableFunctionExpr<I, TypeOf<ReturnType<F> extends void ? NeverType : ReturnType<F>>>;
42
+ /** Template string literal to create an East string dynamically from components
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * str`My name is ${name}`
47
+ * ```
48
+ */
49
+ export declare function str(strings: TemplateStringsArray, ...expressions: (Expr | string)[]): StringExpr;
50
+ /**
51
+ * Create an East block expression.
52
+ * The block may produce a value by returning an expressions.
53
+ */
54
+ export declare function block<F extends ($: BlockBuilder<NeverType>) => any>(body: F): ReturnType<F> extends void ? NeverExpr : ExprType<TypeOf<ReturnType<F>>>;
55
+ /**
56
+ * Create an East error expression
57
+ */
58
+ export declare function error(message: SubtypeExprOrValue<StringType>, location?: Location): NeverExpr;
59
+ /** Create a match expression */
60
+ export declare function matchExpr<Cases extends Record<string, any>, Handlers extends {
61
+ [K in keyof Cases]: ($: BlockBuilder<NeverType>, data: ExprType<Cases[K]>) => any;
62
+ }>(variant: Expr<VariantType<Cases>>, handlers: Handlers): ExprType<TypeOf<{
63
+ [K in keyof Cases]: ReturnType<Handlers[K]>;
64
+ }[keyof Cases]>>;
65
+ /**
66
+ * Create an East try-catch expression
67
+ */
68
+ export declare function tryCatch<T1, F extends ($: BlockBuilder<NeverType>, message: ExprType<StringType>, stack: ExprType<ArrayType<StructType<{
69
+ filename: StringType;
70
+ line: IntegerType;
71
+ column: IntegerType;
72
+ }>>>) => any>(try_body: Expr<T1>, catch_body: F): ExprType<TypeUnion<T1, TypeOf<ReturnType<F>>>>;
73
+ /** Test if the first value is equal to the second. */
74
+ export declare function equal<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
75
+ /** Test if the first value is not equal to the second. */
76
+ export declare function notEqual<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
77
+ /** Test if the first value is less than the second. */
78
+ export declare function less<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
79
+ /** Test if the first value is less than or equal to the second. */
80
+ export declare function lessEqual<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
81
+ /** Test if the first value is greater than the second. */
82
+ export declare function greater<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
83
+ /** Test if the first value is greater than or equal to the second. */
84
+ export declare function greaterEqual<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
85
+ /** Test if the first value is the same object the second.
86
+ * For mutable collections, such as arrays, this means that they are the same object in memory.
87
+ * For immutable data types, such as integers and strings, this is equivalent to equality.
88
+ */
89
+ export declare function is<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
90
+ /** Print a value as a string. */
91
+ export declare function print(value: Expr): StringExpr;
92
+ /** Create a callable helper to invoke a platform function.
93
+ *
94
+ * Platform functions provide access to external capabilities (logging, I/O, database access, etc.)
95
+ * that East code can call. They are defined by the platform when compiling and executing East IR.
96
+ *
97
+ * @param name - The name of the platform function (must match a function provided in the platform object)
98
+ * @param input_types - Array of input parameter types for the platform function
99
+ * @param output_type - The return type of the platform function
100
+ * @returns A callable function that creates Platform AST nodes when invoked
101
+ *
102
+ * @example
103
+ * ```ts
104
+ // Define a platform function helper for logging
105
+ const log = East.platform("log", [StringType], NullType);
106
+
107
+ // Use it in East code
108
+ const myFunction = East.function([], NullType, ($) => {
109
+ $(log("Hello, world!"));
110
+ $.return(null);
111
+ });
112
+
113
+ // Provide the implementation when compiling
114
+ const platform = [
115
+ log.implement(false, (message: string) => console.log(message)),
116
+ ];
117
+ const compiled = myFunction.toIR().compile(platform);
118
+ compiled(); // Logs "Hello, world!" to the console
119
+ * ```
120
+ */
121
+ export declare function platform<const Inputs extends EastType[], Output extends EastType>(name: string, input_types: Inputs, output_type: Output): ((...args: {
122
+ [K in keyof Inputs]: SubtypeExprOrValue<Inputs[K]>;
123
+ }) => ExprType<Output>) & {
124
+ implement: (fn: (...args: {
125
+ [K in keyof Inputs]: ValueTypeOf<Inputs[K]>;
126
+ }) => Output extends NullType ? null | undefined | void : ValueTypeOf<Output>) => PlatformFunction;
127
+ implementAsync: (fn: (...args: {
128
+ [K in keyof Inputs]: ValueTypeOf<Inputs[K]>;
129
+ }) => Output extends NullType ? Promise<null | undefined | void> : Promise<ValueTypeOf<Output>>) => PlatformFunction;
130
+ };
131
+ /** A helper for building blocks of code.
132
+ * Methods like `let`, `if`, `for` etc are available on the builder.
133
+ * You can also add expressions (having side effects) directly by calling the builder as a function.
134
+ */
135
+ export type BlockBuilder<Ret> = (<T extends Expr>(expr: T) => T) & {
136
+ /** @internal */
137
+ statements: AST[];
138
+ /** @internal */
139
+ type(): EastType;
140
+ /** Define a new variable with a given value, and optionally a type.
141
+ * The variable may not be reassigned later (use `let` for that).
142
+ * However the value itself may be mutable (e.g. an array), and internally modified.
143
+ */
144
+ const: (<T>(expr: SubtypeExprOrValue<NoInfer<T>>, type: T) => ExprType<T>) & (<V>(expr: V) => ExprType<TypeOf<V>>);
145
+ /** Define a new variable with a given value, and optionally a type.
146
+ * The value may be reassigned later with `assign`.
147
+ */
148
+ let: (<T>(expr: SubtypeExprOrValue<NoInfer<T>>, type: T) => ExprType<T>) & (<V>(expr: V) => ExprType<TypeOf<V>>);
149
+ /** Reassign a variable defined with `let` to a new value. */
150
+ assign: (<T>(variable: ExprType<T>, value: SubtypeExprOrValue<NoInfer<T>>) => ExprType<NullType>);
151
+ /** Return a value immediately from the current function */
152
+ return: (value: SubtypeExprOrValue<Ret>) => void;
153
+ /** Break immediately from the indicated loop */
154
+ break: (label: Label) => void;
155
+ /** Continue immediately with the next iteration of the indicated loop */
156
+ continue: (label: Label) => void;
157
+ /** Perform logic if a condition is true */
158
+ if: (predicate: BooleanExpr | boolean, true_branch: ($: BlockBuilder<Ret>) => void | Expr) => IfElseExpr<Ret>;
159
+ /** Perform logic on different possible variants. For each variant tag, the associated data is unwrapped and provided to the branch. */
160
+ match: <Cases extends Record<string, any>>(variant: Expr<VariantType<Cases>>, cases: {
161
+ [K in keyof Cases]?: ($: BlockBuilder<Ret>, data: ExprType<Cases[K]>) => (void | Expr);
162
+ }) => void;
163
+ /** Loop while a condition is true */
164
+ while: (predicate: BooleanExpr | boolean, body: ($: BlockBuilder<Ret>, label: Label) => (void | Expr)) => void;
165
+ /** Loop over the values in a collection (array, set or dictionary) */
166
+ for: (<T>(array: ArrayExpr<T>, body: ($: BlockBuilder<Ret>, value: ExprType<T>, key: IntegerExpr, label: Label) => void) => void) & (<K>(array: SetExpr<K>, body: ($: BlockBuilder<Ret>, key: ExprType<K>, label: Label) => void) => void) & (<K, T>(array: DictExpr<K, T>, body: ($: BlockBuilder<Ret>, value: ExprType<T>, key: ExprType<K>, label: Label) => void) => void);
167
+ /** Throw an error immediately with a given error message. */
168
+ error: (message: StringExpr | string, location?: Location) => NeverExpr;
169
+ /** Run some code and catch any errors that occur. */
170
+ try: (try_block: ($: BlockBuilder<Ret>) => (void | Expr)) => TryCatchExpr<Ret>;
171
+ };
172
+ export declare const BlockBuilder: <Ret>(return_type: Ret) => BlockBuilder<Ret>;
173
+ /** A helper class to perform if-elseif-else control flow. */
174
+ declare class IfElseExpr<Ret> extends NullExpr {
175
+ private return_type;
176
+ /** @internal */
177
+ constructor(ast: IfElseAST, return_type: Ret);
178
+ /** Define the logic to follow when the condition is false. */
179
+ else(body: ($: BlockBuilder<Ret>) => void | Expr): NullExpr;
180
+ /** Check for another predicate, and execute logic if it is true */
181
+ elseIf(predicate: BooleanExpr | boolean, body: ($: BlockBuilder<Ret>) => void | Expr): this;
182
+ }
183
+ /** A helper class to perform try-catch control flow. */
184
+ declare class TryCatchExpr<Ret> extends NullExpr {
185
+ private message_variable;
186
+ private stack_variable;
187
+ private return_type;
188
+ private catchCalled;
189
+ /** @internal */
190
+ constructor(ast: TryCatchAST, message_variable: VariableAST, stack_variable: VariableAST, return_type: Ret);
191
+ /** Define the logic to follow when an error is caught. The error message and stack trace is provided. */
192
+ catch(body: ($: BlockBuilder<Ret>, message: StringExpr, stack: ArrayExpr<StructType<{
193
+ filename: StringType;
194
+ line: IntegerType;
195
+ column: IntegerType;
196
+ }>>) => void | Expr): this;
197
+ /** Define cleanup logic that always executes, regardless of whether an error occurred. The finally block is for side effects only and does not affect the return type. */
198
+ finally(body: ($: BlockBuilder<Ret>) => void | Expr): void;
199
+ }
200
+ export {};
201
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/expr/block.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAgB,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACnH,OAAO,EAA+B,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,KAAK,QAAQ,EAA2B,QAAQ,EAA0B,UAAU,EAAE,SAAS,EAAE,WAAW,EAAe,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEzN,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAa,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAE,KAAK,oBAAoB,EAAsB,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;GAEG;AACH,wBA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