@rcrsr/rill 0.7.1 → 0.8.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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/ast-nodes.d.ts +635 -0
  3. package/dist/ast-nodes.d.ts.map +1 -0
  4. package/dist/ast-nodes.js +2 -0
  5. package/dist/ast-nodes.js.map +1 -0
  6. package/dist/ast-unions.d.ts +6 -0
  7. package/dist/ast-unions.d.ts.map +1 -0
  8. package/dist/ast-unions.js +6 -0
  9. package/dist/ast-unions.js.map +1 -0
  10. package/dist/error-classes.d.ts +90 -0
  11. package/dist/error-classes.d.ts.map +1 -0
  12. package/dist/error-classes.js +185 -0
  13. package/dist/error-classes.js.map +1 -0
  14. package/dist/error-registry.d.ts +93 -0
  15. package/dist/error-registry.d.ts.map +1 -0
  16. package/dist/error-registry.js +712 -0
  17. package/dist/error-registry.js.map +1 -0
  18. package/dist/generated/introspection-data.d.ts +1 -1
  19. package/dist/generated/introspection-data.d.ts.map +1 -1
  20. package/dist/generated/introspection-data.js +509 -481
  21. package/dist/generated/introspection-data.js.map +1 -1
  22. package/dist/generated/version-data.d.ts +1 -1
  23. package/dist/generated/version-data.js +3 -3
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/parser/parser-expr.js +9 -6
  29. package/dist/parser/parser-expr.js.map +1 -1
  30. package/dist/runtime/core/callable.d.ts +5 -5
  31. package/dist/runtime/core/callable.d.ts.map +1 -1
  32. package/dist/runtime/core/callable.js +2 -1
  33. package/dist/runtime/core/callable.js.map +1 -1
  34. package/dist/runtime/core/eval/mixins/collections.d.ts.map +1 -1
  35. package/dist/runtime/core/eval/mixins/collections.js +5 -1
  36. package/dist/runtime/core/eval/mixins/collections.js.map +1 -1
  37. package/dist/runtime/core/eval/mixins/literals.d.ts.map +1 -1
  38. package/dist/runtime/core/eval/mixins/literals.js +5 -1
  39. package/dist/runtime/core/eval/mixins/literals.js.map +1 -1
  40. package/dist/runtime/core/eval/mixins/variables.js +12 -12
  41. package/dist/runtime/core/eval/mixins/variables.js.map +1 -1
  42. package/dist/runtime/core/values.d.ts +31 -3
  43. package/dist/runtime/core/values.d.ts.map +1 -1
  44. package/dist/runtime/core/values.js +47 -1
  45. package/dist/runtime/core/values.js.map +1 -1
  46. package/dist/runtime/ext/builtins.d.ts.map +1 -1
  47. package/dist/runtime/ext/builtins.js +202 -1
  48. package/dist/runtime/ext/builtins.js.map +1 -1
  49. package/dist/runtime/ext/extensions.d.ts +39 -3
  50. package/dist/runtime/ext/extensions.d.ts.map +1 -1
  51. package/dist/runtime/ext/extensions.js +77 -12
  52. package/dist/runtime/ext/extensions.js.map +1 -1
  53. package/dist/runtime/index.d.ts +5 -5
  54. package/dist/runtime/index.d.ts.map +1 -1
  55. package/dist/runtime/index.js +2 -2
  56. package/dist/runtime/index.js.map +1 -1
  57. package/dist/source-location.d.ts +10 -0
  58. package/dist/source-location.d.ts.map +1 -0
  59. package/dist/source-location.js +5 -0
  60. package/dist/source-location.js.map +1 -0
  61. package/dist/token-types.d.ts +68 -0
  62. package/dist/token-types.d.ts.map +1 -0
  63. package/dist/token-types.js +79 -0
  64. package/dist/token-types.js.map +1 -0
  65. package/dist/types.d.ts +9 -882
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/types.js +8 -958
  68. package/dist/types.js.map +1 -1
  69. package/dist/value-types.d.ts +3 -0
  70. package/dist/value-types.d.ts.map +1 -0
  71. package/dist/value-types.js +2 -0
  72. package/dist/value-types.js.map +1 -0
  73. package/package.json +15 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @rcrsr/rill
2
2
 
3
- Embeddable, sandboxed scripting runtime for [rill](https://rill.run). Zero dependencies. Browser and Node.js compatible.
3
+ Core runtime for [rill](https://rill.run) — scripting designed for machine-generated code. Zero dependencies. Browser and Node.js compatible.
4
4
 
5
5
  > **Experimental.** Breaking changes will occur before stabilization.
6
6
 
@@ -0,0 +1,635 @@
1
+ import type { SourceSpan } from './source-location.js';
2
+ import type { RillTypeName } from './value-types.js';
3
+ interface BaseNode {
4
+ readonly span: SourceSpan;
5
+ }
6
+ export interface ScriptNode extends BaseNode {
7
+ readonly type: 'Script';
8
+ readonly frontmatter: FrontmatterNode | null;
9
+ /** Statements in the script. May include RecoveryErrorNode when parsed with recoveryMode. */
10
+ readonly statements: (StatementNode | AnnotatedStatementNode | RecoveryErrorNode)[];
11
+ }
12
+ export interface FrontmatterNode extends BaseNode {
13
+ readonly type: 'Frontmatter';
14
+ readonly content: string;
15
+ }
16
+ /**
17
+ * Closure: |params| body
18
+ * First-class closure with optional typed parameters and defaults.
19
+ * Scope rules: captures outer (read-only), local mutable.
20
+ *
21
+ * Body can be:
22
+ * - Simple: |x| $x (postfix-expr)
23
+ * - Grouped: |x| ($x * 2) (compound expression)
24
+ * - Block: |x| { $a ↵ $b } (multiple statements)
25
+ */
26
+ export interface ClosureNode extends BaseNode {
27
+ readonly type: 'Closure';
28
+ readonly params: ClosureParamNode[];
29
+ readonly body: BodyNode;
30
+ }
31
+ /**
32
+ * Function parameter with optional type and default value.
33
+ * - (x) { } -- untyped
34
+ * - (x: string) { } -- typed
35
+ * - (x: string = "hi") { } -- typed with default
36
+ * - ^(key: value) (x) { } -- with parameter annotations
37
+ */
38
+ export interface ClosureParamNode extends BaseNode {
39
+ readonly type: 'ClosureParam';
40
+ readonly name: string;
41
+ readonly typeName: 'string' | 'number' | 'bool' | null;
42
+ readonly defaultValue: LiteralNode | null;
43
+ readonly annotations?: AnnotationArg[] | undefined;
44
+ }
45
+ /**
46
+ * Statement: a pipe chain expression.
47
+ * Termination (capture/break/return) is now part of PipeChainNode.
48
+ */
49
+ export interface StatementNode extends BaseNode {
50
+ readonly type: 'Statement';
51
+ readonly expression: PipeChainNode;
52
+ }
53
+ /**
54
+ * Recovery error node for parse error recovery mode.
55
+ * Represents unparseable content that was skipped during error recovery.
56
+ * Only appears in ASTs when parsing with `recoveryMode: true`.
57
+ */
58
+ export interface RecoveryErrorNode extends BaseNode {
59
+ readonly type: 'RecoveryError';
60
+ /** The error message describing what went wrong */
61
+ readonly message: string;
62
+ /** The raw source text that could not be parsed */
63
+ readonly text: string;
64
+ }
65
+ /**
66
+ * Annotated statement: ^(key: value, ...) statement
67
+ * Annotations modify operational parameters for statements.
68
+ * They prefix statements and bind to the immediately following construct.
69
+ *
70
+ * Examples:
71
+ * ^(limit: 100) $items @ process()
72
+ * ^(timeout: 30) fetch($url)
73
+ * ^(retry: 3, backoff: 1.5) api_call()
74
+ */
75
+ export interface AnnotatedStatementNode extends BaseNode {
76
+ readonly type: 'AnnotatedStatement';
77
+ readonly annotations: AnnotationArg[];
78
+ readonly statement: StatementNode;
79
+ }
80
+ /**
81
+ * Annotation argument: named or spread
82
+ * Reuses similar structure to dict entries but with spread support.
83
+ */
84
+ export type AnnotationArg = NamedArgNode | SpreadArgNode;
85
+ /**
86
+ * Named annotation argument: key: value
87
+ * Example: limit: 100, timeout: 30
88
+ */
89
+ export interface NamedArgNode extends BaseNode {
90
+ readonly type: 'NamedArg';
91
+ readonly name: string;
92
+ readonly value: ExpressionNode;
93
+ }
94
+ /**
95
+ * Spread annotation argument: *expr
96
+ * Example: *$opts spreads tuple keys as annotations
97
+ */
98
+ export interface SpreadArgNode extends BaseNode {
99
+ readonly type: 'SpreadArg';
100
+ readonly expression: ExpressionNode;
101
+ }
102
+ export interface CaptureNode extends BaseNode {
103
+ readonly type: 'Capture';
104
+ readonly name: string;
105
+ /** Optional explicit type annotation: $name:string */
106
+ readonly typeName: RillTypeName | null;
107
+ }
108
+ /**
109
+ * Break: exit loop with current pipe value.
110
+ * Used as chain terminator: $x -> break
111
+ * Or bare: break (implicit $ -> break)
112
+ */
113
+ export interface BreakNode extends BaseNode {
114
+ readonly type: 'Break';
115
+ }
116
+ /**
117
+ * Return: exit closure with current pipe value.
118
+ * Used as chain terminator: $x -> return
119
+ * Or bare: return (implicit $ -> return)
120
+ */
121
+ export interface ReturnNode extends BaseNode {
122
+ readonly type: 'Return';
123
+ }
124
+ /**
125
+ * Pass: pass through pipe value unchanged.
126
+ * Used as chain terminator: $x -> pass
127
+ * Or bare: pass (implicit $ -> pass)
128
+ */
129
+ export interface PassNode extends BaseNode {
130
+ readonly type: 'Pass';
131
+ }
132
+ /**
133
+ * Assert: halt execution if condition is false.
134
+ * Syntax: assert condition
135
+ * Or: assert condition "custom error message"
136
+ */
137
+ export interface AssertNode extends BaseNode {
138
+ readonly type: 'Assert';
139
+ readonly condition: ExpressionNode;
140
+ readonly message: StringLiteralNode | null;
141
+ }
142
+ /**
143
+ * Error: explicitly raise an error with a message.
144
+ * Syntax: error "message"
145
+ * Or: error "interpolated {$var} message"
146
+ */
147
+ export interface ErrorNode extends BaseNode {
148
+ readonly type: 'Error';
149
+ readonly message: StringLiteralNode | null;
150
+ }
151
+ export type ExpressionNode = PipeChainNode;
152
+ /** Chain terminator: capture, break, or return */
153
+ export type ChainTerminator = CaptureNode | BreakNode | ReturnNode;
154
+ export interface PipeChainNode extends BaseNode {
155
+ readonly type: 'PipeChain';
156
+ readonly head: ArithHead;
157
+ /**
158
+ * Pipe targets and inline captures.
159
+ * Inline captures act as implicit .set() — store value and return unchanged.
160
+ * Semantically: "-> $a ->" ≡ "-> $a.set($) ->"
161
+ */
162
+ readonly pipes: (PipeTargetNode | CaptureNode)[];
163
+ /**
164
+ * Chain terminator: final capture, break, or return.
165
+ * Examples:
166
+ * $x -> $y terminator = Capture($y)
167
+ * $x -> break terminator = Break
168
+ * $x -> return terminator = Return
169
+ * $x -> .method terminator = null
170
+ */
171
+ readonly terminator: ChainTerminator | null;
172
+ }
173
+ export interface PostfixExprNode extends BaseNode {
174
+ readonly type: 'PostfixExpr';
175
+ readonly primary: PrimaryNode;
176
+ readonly methods: (MethodCallNode | InvokeNode)[];
177
+ readonly defaultValue: BodyNode | null;
178
+ }
179
+ export type PrimaryNode = LiteralNode | VariableNode | HostCallNode | ClosureCallNode | MethodCallNode | ConditionalNode | WhileLoopNode | DoWhileLoopNode | BlockNode | AssertNode | ErrorNode | PassNode | GroupedExprNode | SpreadNode | TypeAssertionNode | TypeCheckNode;
180
+ export type PipeTargetNode = HostCallNode | ClosureCallNode | MethodCallNode | PipeInvokeNode | ConditionalNode | WhileLoopNode | DoWhileLoopNode | BlockNode | ClosureNode | StringLiteralNode | DictNode | TupleNode | GroupedExprNode | ClosureChainNode | DestructureNode | SliceNode | SpreadNode | TypeAssertionNode | TypeCheckNode | EachExprNode | MapExprNode | FoldExprNode | FilterExprNode | PostfixExprNode | VariableNode | AssertNode | ErrorNode;
181
+ /** Invoke pipe value as a closure: -> $() or -> $(arg1, arg2) */
182
+ export interface PipeInvokeNode extends BaseNode {
183
+ readonly type: 'PipeInvoke';
184
+ readonly args: ExpressionNode[];
185
+ }
186
+ export type LiteralNode = StringLiteralNode | NumberLiteralNode | BoolLiteralNode | TupleNode | DictNode | ClosureNode;
187
+ export interface StringLiteralNode extends BaseNode {
188
+ readonly type: 'StringLiteral';
189
+ readonly parts: (string | InterpolationNode)[];
190
+ readonly isMultiline: boolean;
191
+ }
192
+ export interface InterpolationNode extends BaseNode {
193
+ readonly type: 'Interpolation';
194
+ readonly expression: ExpressionNode;
195
+ }
196
+ export interface NumberLiteralNode extends BaseNode {
197
+ readonly type: 'NumberLiteral';
198
+ readonly value: number;
199
+ }
200
+ export interface BoolLiteralNode extends BaseNode {
201
+ readonly type: 'BoolLiteral';
202
+ readonly value: boolean;
203
+ }
204
+ export interface TupleNode extends BaseNode {
205
+ readonly type: 'Tuple';
206
+ readonly elements: (ExpressionNode | ListSpreadNode)[];
207
+ readonly defaultValue: BodyNode | null;
208
+ }
209
+ export interface ListSpreadNode extends BaseNode {
210
+ readonly type: 'ListSpread';
211
+ readonly expression: ExpressionNode;
212
+ }
213
+ export interface DictNode extends BaseNode {
214
+ readonly type: 'Dict';
215
+ readonly entries: DictEntryNode[];
216
+ readonly defaultValue: BodyNode | null;
217
+ }
218
+ export interface DictKeyVariable {
219
+ readonly kind: 'variable';
220
+ readonly variableName: string;
221
+ }
222
+ export interface DictKeyComputed {
223
+ readonly kind: 'computed';
224
+ readonly expression: ExpressionNode;
225
+ }
226
+ export interface DictEntryNode extends BaseNode {
227
+ readonly type: 'DictEntry';
228
+ readonly key: string | number | boolean | TupleNode | DictKeyVariable | DictKeyComputed;
229
+ readonly value: ExpressionNode;
230
+ }
231
+ export type BinaryOp = '+' | '-' | '*' | '/' | '%' | '&&' | '||' | '==' | '!=' | '<' | '>' | '<=' | '>=';
232
+ /**
233
+ * Expression head types for binary/unary expressions.
234
+ * Includes arithmetic (+, -, *, /, %) and logical (&&, ||, !) operators.
235
+ */
236
+ export type ArithHead = BinaryExprNode | UnaryExprNode | PostfixExprNode;
237
+ /**
238
+ * Binary expression: left op right
239
+ * Arithmetic: ($x + 5), ($a * $b), (2 + 3 * 4)
240
+ * Logical: ($a && $b), ($x || $y)
241
+ */
242
+ export interface BinaryExprNode extends BaseNode {
243
+ readonly type: 'BinaryExpr';
244
+ readonly op: BinaryOp;
245
+ readonly left: ArithHead;
246
+ readonly right: ArithHead;
247
+ }
248
+ /**
249
+ * Unary expression: -operand or !operand
250
+ * Examples: (-5), (-$x), (!$ready)
251
+ */
252
+ export interface UnaryExprNode extends BaseNode {
253
+ readonly type: 'UnaryExpr';
254
+ readonly op: '-' | '!';
255
+ readonly operand: UnaryExprNode | PostfixExprNode;
256
+ }
257
+ /**
258
+ * Grouped expression: ( expression )
259
+ * Single-expression block with () delimiters.
260
+ * Provides scoping — captures inside are local and not visible outside.
261
+ *
262
+ * Scoping rules identical to blocks:
263
+ * ("hello" -> $local) — $local is scoped to group, returns "hello"
264
+ */
265
+ export interface GroupedExprNode extends BaseNode {
266
+ readonly type: 'GroupedExpr';
267
+ readonly expression: PipeChainNode;
268
+ }
269
+ /**
270
+ * Simple body: expression that can follow closure params, conditionals, or loops.
271
+ * No naked compound expressions — arithmetic/pipes/booleans must be grouped.
272
+ *
273
+ * Valid: block, grouped, or postfix-expr (variable, literal, method, function call)
274
+ * Examples:
275
+ * |x| $x — postfix-expr
276
+ * |x| ($x * 2) — grouped (compound)
277
+ * |x| { $a ↵ $b } — block (multiple statements)
278
+ */
279
+ export type BodyNode = BlockNode | GroupedExprNode | PostfixExprNode | PipeChainNode;
280
+ export interface VariableNode extends BaseNode {
281
+ readonly type: 'Variable';
282
+ readonly name: string | null;
283
+ readonly isPipeVar: boolean;
284
+ /** Ordered chain of property accesses: .name, [0], .$var, etc. */
285
+ readonly accessChain: PropertyAccess[];
286
+ /**
287
+ * Default value for null-coalescing: $data.path ?? default
288
+ * If property access returns null/missing, use this value instead.
289
+ */
290
+ readonly defaultValue: BodyNode | null;
291
+ /**
292
+ * Existence check on final path element: $data.?path
293
+ * Returns boolean (true if path exists).
294
+ * When set, implies safe traversal (no error on missing intermediate paths).
295
+ */
296
+ readonly existenceCheck: ExistenceCheck | null;
297
+ }
298
+ /**
299
+ * Existence check configuration.
300
+ * For .?path (just exists) or .?path&type (exists AND type matches).
301
+ */
302
+ export interface ExistenceCheck {
303
+ /** The final field/index being checked for existence */
304
+ readonly finalAccess: FieldAccess;
305
+ /** Optional type check: returns true only if exists AND matches type */
306
+ readonly typeName: RillTypeName | null;
307
+ }
308
+ /**
309
+ * Field access element in a property access chain (dot-based).
310
+ *
311
+ * Access forms:
312
+ * - literal: .identifier (string key)
313
+ * - variable: .$var (variable as key)
314
+ * - computed: .(expr) (computed expression)
315
+ * - block: .{block} (block returning key)
316
+ * - alternatives: .(a || b) (try keys left-to-right)
317
+ *
318
+ * Note: Numeric indices use bracket syntax [0], [-1] instead of dot.
319
+ */
320
+ export type FieldAccess = FieldAccessLiteral | FieldAccessVariable | FieldAccessComputed | FieldAccessBlock | FieldAccessAlternatives | FieldAccessAnnotation;
321
+ /** Literal field access: .identifier */
322
+ export interface FieldAccessLiteral {
323
+ readonly kind: 'literal';
324
+ readonly field: string;
325
+ }
326
+ /** Variable as key: .$var or .$ (pipe variable) */
327
+ export interface FieldAccessVariable {
328
+ readonly kind: 'variable';
329
+ readonly variableName: string | null;
330
+ }
331
+ /** Computed expression: .(expr) */
332
+ export interface FieldAccessComputed {
333
+ readonly kind: 'computed';
334
+ readonly expression: ExpressionNode;
335
+ }
336
+ /** Block returning key: .{block} */
337
+ export interface FieldAccessBlock {
338
+ readonly kind: 'block';
339
+ readonly block: BlockNode;
340
+ }
341
+ /** Alternatives (try keys left-to-right): .(a || b) */
342
+ export interface FieldAccessAlternatives {
343
+ readonly kind: 'alternatives';
344
+ readonly alternatives: string[];
345
+ }
346
+ /** Annotation reflection: .^key */
347
+ export interface FieldAccessAnnotation {
348
+ readonly kind: 'annotation';
349
+ readonly key: string;
350
+ }
351
+ /**
352
+ * Bracket index access: [expr]
353
+ * Used for numeric indexing into lists/strings.
354
+ * Expression can be positive (from start) or negative (from end).
355
+ */
356
+ export interface BracketAccess {
357
+ /** Discriminator for the unified PropertyAccess type */
358
+ readonly accessKind: 'bracket';
359
+ /** The index expression (evaluates to number) */
360
+ readonly expression: ExpressionNode;
361
+ /** Source span from opening [ to closing ] (inclusive) */
362
+ readonly span: SourceSpan;
363
+ }
364
+ /**
365
+ * Unified property access type.
366
+ * Used to maintain order of mixed dot and bracket accesses.
367
+ * e.g., $data[0].name[1] has accesses: [bracket(0), field(name), bracket(1)]
368
+ */
369
+ export type PropertyAccess = FieldAccess | BracketAccess;
370
+ export interface HostCallNode extends BaseNode {
371
+ readonly type: 'HostCall';
372
+ readonly name: string;
373
+ readonly args: ExpressionNode[];
374
+ }
375
+ export interface MethodCallNode extends BaseNode {
376
+ readonly type: 'MethodCall';
377
+ readonly name: string;
378
+ readonly args: ExpressionNode[];
379
+ readonly receiverSpan: SourceSpan | null;
380
+ }
381
+ /** Postfix invocation: expr(args) - calls the result of expr as a closure */
382
+ export interface InvokeNode extends BaseNode {
383
+ readonly type: 'Invoke';
384
+ readonly args: ExpressionNode[];
385
+ }
386
+ /** Call a closure stored in a variable: $fn(args) or $obj.method(args) */
387
+ export interface ClosureCallNode extends BaseNode {
388
+ readonly type: 'ClosureCall';
389
+ readonly name: string;
390
+ readonly accessChain: string[];
391
+ readonly args: ExpressionNode[];
392
+ }
393
+ /**
394
+ * Conditional: ?($cond) body : else
395
+ * Body can be any simple-body (block, grouped, or postfix-expr).
396
+ *
397
+ * Examples:
398
+ * ?($x > 0) "positive" : "negative" — literals
399
+ * ?($x > 0) ($x * 2) : ($x / 2) — grouped
400
+ * ?($x > 0) { complex } : { other } — blocks
401
+ */
402
+ export interface ConditionalNode extends BaseNode {
403
+ readonly type: 'Conditional';
404
+ readonly input: ExpressionNode | null;
405
+ readonly condition: BodyNode | null;
406
+ readonly thenBranch: BodyNode;
407
+ readonly elseBranch: BodyNode | ConditionalNode | null;
408
+ }
409
+ export interface WhileLoopNode extends BaseNode {
410
+ readonly type: 'WhileLoop';
411
+ readonly condition: ExpressionNode;
412
+ readonly body: BodyNode;
413
+ }
414
+ export interface DoWhileLoopNode extends BaseNode {
415
+ readonly type: 'DoWhileLoop';
416
+ readonly input: ExpressionNode | null;
417
+ readonly body: BodyNode;
418
+ readonly condition: BodyNode;
419
+ }
420
+ export interface BlockNode extends BaseNode {
421
+ readonly type: 'Block';
422
+ readonly statements: (StatementNode | AnnotatedStatementNode)[];
423
+ }
424
+ /**
425
+ * Collection operator body types.
426
+ * These are the valid forms for the body of each/map/fold operators.
427
+ */
428
+ export type IteratorBody = ClosureNode | BlockNode | GroupedExprNode | VariableNode | PostfixExprNode | SpreadNode | HostCallNode;
429
+ /**
430
+ * Each expression: sequential iteration returning list of all results.
431
+ *
432
+ * Syntax forms:
433
+ * collection -> each |x| body
434
+ * collection -> each { body }
435
+ * collection -> each (expr)
436
+ * collection -> each $fn
437
+ * collection -> each $
438
+ *
439
+ * With accumulator:
440
+ * collection -> each(init) { body } -- $@ is accumulator
441
+ * collection -> each |x, acc = init| body -- $acc is accumulator
442
+ *
443
+ * Returns: list of all body results (or scan results if accumulator)
444
+ */
445
+ export interface EachExprNode extends BaseNode {
446
+ readonly type: 'EachExpr';
447
+ /** The body to execute for each element */
448
+ readonly body: IteratorBody;
449
+ /**
450
+ * Optional accumulator initial value (for block form with $@ access).
451
+ * null when using inline closure with accumulator (it's in the closure params)
452
+ * or when no accumulator is used.
453
+ */
454
+ readonly accumulator: ExpressionNode | null;
455
+ }
456
+ /**
457
+ * Map expression: parallel iteration returning list of all results.
458
+ *
459
+ * Syntax forms:
460
+ * collection -> map |x| body
461
+ * collection -> map { body }
462
+ * collection -> map (expr)
463
+ * collection -> map $fn
464
+ * collection -> map $
465
+ *
466
+ * No accumulator (parallel execution has no "previous").
467
+ * Concurrency limit via ^(limit: N) annotation.
468
+ *
469
+ * Returns: list of all body results (order preserved)
470
+ */
471
+ export interface MapExprNode extends BaseNode {
472
+ readonly type: 'MapExpr';
473
+ /** The body to execute for each element (in parallel) */
474
+ readonly body: IteratorBody;
475
+ }
476
+ /**
477
+ * Fold expression: sequential reduction returning final result only.
478
+ *
479
+ * Syntax forms:
480
+ * collection -> fold |x, acc = init| body -- $acc is accumulator
481
+ * collection -> fold(init) { body } -- $@ is accumulator
482
+ * collection -> fold $fn -- fn must have accumulator param
483
+ *
484
+ * Accumulator is required.
485
+ *
486
+ * Returns: final accumulated value only
487
+ */
488
+ export interface FoldExprNode extends BaseNode {
489
+ readonly type: 'FoldExpr';
490
+ /** The body to execute for each element */
491
+ readonly body: IteratorBody;
492
+ /**
493
+ * Accumulator initial value (for block form with $@ access).
494
+ * null when using inline closure (accumulator is in closure params).
495
+ */
496
+ readonly accumulator: ExpressionNode | null;
497
+ }
498
+ /**
499
+ * Filter expression: parallel filtering returning elements where predicate is truthy.
500
+ *
501
+ * Syntax forms:
502
+ * collection -> filter |x| body
503
+ * collection -> filter { body }
504
+ * collection -> filter (expr)
505
+ * collection -> filter $fn
506
+ *
507
+ * Predicate returns truthy/falsy. Elements where predicate is truthy are kept.
508
+ *
509
+ * Returns: list of elements where body was truthy
510
+ */
511
+ export interface FilterExprNode extends BaseNode {
512
+ readonly type: 'FilterExpr';
513
+ /** The predicate body to evaluate for each element */
514
+ readonly body: IteratorBody;
515
+ }
516
+ /**
517
+ * Sequential spread: $input -> @$closures
518
+ * Chains closures where each receives the previous result.
519
+ *
520
+ * Equivalent to a fold: $input -> [$f, $g, $h] -> @ { $() }
521
+ * - With stored closures: the $ is the current closure, $() invokes it
522
+ * - With inline blocks: $ is the accumulated value directly
523
+ */
524
+ export interface ClosureChainNode extends BaseNode {
525
+ readonly type: 'ClosureChain';
526
+ readonly target: ExpressionNode;
527
+ }
528
+ /**
529
+ * Destructure operator: *<...>
530
+ * Extracts elements from tuples/dicts into variables.
531
+ *
532
+ * Tuple: [1, 2, 3] -> *<$a, $b, $c>
533
+ * Dict: [name: "x"] -> *<name: $n>
534
+ * Nested: [[1, 2], 3] -> *<*<$a, $b>, $c>
535
+ */
536
+ export interface DestructureNode extends BaseNode {
537
+ readonly type: 'Destructure';
538
+ readonly elements: DestructPatternNode[];
539
+ }
540
+ /**
541
+ * Element in a destructure pattern.
542
+ * Can be: typed variable, key-variable pair, skip placeholder, or nested destructure.
543
+ */
544
+ export interface DestructPatternNode extends BaseNode {
545
+ readonly type: 'DestructPattern';
546
+ readonly kind: 'variable' | 'keyValue' | 'skip' | 'nested';
547
+ /** Variable name (for 'variable' and 'keyValue' kinds) */
548
+ readonly name: string | null;
549
+ /** Key name (for 'keyValue' kind - dict destructuring) */
550
+ readonly key: string | null;
551
+ /** Type annotation (for 'variable' and 'keyValue' kinds) */
552
+ readonly typeName: RillTypeName | null;
553
+ /** Nested destructure pattern (for 'nested' kind) */
554
+ readonly nested: DestructureNode | null;
555
+ }
556
+ /**
557
+ * Slice operator: /<start:stop:step>
558
+ * Extracts a portion of a tuple or string using Python-style slicing.
559
+ *
560
+ * Examples:
561
+ * $tuple -> /<0:3> # elements 0, 1, 2
562
+ * $tuple -> /<::-1> # reversed
563
+ * "hello" -> /<1:4> # "ell"
564
+ */
565
+ export interface SliceNode extends BaseNode {
566
+ readonly type: 'Slice';
567
+ /** Start index (null = from beginning) */
568
+ readonly start: SliceBoundNode | null;
569
+ /** Stop index (null = to end) */
570
+ readonly stop: SliceBoundNode | null;
571
+ /** Step (null = 1) */
572
+ readonly step: SliceBoundNode | null;
573
+ }
574
+ /** A slice bound: number, variable, or grouped expression */
575
+ export type SliceBoundNode = NumberLiteralNode | VariableNode | GroupedExprNode;
576
+ /**
577
+ * Spread operator: *expr or -> *
578
+ * Converts tuple or dict to args type for unpacking at closure invocation.
579
+ *
580
+ * Prefix form: *[1, 2, 3], *$tuple, *[x: 1, y: 2]
581
+ * Pipe target form: [1, 2, 3] -> *
582
+ *
583
+ * Creates an args value that unpacks into separate arguments when passed to a closure.
584
+ */
585
+ export interface SpreadNode extends BaseNode {
586
+ readonly type: 'Spread';
587
+ /** The expression to spread (null when used as pipe target: -> *) */
588
+ readonly operand: ExpressionNode | null;
589
+ }
590
+ /**
591
+ * Type assertion: expr:type
592
+ * Asserts that the expression evaluates to the specified type.
593
+ * Returns the value unchanged if assertion passes, errors on mismatch.
594
+ *
595
+ * Examples:
596
+ * fetchData():string # assert result is string
597
+ * $val -> :number -> process() # assert pipe value is number
598
+ * "hello":string # "hello" (pass)
599
+ * "hello":number # Error: expected number, got string
600
+ *
601
+ * When operand is null, it acts on the implicit $:
602
+ * :string ≡ $:string
603
+ */
604
+ export interface TypeAssertionNode extends BaseNode {
605
+ readonly type: 'TypeAssertion';
606
+ /** The expression to assert (null for bare :type which uses $) */
607
+ readonly operand: PostfixExprNode | null;
608
+ /** The expected type */
609
+ readonly typeName: RillTypeName;
610
+ }
611
+ /**
612
+ * Type check: expr:?type
613
+ * Checks if the expression evaluates to the specified type.
614
+ * Returns true if types match, false otherwise.
615
+ *
616
+ * Examples:
617
+ * fetchData():?string # is result a string?
618
+ * $val -> :?number -> process() # is pipe value a number?
619
+ * "hello":?string # true
620
+ * "hello":?number # false
621
+ *
622
+ * When operand is null, it checks the implicit $:
623
+ * :?string ≡ $:?string
624
+ */
625
+ export interface TypeCheckNode extends BaseNode {
626
+ readonly type: 'TypeCheck';
627
+ /** The expression to check (null for bare :?type which uses $) */
628
+ readonly operand: PostfixExprNode | null;
629
+ /** The type to check for */
630
+ readonly typeName: RillTypeName;
631
+ }
632
+ export type SimplePrimaryNode = LiteralNode | VariableNode | HostCallNode | MethodCallNode | BlockNode | BinaryExprNode | UnaryExprNode | GroupedExprNode | PostfixExprNode | TypeAssertionNode | TypeCheckNode;
633
+ export type ASTNode = ScriptNode | FrontmatterNode | ClosureNode | ClosureParamNode | StatementNode | CaptureNode | BreakNode | ReturnNode | PassNode | AssertNode | PipeChainNode | PostfixExprNode | MethodCallNode | InvokeNode | HostCallNode | ClosureCallNode | PipeInvokeNode | VariableNode | ConditionalNode | WhileLoopNode | DoWhileLoopNode | BlockNode | StringLiteralNode | InterpolationNode | NumberLiteralNode | BoolLiteralNode | TupleNode | ListSpreadNode | DictNode | DictEntryNode | BinaryExprNode | UnaryExprNode | GroupedExprNode | ClosureChainNode | DestructureNode | DestructPatternNode | SliceNode | SpreadNode | TypeAssertionNode | TypeCheckNode | AnnotatedStatementNode | NamedArgNode | SpreadArgNode | EachExprNode | MapExprNode | FoldExprNode | FilterExprNode | RecoveryErrorNode | ErrorNode;
634
+ export {};
635
+ //# sourceMappingURL=ast-nodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-nodes.d.ts","sourceRoot":"","sources":["../src/ast-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,UAAU,QAAQ;IAChB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAMD,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QA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GACb,eAAe,GACf,SAAS,GACT,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,SAAS,GACT,cAAc,GACd,QAAQ,GACR,aAAa,GACb,cAAc,GACd,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,eAAe,GACf,mBAAmB,GACnB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,aAAa,GACb,sBAAsB,GACtB,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,cAAc,GACd,iBAAiB,GACjB,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ast-nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-nodes.js","sourceRoot":"","sources":["../src/ast-nodes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * AST Type Unions
3
+ * String union of all AST node type literals.
4
+ */
5
+ export type NodeType = 'Script' | 'Frontmatter' | 'Closure' | 'ClosureParam' | 'Statement' | 'PipeChain' | 'PostfixExpr' | 'MethodCall' | 'Invoke' | 'HostCall' | 'ClosureCall' | 'PipeInvoke' | 'Variable' | 'Capture' | 'Conditional' | 'WhileLoop' | 'DoWhileLoop' | 'Block' | 'StringLiteral' | 'Interpolation' | 'NumberLiteral' | 'BoolLiteral' | 'Tuple' | 'ListSpread' | 'Dict' | 'DictEntry' | 'Break' | 'Return' | 'Pass' | 'Assert' | 'BinaryExpr' | 'UnaryExpr' | 'InnerExpr' | 'GroupedExpr' | 'ClosureChain' | 'Destructure' | 'DestructPattern' | 'Slice' | 'Enumerate' | 'Spread' | 'TypeAssertion' | 'TypeCheck' | 'AnnotatedStatement' | 'NamedArg' | 'SpreadArg' | 'EachExpr' | 'MapExpr' | 'FoldExpr' | 'FilterExpr' | 'RecoveryError' | 'Error';
6
+ //# sourceMappingURL=ast-unions.d.ts.map