@rcrsr/rill 0.15.0 → 0.16.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/dist/ast-nodes.d.ts +2 -13
- package/dist/ast-nodes.js +0 -1
- package/dist/ast-unions.d.ts +0 -1
- package/dist/ast-unions.js +0 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/error-classes.d.ts +0 -1
- package/dist/error-classes.js +0 -1
- package/dist/error-formatter.d.ts +0 -1
- package/dist/error-formatter.js +0 -1
- package/dist/error-registry.d.ts +0 -1
- package/dist/error-registry.js +32 -1
- package/dist/ext/crypto/index.d.ts +0 -1
- package/dist/ext/crypto/index.js +5 -6
- package/dist/ext/exec/index.d.ts +0 -1
- package/dist/ext/exec/index.js +3 -4
- package/dist/ext/exec/runner.d.ts +0 -1
- package/dist/ext/exec/runner.js +0 -1
- package/dist/ext/fetch/index.d.ts +0 -1
- package/dist/ext/fetch/index.js +8 -39
- package/dist/ext/fetch/request.d.ts +0 -1
- package/dist/ext/fetch/request.js +0 -1
- package/dist/ext/fs/index.d.ts +0 -1
- package/dist/ext/fs/index.js +26 -27
- package/dist/ext/fs/sandbox.d.ts +0 -1
- package/dist/ext/fs/sandbox.js +0 -1
- package/dist/ext/kv/index.d.ts +0 -1
- package/dist/ext/kv/index.js +19 -20
- package/dist/ext/kv/store.d.ts +0 -1
- package/dist/ext/kv/store.js +0 -1
- package/dist/generated/introspection-data.d.ts +0 -1
- package/dist/generated/introspection-data.js +0 -1
- package/dist/generated/version-data.d.ts +1 -2
- package/dist/generated/version-data.js +2 -3
- package/dist/highlight-map.d.ts +0 -1
- package/dist/highlight-map.js +0 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/lexer/errors.d.ts +0 -1
- package/dist/lexer/errors.js +0 -1
- package/dist/lexer/helpers.d.ts +0 -1
- package/dist/lexer/helpers.js +0 -1
- package/dist/lexer/index.d.ts +0 -1
- package/dist/lexer/index.js +0 -1
- package/dist/lexer/operators.d.ts +0 -1
- package/dist/lexer/operators.js +0 -1
- package/dist/lexer/readers.d.ts +0 -1
- package/dist/lexer/readers.js +0 -1
- package/dist/lexer/state.d.ts +0 -1
- package/dist/lexer/state.js +0 -1
- package/dist/lexer/tokenizer.d.ts +0 -1
- package/dist/lexer/tokenizer.js +0 -1
- package/dist/parser/helpers.d.ts +0 -1
- package/dist/parser/helpers.js +0 -1
- package/dist/parser/index.d.ts +0 -1
- package/dist/parser/index.js +0 -1
- package/dist/parser/parser-collect.d.ts +0 -1
- package/dist/parser/parser-collect.js +0 -1
- package/dist/parser/parser-control.d.ts +0 -1
- package/dist/parser/parser-control.js +0 -1
- package/dist/parser/parser-expr.d.ts +0 -1
- package/dist/parser/parser-expr.js +0 -1
- package/dist/parser/parser-extract.d.ts +0 -1
- package/dist/parser/parser-extract.js +0 -1
- package/dist/parser/parser-functions.d.ts +0 -1
- package/dist/parser/parser-functions.js +0 -1
- package/dist/parser/parser-literals.d.ts +0 -1
- package/dist/parser/parser-literals.js +4 -2
- package/dist/parser/parser-script.d.ts +0 -1
- package/dist/parser/parser-script.js +0 -1
- package/dist/parser/parser-shape.d.ts +2 -3
- package/dist/parser/parser-shape.js +8 -52
- package/dist/parser/parser-types.d.ts +28 -2
- package/dist/parser/parser-types.js +64 -13
- package/dist/parser/parser-use.d.ts +0 -1
- package/dist/parser/parser-use.js +0 -1
- package/dist/parser/parser-variables.d.ts +0 -1
- package/dist/parser/parser-variables.js +0 -1
- package/dist/parser/parser.d.ts +0 -1
- package/dist/parser/parser.js +0 -1
- package/dist/parser/state.d.ts +0 -1
- package/dist/parser/state.js +0 -1
- package/dist/runtime/core/callable.d.ts +40 -13
- package/dist/runtime/core/callable.js +137 -28
- package/dist/runtime/core/context.d.ts +0 -1
- package/dist/runtime/core/context.js +1 -2
- package/dist/runtime/core/equals.d.ts +0 -1
- package/dist/runtime/core/equals.js +35 -3
- package/dist/runtime/core/eval/base.d.ts +0 -1
- package/dist/runtime/core/eval/base.js +0 -1
- package/dist/runtime/core/eval/evaluator.d.ts +0 -1
- package/dist/runtime/core/eval/evaluator.js +0 -1
- package/dist/runtime/core/eval/index.d.ts +0 -1
- package/dist/runtime/core/eval/index.js +0 -1
- package/dist/runtime/core/eval/mixins/annotations.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/annotations.js +0 -1
- package/dist/runtime/core/eval/mixins/closures.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/closures.js +82 -60
- package/dist/runtime/core/eval/mixins/collections.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/collections.js +9 -4
- package/dist/runtime/core/eval/mixins/control-flow.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/control-flow.js +0 -1
- package/dist/runtime/core/eval/mixins/conversion.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/conversion.js +153 -86
- package/dist/runtime/core/eval/mixins/core.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/core.js +0 -1
- package/dist/runtime/core/eval/mixins/expressions.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/expressions.js +0 -1
- package/dist/runtime/core/eval/mixins/extraction.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/extraction.js +8 -9
- package/dist/runtime/core/eval/mixins/list-dispatch.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/list-dispatch.js +0 -1
- package/dist/runtime/core/eval/mixins/literals.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/literals.js +3 -7
- package/dist/runtime/core/eval/mixins/types.d.ts +2 -1
- package/dist/runtime/core/eval/mixins/types.js +222 -242
- package/dist/runtime/core/eval/mixins/use.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/use.js +0 -1
- package/dist/runtime/core/eval/mixins/variables.d.ts +0 -1
- package/dist/runtime/core/eval/mixins/variables.js +6 -7
- package/dist/runtime/core/eval/types.d.ts +0 -1
- package/dist/runtime/core/eval/types.js +0 -1
- package/dist/runtime/core/execute.d.ts +0 -1
- package/dist/runtime/core/execute.js +0 -1
- package/dist/runtime/core/field-descriptor.d.ts +2 -3
- package/dist/runtime/core/field-descriptor.js +0 -1
- package/dist/runtime/core/introspection.d.ts +0 -1
- package/dist/runtime/core/introspection.js +0 -1
- package/dist/runtime/core/resolvers.d.ts +0 -1
- package/dist/runtime/core/resolvers.js +0 -1
- package/dist/runtime/core/signals.d.ts +0 -1
- package/dist/runtime/core/signals.js +0 -1
- package/dist/runtime/core/types.d.ts +0 -1
- package/dist/runtime/core/types.js +0 -1
- package/dist/runtime/core/values.d.ts +59 -26
- package/dist/runtime/core/values.js +289 -77
- package/dist/runtime/ext/builtins.d.ts +0 -1
- package/dist/runtime/ext/builtins.js +43 -17
- package/dist/runtime/ext/extensions.d.ts +0 -1
- package/dist/runtime/ext/extensions.js +0 -1
- package/dist/runtime/index.d.ts +2 -3
- package/dist/runtime/index.js +1 -2
- package/dist/signature-parser.d.ts +0 -1
- package/dist/signature-parser.js +8 -6
- package/dist/source-location.d.ts +0 -1
- package/dist/source-location.js +0 -1
- package/dist/token-types.d.ts +0 -1
- package/dist/token-types.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/dist/value-types.d.ts +15 -12
- package/dist/value-types.js +0 -1
- package/package.json +2 -1
- package/dist/ast-nodes.d.ts.map +0 -1
- package/dist/ast-nodes.js.map +0 -1
- package/dist/ast-unions.d.ts.map +0 -1
- package/dist/ast-unions.js.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js.map +0 -1
- package/dist/error-classes.d.ts.map +0 -1
- package/dist/error-classes.js.map +0 -1
- package/dist/error-formatter.d.ts.map +0 -1
- package/dist/error-formatter.js.map +0 -1
- package/dist/error-registry.d.ts.map +0 -1
- package/dist/error-registry.js.map +0 -1
- package/dist/ext/crypto/index.d.ts.map +0 -1
- package/dist/ext/crypto/index.js.map +0 -1
- package/dist/ext/exec/index.d.ts.map +0 -1
- package/dist/ext/exec/index.js.map +0 -1
- package/dist/ext/exec/runner.d.ts.map +0 -1
- package/dist/ext/exec/runner.js.map +0 -1
- package/dist/ext/fetch/index.d.ts.map +0 -1
- package/dist/ext/fetch/index.js.map +0 -1
- package/dist/ext/fetch/request.d.ts.map +0 -1
- package/dist/ext/fetch/request.js.map +0 -1
- package/dist/ext/fs/index.d.ts.map +0 -1
- package/dist/ext/fs/index.js.map +0 -1
- package/dist/ext/fs/sandbox.d.ts.map +0 -1
- package/dist/ext/fs/sandbox.js.map +0 -1
- package/dist/ext/kv/index.d.ts.map +0 -1
- package/dist/ext/kv/index.js.map +0 -1
- package/dist/ext/kv/store.d.ts.map +0 -1
- package/dist/ext/kv/store.js.map +0 -1
- package/dist/generated/introspection-data.d.ts.map +0 -1
- package/dist/generated/introspection-data.js.map +0 -1
- package/dist/generated/version-data.d.ts.map +0 -1
- package/dist/generated/version-data.js.map +0 -1
- package/dist/highlight-map.d.ts.map +0 -1
- package/dist/highlight-map.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lexer/errors.d.ts.map +0 -1
- package/dist/lexer/errors.js.map +0 -1
- package/dist/lexer/helpers.d.ts.map +0 -1
- package/dist/lexer/helpers.js.map +0 -1
- package/dist/lexer/index.d.ts.map +0 -1
- package/dist/lexer/index.js.map +0 -1
- package/dist/lexer/operators.d.ts.map +0 -1
- package/dist/lexer/operators.js.map +0 -1
- package/dist/lexer/readers.d.ts.map +0 -1
- package/dist/lexer/readers.js.map +0 -1
- package/dist/lexer/state.d.ts.map +0 -1
- package/dist/lexer/state.js.map +0 -1
- package/dist/lexer/tokenizer.d.ts.map +0 -1
- package/dist/lexer/tokenizer.js.map +0 -1
- package/dist/parser/helpers.d.ts.map +0 -1
- package/dist/parser/helpers.js.map +0 -1
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/index.js.map +0 -1
- package/dist/parser/parser-collect.d.ts.map +0 -1
- package/dist/parser/parser-collect.js.map +0 -1
- package/dist/parser/parser-control.d.ts.map +0 -1
- package/dist/parser/parser-control.js.map +0 -1
- package/dist/parser/parser-expr.d.ts.map +0 -1
- package/dist/parser/parser-expr.js.map +0 -1
- package/dist/parser/parser-extract.d.ts.map +0 -1
- package/dist/parser/parser-extract.js.map +0 -1
- package/dist/parser/parser-functions.d.ts.map +0 -1
- package/dist/parser/parser-functions.js.map +0 -1
- package/dist/parser/parser-literals.d.ts.map +0 -1
- package/dist/parser/parser-literals.js.map +0 -1
- package/dist/parser/parser-script.d.ts.map +0 -1
- package/dist/parser/parser-script.js.map +0 -1
- package/dist/parser/parser-shape.d.ts.map +0 -1
- package/dist/parser/parser-shape.js.map +0 -1
- package/dist/parser/parser-types.d.ts.map +0 -1
- package/dist/parser/parser-types.js.map +0 -1
- package/dist/parser/parser-use.d.ts.map +0 -1
- package/dist/parser/parser-use.js.map +0 -1
- package/dist/parser/parser-variables.d.ts.map +0 -1
- package/dist/parser/parser-variables.js.map +0 -1
- package/dist/parser/parser.d.ts.map +0 -1
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/state.d.ts.map +0 -1
- package/dist/parser/state.js.map +0 -1
- package/dist/runtime/core/callable.d.ts.map +0 -1
- package/dist/runtime/core/callable.js.map +0 -1
- package/dist/runtime/core/context.d.ts.map +0 -1
- package/dist/runtime/core/context.js.map +0 -1
- package/dist/runtime/core/equals.d.ts.map +0 -1
- package/dist/runtime/core/equals.js.map +0 -1
- package/dist/runtime/core/eval/base.d.ts.map +0 -1
- package/dist/runtime/core/eval/base.js.map +0 -1
- package/dist/runtime/core/eval/evaluator.d.ts.map +0 -1
- package/dist/runtime/core/eval/evaluator.js.map +0 -1
- package/dist/runtime/core/eval/index.d.ts.map +0 -1
- package/dist/runtime/core/eval/index.js.map +0 -1
- package/dist/runtime/core/eval/mixins/annotations.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/annotations.js.map +0 -1
- package/dist/runtime/core/eval/mixins/closures.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/closures.js.map +0 -1
- package/dist/runtime/core/eval/mixins/collections.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/collections.js.map +0 -1
- package/dist/runtime/core/eval/mixins/control-flow.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/control-flow.js.map +0 -1
- package/dist/runtime/core/eval/mixins/conversion.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/conversion.js.map +0 -1
- package/dist/runtime/core/eval/mixins/core.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/core.js.map +0 -1
- package/dist/runtime/core/eval/mixins/expressions.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/expressions.js.map +0 -1
- package/dist/runtime/core/eval/mixins/extraction.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/extraction.js.map +0 -1
- package/dist/runtime/core/eval/mixins/list-dispatch.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/list-dispatch.js.map +0 -1
- package/dist/runtime/core/eval/mixins/literals.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/literals.js.map +0 -1
- package/dist/runtime/core/eval/mixins/types.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/types.js.map +0 -1
- package/dist/runtime/core/eval/mixins/use.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/use.js.map +0 -1
- package/dist/runtime/core/eval/mixins/variables.d.ts.map +0 -1
- package/dist/runtime/core/eval/mixins/variables.js.map +0 -1
- package/dist/runtime/core/eval/types.d.ts.map +0 -1
- package/dist/runtime/core/eval/types.js.map +0 -1
- package/dist/runtime/core/execute.d.ts.map +0 -1
- package/dist/runtime/core/execute.js.map +0 -1
- package/dist/runtime/core/field-descriptor.d.ts.map +0 -1
- package/dist/runtime/core/field-descriptor.js.map +0 -1
- package/dist/runtime/core/introspection.d.ts.map +0 -1
- package/dist/runtime/core/introspection.js.map +0 -1
- package/dist/runtime/core/resolvers.d.ts.map +0 -1
- package/dist/runtime/core/resolvers.js.map +0 -1
- package/dist/runtime/core/signals.d.ts.map +0 -1
- package/dist/runtime/core/signals.js.map +0 -1
- package/dist/runtime/core/types.d.ts.map +0 -1
- package/dist/runtime/core/types.js.map +0 -1
- package/dist/runtime/core/values.d.ts.map +0 -1
- package/dist/runtime/core/values.js.map +0 -1
- package/dist/runtime/ext/builtins.d.ts.map +0 -1
- package/dist/runtime/ext/builtins.js.map +0 -1
- package/dist/runtime/ext/extensions.d.ts.map +0 -1
- package/dist/runtime/ext/extensions.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/signature-parser.d.ts.map +0 -1
- package/dist/signature-parser.js.map +0 -1
- package/dist/source-location.d.ts.map +0 -1
- package/dist/source-location.js.map +0 -1
- package/dist/token-types.d.ts.map +0 -1
- package/dist/token-types.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/value-types.d.ts.map +0 -1
- package/dist/value-types.js.map +0 -1
|
@@ -252,4 +252,3 @@ function createExpressionsMixin(Base) {
|
|
|
252
252
|
// TypeScript can't generate declarations for functions returning classes with protected members
|
|
253
253
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
254
254
|
export const ExpressionsMixin = createExpressionsMixin;
|
|
255
|
-
//# sourceMappingURL=expressions.js.map
|
|
@@ -23,14 +23,14 @@ import { getVariable } from '../../context.js';
|
|
|
23
23
|
* - setVariable() (from VariablesMixin composition)
|
|
24
24
|
*
|
|
25
25
|
* Methods added:
|
|
26
|
-
* - evaluateDestructure(node, input) -> RillValue
|
|
27
|
-
* - evaluateDestruct(node, input) -> RillValue
|
|
26
|
+
* - evaluateDestructure(node, input) -> Promise<RillValue>
|
|
27
|
+
* - evaluateDestruct(node, input) -> Promise<RillValue>
|
|
28
28
|
* - evaluateSlice(node, input) -> Promise<RillValue>
|
|
29
29
|
* - evaluateCollectionLiteral(node) -> Promise<RillValue>
|
|
30
30
|
*
|
|
31
31
|
* Covers:
|
|
32
32
|
* - IR-8: evaluateCollectionLiteral for ListLiteralNode, DictLiteralNode, TupleLiteralNode, OrderedLiteralNode
|
|
33
|
-
* - IR-26: evaluateDestructure(node, input) -> RillValue
|
|
33
|
+
* - IR-26: evaluateDestructure(node, input) -> Promise<RillValue>
|
|
34
34
|
* - IR-27: evaluateSlice(node, input) -> Promise<RillValue>
|
|
35
35
|
*
|
|
36
36
|
* Error handling:
|
|
@@ -46,7 +46,7 @@ function createExtractionMixin(Base) {
|
|
|
46
46
|
* List destructure: [1, 2, 3] -> destruct<$a, $b, $c> # $a=1, $b=2, $c=3
|
|
47
47
|
* Dict destructure: [x: 1, y: 2] -> destruct<x: $a, y: $b> # $a=1, $b=2
|
|
48
48
|
*/
|
|
49
|
-
evaluateDestructure(node, input) {
|
|
49
|
+
async evaluateDestructure(node, input) {
|
|
50
50
|
const isList = Array.isArray(input);
|
|
51
51
|
const isDictInput = isDict(input);
|
|
52
52
|
const firstNonSkip = node.elements.find((e) => e.kind !== 'skip');
|
|
@@ -80,7 +80,7 @@ function createExtractionMixin(Base) {
|
|
|
80
80
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
81
|
const dictResolved = elem.typeRef !== null
|
|
82
82
|
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
-
this.resolveTypeRef(elem.typeRef, (name) => getVariable(this.ctx, name))
|
|
83
|
+
await this.resolveTypeRef(elem.typeRef, (name) => getVariable(this.ctx, name))
|
|
84
84
|
: undefined;
|
|
85
85
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
86
|
this.setVariable(elem.name, dictValue, dictResolved?.structure, elem.span.start);
|
|
@@ -104,7 +104,7 @@ function createExtractionMixin(Base) {
|
|
|
104
104
|
if (elem.kind === 'skip')
|
|
105
105
|
continue;
|
|
106
106
|
if (elem.kind === 'nested' && elem.nested) {
|
|
107
|
-
this.evaluateDestructure(elem.nested, value);
|
|
107
|
+
await this.evaluateDestructure(elem.nested, value);
|
|
108
108
|
continue;
|
|
109
109
|
}
|
|
110
110
|
if (elem.name === null) {
|
|
@@ -115,7 +115,7 @@ function createExtractionMixin(Base) {
|
|
|
115
115
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
116
116
|
const listResolved = elem.typeRef !== null
|
|
117
117
|
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
-
this.resolveTypeRef(elem.typeRef, (name) => getVariable(this.ctx, name))
|
|
118
|
+
await this.resolveTypeRef(elem.typeRef, (name) => getVariable(this.ctx, name))
|
|
119
119
|
: undefined;
|
|
120
120
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121
121
|
this.setVariable(elem.name, value, listResolved?.structure, elem.span.start);
|
|
@@ -232,7 +232,7 @@ function createExtractionMixin(Base) {
|
|
|
232
232
|
* Same semantics as evaluateDestructure but for the keyword-based syntax.
|
|
233
233
|
* Delegates to evaluateDestructure since the pattern structure is identical.
|
|
234
234
|
*/
|
|
235
|
-
evaluateDestruct(node, input) {
|
|
235
|
+
async evaluateDestruct(node, input) {
|
|
236
236
|
// DestructNode has the same elements structure as DestructureNode.
|
|
237
237
|
// Cast to DestructureNode-compatible shape for reuse.
|
|
238
238
|
return this.evaluateDestructure({ ...node, type: 'Destructure' }, input);
|
|
@@ -365,4 +365,3 @@ function createExtractionMixin(Base) {
|
|
|
365
365
|
// TypeScript can't generate declarations for functions returning classes with protected members
|
|
366
366
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
367
367
|
export const ExtractionMixin = createExtractionMixin;
|
|
368
|
-
//# sourceMappingURL=extraction.js.map
|
|
@@ -94,4 +94,3 @@ function createListDispatchMixin(Base) {
|
|
|
94
94
|
// Export with type assertion to work around TS4094 limitation
|
|
95
95
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
96
|
export const ListDispatchMixin = createListDispatchMixin;
|
|
97
|
-
//# sourceMappingURL=list-dispatch.js.map
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
27
|
import { RuntimeError } from '../../../../types.js';
|
|
28
|
-
import { anyTypeValue, formatValue, inferElementType, isReservedMethod, isTypeValue, isVector, } from '../../values.js';
|
|
28
|
+
import { anyTypeValue, deepEquals, formatValue, inferElementType, isReservedMethod, isTypeValue, isVector, } from '../../values.js';
|
|
29
29
|
import { isCallable, } from '../../callable.js';
|
|
30
30
|
import { getVariable } from '../../context.js';
|
|
31
31
|
/**
|
|
@@ -385,8 +385,6 @@ function createLiteralsMixin(Base) {
|
|
|
385
385
|
* @throws RuntimeError with RUNTIME_PROPERTY_NOT_FOUND if no match and no default [EC-4]
|
|
386
386
|
*/
|
|
387
387
|
async evaluateDictDispatch(node, input) {
|
|
388
|
-
// Import deepEquals for type-aware key matching
|
|
389
|
-
const { deepEquals } = await import('../../values.js');
|
|
390
388
|
// Search entries for matching key (process in order, return first match)
|
|
391
389
|
for (const entry of node.entries) {
|
|
392
390
|
let matchFound = false;
|
|
@@ -516,7 +514,6 @@ function createLiteralsMixin(Base) {
|
|
|
516
514
|
* @returns Matched value or default
|
|
517
515
|
*/
|
|
518
516
|
async dispatchToDict(dict, input, defaultValue, location, skipClosureResolution = false) {
|
|
519
|
-
const { deepEquals } = await import('../../values.js');
|
|
520
517
|
// Search dict entries for matching key
|
|
521
518
|
for (const [key, value] of Object.entries(dict)) {
|
|
522
519
|
// Simple key match using deep equality
|
|
@@ -633,7 +630,7 @@ function createLiteralsMixin(Base) {
|
|
|
633
630
|
let resolvedType = undefined;
|
|
634
631
|
if (param.typeRef !== null) {
|
|
635
632
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
636
|
-
const resolved = this.resolveTypeRef(param.typeRef, (name) => getVariable(this.ctx, name));
|
|
633
|
+
const resolved = await this.resolveTypeRef(param.typeRef, (name) => getVariable(this.ctx, name));
|
|
637
634
|
if (!isTypeValue(resolved)) {
|
|
638
635
|
throw new RuntimeError('RILL-R004', `Closure parameter '${param.name}' type must be a type value, not a shape`);
|
|
639
636
|
}
|
|
@@ -675,7 +672,7 @@ function createLiteralsMixin(Base) {
|
|
|
675
672
|
let returnType = anyTypeValue;
|
|
676
673
|
if (node.returnTypeTarget !== undefined) {
|
|
677
674
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
678
|
-
returnType = this.resolveTypeRef(node.returnTypeTarget, (name) => getVariable(this.ctx, name));
|
|
675
|
+
returnType = await this.resolveTypeRef(node.returnTypeTarget, (name) => getVariable(this.ctx, name));
|
|
679
676
|
}
|
|
680
677
|
return {
|
|
681
678
|
__type: 'callable',
|
|
@@ -762,4 +759,3 @@ function createLiteralsMixin(Base) {
|
|
|
762
759
|
// TypeScript can't generate declarations for functions returning classes with protected members
|
|
763
760
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
764
761
|
export const LiteralsMixin = createLiteralsMixin;
|
|
765
|
-
//# sourceMappingURL=literals.js.map
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* - evaluateTypeCheckPrimary(node) -> Promise<boolean>
|
|
13
13
|
* - evaluateTypeConstructor(node) -> Promise<RillTypeValue> [IR-7]
|
|
14
14
|
* - evaluateClosureSigLiteral(node) -> Promise<RillTypeValue> [IR-8]
|
|
15
|
+
* - resolveTypeRef(typeRef, getVariable) -> Promise<RillTypeValue> [IR-2]
|
|
16
|
+
* - buildCollectionType(name, args, resolveArg, evaluateDefault, location?) -> Promise<RillTypeValue> [IR-4]
|
|
15
17
|
*
|
|
16
18
|
* Error Handling:
|
|
17
19
|
* - Type assertion failures throw RuntimeError(RUNTIME_TYPE_ERROR) [EC-24]
|
|
@@ -21,4 +23,3 @@
|
|
|
21
23
|
* @internal
|
|
22
24
|
*/
|
|
23
25
|
export declare const TypesMixin: any;
|
|
24
|
-
//# sourceMappingURL=types.d.ts.map
|