yukigo 0.2.3 → 0.3.2
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/.mocharc.json +3 -3
- package/CHANGELOG.md +105 -40
- package/README.md +193 -193
- package/dist/analyzer/GraphBuilder.d.ts +1 -0
- package/dist/analyzer/GraphBuilder.js +2 -1
- package/dist/analyzer/index.d.ts +0 -7
- package/dist/analyzer/index.js +3 -3
- package/dist/analyzer/inspections/functional/functional.d.ts +1 -1
- package/dist/analyzer/inspections/functional/functional.js +1 -1
- package/dist/analyzer/inspections/functional/smells.d.ts +3 -3
- package/dist/analyzer/inspections/functional/smells.js +27 -35
- package/dist/analyzer/inspections/generic/generic.d.ts +22 -14
- package/dist/analyzer/inspections/generic/generic.js +82 -60
- package/dist/analyzer/inspections/generic/smells.d.ts +2 -0
- package/dist/analyzer/inspections/generic/smells.js +55 -64
- package/dist/analyzer/inspections/imperative/imperative.d.ts +3 -3
- package/dist/analyzer/inspections/imperative/imperative.js +3 -3
- package/dist/analyzer/inspections/imperative/smells.d.ts +1 -0
- package/dist/analyzer/inspections/imperative/smells.js +8 -5
- package/dist/analyzer/inspections/logic/logic.d.ts +8 -8
- package/dist/analyzer/inspections/logic/logic.js +5 -5
- package/dist/analyzer/inspections/logic/smells.js +2 -2
- package/dist/analyzer/inspections/object/object.d.ts +5 -5
- package/dist/analyzer/inspections/object/object.js +22 -21
- package/dist/analyzer/inspections/object/smells.js +11 -23
- package/dist/analyzer/utils.d.ts +6 -2
- package/dist/analyzer/utils.js +6 -2
- package/dist/interpreter/components/EnvBuilder.d.ts +20 -1
- package/dist/interpreter/components/EnvBuilder.js +211 -66
- package/dist/interpreter/components/EqualityComparer.d.ts +15 -0
- package/dist/interpreter/components/EqualityComparer.js +69 -0
- package/dist/interpreter/components/Operations.d.ts +17 -14
- package/dist/interpreter/components/Operations.js +61 -62
- package/dist/interpreter/components/PatternMatcher.d.ts +19 -58
- package/dist/interpreter/components/PatternMatcher.js +185 -286
- package/dist/interpreter/components/RuntimeContext.d.ts +24 -15
- package/dist/interpreter/components/RuntimeContext.js +43 -4
- package/dist/interpreter/components/TestRunner.d.ts +15 -13
- package/dist/interpreter/components/TestRunner.js +86 -53
- package/dist/interpreter/components/evaluators/BaseEvaluator.d.ts +19 -0
- package/dist/interpreter/components/evaluators/BaseEvaluator.js +20 -0
- package/dist/interpreter/components/evaluators/ExpressionEvaluator.d.ts +34 -0
- package/dist/interpreter/components/evaluators/ExpressionEvaluator.js +298 -0
- package/dist/interpreter/components/evaluators/OperationEvaluator.d.ts +25 -0
- package/dist/interpreter/components/evaluators/OperationEvaluator.js +226 -0
- package/dist/interpreter/components/evaluators/PrimitiveEvaluator.d.ts +19 -0
- package/dist/interpreter/components/evaluators/PrimitiveEvaluator.js +50 -0
- package/dist/interpreter/components/evaluators/StatementEvaluator.d.ts +28 -0
- package/dist/interpreter/components/evaluators/StatementEvaluator.js +240 -0
- package/dist/interpreter/components/evaluators/TestingEvaluator.d.ts +15 -0
- package/dist/interpreter/components/evaluators/TestingEvaluator.js +14 -0
- package/dist/interpreter/components/evaluators/index.d.ts +110 -0
- package/dist/interpreter/components/evaluators/index.js +21 -0
- package/dist/interpreter/components/evaluators/utils.d.ts +7 -0
- package/dist/interpreter/components/evaluators/utils.js +50 -0
- package/dist/interpreter/components/hooks/YukigoHook.d.ts +27 -0
- package/dist/interpreter/components/hooks/YukigoHook.js +1 -0
- package/dist/interpreter/components/kernel/commands.d.ts +122 -0
- package/dist/interpreter/components/kernel/commands.js +203 -0
- package/dist/interpreter/components/kernel/index.d.ts +51 -0
- package/dist/interpreter/components/kernel/index.js +176 -0
- package/dist/interpreter/components/logic/LogicEngine.d.ts +26 -23
- package/dist/interpreter/components/logic/LogicEngine.js +234 -221
- package/dist/interpreter/components/logic/LogicResolver.d.ts +22 -51
- package/dist/interpreter/components/logic/LogicResolver.js +73 -440
- package/dist/interpreter/components/logic/LogicTerm.d.ts +104 -0
- package/dist/interpreter/components/logic/LogicTerm.js +423 -0
- package/dist/interpreter/components/logic/LogicTranslator.d.ts +25 -9
- package/dist/interpreter/components/logic/LogicTranslator.js +211 -74
- package/dist/interpreter/components/runtimes/FunctionRuntime.d.ts +6 -4
- package/dist/interpreter/components/runtimes/FunctionRuntime.js +82 -84
- package/dist/interpreter/components/runtimes/LazyRuntime.d.ts +13 -14
- package/dist/interpreter/components/runtimes/LazyRuntime.js +112 -239
- package/dist/interpreter/components/runtimes/ObjectRuntime.d.ts +17 -14
- package/dist/interpreter/components/runtimes/ObjectRuntime.js +105 -74
- package/dist/interpreter/errors.d.ts +10 -0
- package/dist/interpreter/errors.js +17 -0
- package/dist/interpreter/index.d.ts +9 -5
- package/dist/interpreter/index.js +11 -13
- package/dist/interpreter/primitives/YuValue.d.ts +21 -0
- package/dist/interpreter/primitives/YuValue.js +40 -0
- package/dist/interpreter/primitives/capabilities.d.ts +90 -0
- package/dist/interpreter/primitives/capabilities.js +1 -0
- package/dist/interpreter/primitives/entities/LazyList.d.ts +48 -0
- package/dist/interpreter/primitives/entities/LazyList.js +164 -0
- package/dist/interpreter/primitives/entities/LogicResult.d.ts +51 -0
- package/dist/interpreter/primitives/entities/LogicResult.js +101 -0
- package/dist/interpreter/primitives/entities/RuntimeClass.d.ts +24 -0
- package/dist/interpreter/primitives/entities/RuntimeClass.js +57 -0
- package/dist/interpreter/primitives/entities/RuntimeFunction.d.ts +40 -0
- package/dist/interpreter/primitives/entities/RuntimeFunction.js +73 -0
- package/dist/interpreter/primitives/entities/RuntimeObject.d.ts +27 -0
- package/dist/interpreter/primitives/entities/RuntimeObject.js +82 -0
- package/dist/interpreter/primitives/entities/RuntimePredicate.d.ts +19 -0
- package/dist/interpreter/primitives/entities/RuntimePredicate.js +59 -0
- package/dist/interpreter/primitives/index.d.ts +14 -0
- package/dist/interpreter/primitives/index.js +14 -0
- package/dist/interpreter/primitives/scalars/YuBoolean.d.ts +24 -0
- package/dist/interpreter/primitives/scalars/YuBoolean.js +69 -0
- package/dist/interpreter/primitives/scalars/YuChar.d.ts +28 -0
- package/dist/interpreter/primitives/scalars/YuChar.js +78 -0
- package/dist/interpreter/primitives/scalars/YuNil.d.ts +25 -0
- package/dist/interpreter/primitives/scalars/YuNil.js +73 -0
- package/dist/interpreter/primitives/scalars/YuNumber.d.ts +49 -0
- package/dist/interpreter/primitives/scalars/YuNumber.js +165 -0
- package/dist/interpreter/primitives/sequences/YuArray.d.ts +33 -0
- package/dist/interpreter/primitives/sequences/YuArray.js +150 -0
- package/dist/interpreter/primitives/sequences/YuString.d.ts +40 -0
- package/dist/interpreter/primitives/sequences/YuString.js +130 -0
- package/dist/interpreter/utils.d.ts +23 -10
- package/dist/interpreter/utils.js +25 -30
- package/dist/tester/index.d.ts +3 -3
- package/dist/tester/index.js +39 -28
- package/dist/utils/helpers.d.ts +13 -5
- package/dist/utils/helpers.js +38 -85
- package/package.json +3 -16
- package/src/analyzer/GraphBuilder.ts +143 -142
- package/src/analyzer/index.ts +185 -194
- package/src/analyzer/inspections/functional/functional.ts +121 -121
- package/src/analyzer/inspections/functional/smells.ts +88 -102
- package/src/analyzer/inspections/generic/generic.ts +610 -577
- package/src/analyzer/inspections/generic/smells.ts +355 -365
- package/src/analyzer/inspections/imperative/imperative.ts +104 -101
- package/src/analyzer/inspections/imperative/smells.ts +58 -54
- package/src/analyzer/inspections/logic/logic.ts +84 -90
- package/src/analyzer/inspections/logic/smells.ts +54 -54
- package/src/analyzer/inspections/object/object.ts +295 -264
- package/src/analyzer/inspections/object/smells.ts +130 -144
- package/src/analyzer/utils.ts +115 -109
- package/src/index.ts +3 -3
- package/src/interpreter/components/EnvBuilder.ts +405 -202
- package/src/interpreter/components/EqualityComparer.ts +107 -0
- package/src/interpreter/components/Operations.ts +126 -99
- package/src/interpreter/components/PatternMatcher.ts +375 -475
- package/src/interpreter/components/RuntimeContext.ts +181 -119
- package/src/interpreter/components/TestRunner.ts +223 -151
- package/src/interpreter/components/evaluators/BaseEvaluator.ts +36 -0
- package/src/interpreter/components/evaluators/ExpressionEvaluator.ts +475 -0
- package/src/interpreter/components/evaluators/OperationEvaluator.ts +477 -0
- package/src/interpreter/components/evaluators/PrimitiveEvaluator.ts +80 -0
- package/src/interpreter/components/evaluators/StatementEvaluator.ts +372 -0
- package/src/interpreter/components/evaluators/TestingEvaluator.ts +26 -0
- package/src/interpreter/components/evaluators/index.ts +34 -0
- package/src/interpreter/components/evaluators/utils.ts +64 -0
- package/src/interpreter/components/hooks/YukigoHook.ts +45 -0
- package/src/interpreter/components/kernel/commands.ts +255 -0
- package/src/interpreter/components/kernel/index.ts +222 -0
- package/src/interpreter/components/logic/LogicEngine.ts +509 -519
- package/src/interpreter/components/logic/LogicResolver.ts +209 -858
- package/src/interpreter/components/logic/LogicTerm.ts +477 -0
- package/src/interpreter/components/logic/LogicTranslator.ts +362 -149
- package/src/interpreter/components/runtimes/FunctionRuntime.ts +249 -227
- package/src/interpreter/components/runtimes/LazyRuntime.ts +226 -334
- package/src/interpreter/components/runtimes/ObjectRuntime.ts +262 -224
- package/src/interpreter/errors.ts +68 -47
- package/src/interpreter/index.ts +50 -52
- package/src/interpreter/primitives/YuValue.ts +64 -0
- package/src/interpreter/primitives/capabilities.ts +111 -0
- package/src/interpreter/primitives/entities/LazyList.ts +225 -0
- package/src/interpreter/primitives/entities/LogicResult.ts +133 -0
- package/src/interpreter/primitives/entities/RuntimeClass.ts +70 -0
- package/src/interpreter/primitives/entities/RuntimeFunction.ts +108 -0
- package/src/interpreter/primitives/entities/RuntimeObject.ts +110 -0
- package/src/interpreter/primitives/entities/RuntimePredicate.ts +77 -0
- package/src/interpreter/primitives/index.ts +17 -0
- package/src/interpreter/primitives/scalars/YuBoolean.ts +79 -0
- package/src/interpreter/primitives/scalars/YuChar.ts +94 -0
- package/src/interpreter/primitives/scalars/YuNil.ts +84 -0
- package/src/interpreter/primitives/scalars/YuNumber.ts +187 -0
- package/src/interpreter/primitives/sequences/YuArray.ts +178 -0
- package/src/interpreter/primitives/sequences/YuString.ts +165 -0
- package/src/interpreter/utils.ts +105 -84
- package/src/tester/index.ts +157 -128
- package/src/utils/helpers.ts +113 -169
- package/tests/analyzer/functional.spec.ts +221 -207
- package/tests/analyzer/generic.spec.ts +178 -178
- package/tests/analyzer/helpers.spec.ts +83 -89
- package/tests/analyzer/logic.spec.ts +237 -237
- package/tests/analyzer/oop.spec.ts +320 -323
- package/tests/analyzer/transitive.spec.ts +166 -166
- package/tests/interpreter/EnvBuilder.spec.ts +181 -183
- package/tests/interpreter/FunctionRuntime.spec.ts +224 -223
- package/tests/interpreter/LazyRuntime.spec.ts +227 -225
- package/tests/interpreter/LogicEngine.spec.ts +371 -327
- package/tests/interpreter/LogicSubstitution.spec.ts +90 -80
- package/tests/interpreter/ObjectRuntime.spec.ts +431 -606
- package/tests/interpreter/Operations.spec.ts +312 -220
- package/tests/interpreter/PatternSystem.spec.ts +254 -213
- package/tests/interpreter/Tests.spec.ts +122 -122
- package/tests/interpreter/interpreter.spec.ts +1143 -991
- package/tests/kernel/YukigoKernel.spec.ts +112 -0
- package/tests/tester/Tester.spec.ts +156 -152
- package/tsconfig.build.json +16 -15
- package/tsconfig.json +27 -25
- package/dist/interpreter/components/Visitor.d.ts +0 -70
- package/dist/interpreter/components/Visitor.js +0 -634
- package/dist/interpreter/entities.d.ts +0 -105
- package/dist/interpreter/entities.js +0 -96
- package/dist/interpreter/trampoline.d.ts +0 -17
- package/dist/interpreter/trampoline.js +0 -38
- package/dist/src/analyzer/GraphBuilder.d.ts +0 -30
- package/dist/src/analyzer/GraphBuilder.js +0 -100
- package/dist/src/analyzer/index.d.ts +0 -59
- package/dist/src/analyzer/index.js +0 -152
- package/dist/src/analyzer/inspections/functional/functional.d.ts +0 -44
- package/dist/src/analyzer/inspections/functional/functional.js +0 -149
- package/dist/src/analyzer/inspections/functional/smells.d.ts +0 -16
- package/dist/src/analyzer/inspections/functional/smells.js +0 -98
- package/dist/src/analyzer/inspections/generic/generic.d.ts +0 -178
- package/dist/src/analyzer/inspections/generic/generic.js +0 -604
- package/dist/src/analyzer/inspections/generic/smells.d.ts +0 -61
- package/dist/src/analyzer/inspections/generic/smells.js +0 -349
- package/dist/src/analyzer/inspections/imperative/imperative.d.ts +0 -35
- package/dist/src/analyzer/inspections/imperative/imperative.js +0 -109
- package/dist/src/analyzer/inspections/imperative/smells.d.ts +0 -16
- package/dist/src/analyzer/inspections/imperative/smells.js +0 -58
- package/dist/src/analyzer/inspections/logic/logic.d.ts +0 -32
- package/dist/src/analyzer/inspections/logic/logic.js +0 -96
- package/dist/src/analyzer/inspections/logic/smells.d.ts +0 -15
- package/dist/src/analyzer/inspections/logic/smells.js +0 -60
- package/dist/src/analyzer/inspections/object/object.d.ts +0 -90
- package/dist/src/analyzer/inspections/object/object.js +0 -321
- package/dist/src/analyzer/inspections/object/smells.d.ts +0 -30
- package/dist/src/analyzer/inspections/object/smells.js +0 -135
- package/dist/src/analyzer/utils.d.ts +0 -30
- package/dist/src/analyzer/utils.js +0 -78
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -4
- package/dist/src/interpreter/components/EnvBuilder.d.ts +0 -21
- package/dist/src/interpreter/components/EnvBuilder.js +0 -155
- package/dist/src/interpreter/components/Operations.d.ts +0 -14
- package/dist/src/interpreter/components/Operations.js +0 -84
- package/dist/src/interpreter/components/PatternMatcher.d.ts +0 -73
- package/dist/src/interpreter/components/PatternMatcher.js +0 -358
- package/dist/src/interpreter/components/RuntimeContext.d.ts +0 -35
- package/dist/src/interpreter/components/RuntimeContext.js +0 -93
- package/dist/src/interpreter/components/TestRunner.d.ts +0 -19
- package/dist/src/interpreter/components/TestRunner.js +0 -110
- package/dist/src/interpreter/components/Visitor.d.ts +0 -71
- package/dist/src/interpreter/components/Visitor.js +0 -638
- package/dist/src/interpreter/components/logic/LogicEngine.d.ts +0 -29
- package/dist/src/interpreter/components/logic/LogicEngine.js +0 -259
- package/dist/src/interpreter/components/logic/LogicResolver.d.ts +0 -53
- package/dist/src/interpreter/components/logic/LogicResolver.js +0 -484
- package/dist/src/interpreter/components/logic/LogicTranslator.d.ts +0 -14
- package/dist/src/interpreter/components/logic/LogicTranslator.js +0 -99
- package/dist/src/interpreter/components/runtimes/FunctionRuntime.d.ts +0 -12
- package/dist/src/interpreter/components/runtimes/FunctionRuntime.js +0 -149
- package/dist/src/interpreter/components/runtimes/LazyRuntime.d.ts +0 -19
- package/dist/src/interpreter/components/runtimes/LazyRuntime.js +0 -269
- package/dist/src/interpreter/components/runtimes/ObjectRuntime.d.ts +0 -35
- package/dist/src/interpreter/components/runtimes/ObjectRuntime.js +0 -126
- package/dist/src/interpreter/errors.d.ts +0 -19
- package/dist/src/interpreter/errors.js +0 -36
- package/dist/src/interpreter/index.d.ts +0 -24
- package/dist/src/interpreter/index.js +0 -41
- package/dist/src/interpreter/trampoline.d.ts +0 -17
- package/dist/src/interpreter/trampoline.js +0 -38
- package/dist/src/interpreter/utils.d.ts +0 -11
- package/dist/src/interpreter/utils.js +0 -65
- package/dist/src/tester/index.d.ts +0 -25
- package/dist/src/tester/index.js +0 -113
- package/dist/src/utils/helpers.d.ts +0 -13
- package/dist/src/utils/helpers.js +0 -52
- package/src/interpreter/components/Visitor.ts +0 -1065
- package/src/interpreter/trampoline.ts +0 -71
|
@@ -1,99 +1,115 @@
|
|
|
1
|
-
import { isRuntimeObject, isRuntimeClass, } from "yukigo-ast";
|
|
2
1
|
import { InterpreterError } from "../../errors.js";
|
|
2
|
+
import { isRuntimeObject, YuString, isRuntimeClass, YuBoolean, YuNil, } from "../../primitives/index.js";
|
|
3
|
+
import { error, raise } from "../../utils.js";
|
|
4
|
+
import { BindCommand, StepCommand, RaiseCommand, } from "../kernel/commands.js";
|
|
3
5
|
export class ObjectRuntime {
|
|
4
6
|
context;
|
|
5
7
|
constructor(context) {
|
|
6
8
|
this.context = context;
|
|
7
9
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new instance of an Object.
|
|
10
|
-
* Typically called by visitNew()
|
|
11
|
-
*/
|
|
12
|
-
instantiate(className, identifier, fieldDefinitions, methodDefinitions) {
|
|
13
|
-
return {
|
|
14
|
-
type: "Object",
|
|
15
|
-
className,
|
|
16
|
-
identifier,
|
|
17
|
-
fields: new Map(fieldDefinitions),
|
|
18
|
-
methods: methodDefinitions,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
10
|
/**
|
|
22
11
|
* Handles Method Calls (Message Passing).
|
|
23
12
|
* Reuses FunctionRuntime to execute the method body.
|
|
24
13
|
*/
|
|
25
|
-
dispatch(receiver, methodName, args
|
|
26
|
-
if (!isRuntimeObject(receiver))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
dispatch(receiver, methodName, args) {
|
|
15
|
+
if (!isRuntimeObject(receiver)) {
|
|
16
|
+
return this.dispatchPrimitive(receiver, methodName, args);
|
|
17
|
+
}
|
|
18
|
+
const chain = this.getResolutionChain(receiver);
|
|
19
|
+
const arity = args.length;
|
|
20
|
+
const arityKey = `${methodName}/${arity}`;
|
|
21
|
+
let match = this.findMethodInChain(chain, arityKey);
|
|
22
|
+
if (!match) {
|
|
23
|
+
match = this.findMethodInChain(chain, methodName);
|
|
24
|
+
}
|
|
25
|
+
if (!match) {
|
|
26
|
+
if (methodName === "toString") {
|
|
27
|
+
return new StepCommand(new YuString(receiver.toString()));
|
|
28
|
+
}
|
|
29
|
+
if (methodName === "error") {
|
|
30
|
+
const errorMsg = args[0] ? args[0].toString() : "An error occurred";
|
|
31
|
+
return new RaiseCommand(new InterpreterError("Raise", errorMsg));
|
|
32
|
+
}
|
|
33
|
+
return raise(error("MethodDispatch", `${receiver.className} does not understand '${methodName}'.`));
|
|
34
|
+
}
|
|
35
|
+
const objectScope = receiver.createDispatchScope(match, new YuString(methodName));
|
|
33
36
|
this.context.pushEnv(objectScope);
|
|
34
|
-
return this.context.funcRuntime.apply(match.method, args,
|
|
37
|
+
return new BindCommand(this.context.funcRuntime.apply(match.method, args), (res) => {
|
|
38
|
+
this.context.popEnv();
|
|
39
|
+
return new StepCommand(res);
|
|
40
|
+
});
|
|
35
41
|
}
|
|
36
42
|
/**
|
|
37
43
|
* Handles calls to super() or super.method()
|
|
38
44
|
*/
|
|
39
|
-
dispatchSuper(
|
|
45
|
+
dispatchSuper(methodName, args) {
|
|
40
46
|
const self = this.context.lookup("self");
|
|
41
47
|
const currentHolder = this.context.lookup("__CONTEXT_CLASS__");
|
|
42
48
|
const currentMethodName = this.context.lookup("__METHOD_NAME__");
|
|
43
|
-
const targetMethodName = methodName || currentMethodName;
|
|
44
49
|
if (!self || !currentHolder)
|
|
45
|
-
|
|
46
|
-
const chain = this.getResolutionChain(self
|
|
50
|
+
return raise(error("dispatchSuper", "'super' used outside of a method context"));
|
|
51
|
+
const chain = this.getResolutionChain(self);
|
|
47
52
|
const currentIndex = chain.findIndex((c) => c === currentHolder);
|
|
48
53
|
if (currentIndex === -1)
|
|
49
|
-
|
|
54
|
+
return raise(error("dispatchSuper", "Execution context not found in hierarchy chain"));
|
|
50
55
|
const remainingChain = chain.slice(currentIndex + 1);
|
|
51
|
-
const
|
|
56
|
+
const baseName = methodName || currentMethodName.toJSON();
|
|
57
|
+
const arityKey = `${baseName}/${args.length}`;
|
|
58
|
+
let match = this.findMethodInChain(remainingChain, arityKey);
|
|
59
|
+
// Fallback: si no encuentra con aridad, buscar solo por nombre (para compatibilidad)
|
|
60
|
+
if (!match && methodName) {
|
|
61
|
+
match = this.findMethodInChain(remainingChain, methodName);
|
|
62
|
+
}
|
|
63
|
+
if (!match && !methodName) {
|
|
64
|
+
match = this.findMethodInChain(remainingChain, currentMethodName.toJSON());
|
|
65
|
+
}
|
|
52
66
|
if (!match)
|
|
53
|
-
|
|
54
|
-
const objectScope =
|
|
67
|
+
return raise(error("Super", `Super method '${baseName}' not found`));
|
|
68
|
+
const objectScope = self.createDispatchScope(match, new YuString(baseName));
|
|
55
69
|
this.context.pushEnv(objectScope);
|
|
56
|
-
return this.context.funcRuntime.apply(match.method, args,
|
|
70
|
+
return new BindCommand(this.context.funcRuntime.apply(match.method, args), (res) => {
|
|
71
|
+
this.context.popEnv();
|
|
72
|
+
return new StepCommand(res);
|
|
73
|
+
});
|
|
57
74
|
}
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return objectScope;
|
|
75
|
+
getResolutionChain(receiver) {
|
|
76
|
+
const chain = [receiver];
|
|
77
|
+
if (receiver.className) {
|
|
78
|
+
const hierarchy = this.expandClassHierarchy(receiver.className);
|
|
79
|
+
chain.push(...hierarchy);
|
|
80
|
+
}
|
|
81
|
+
return chain;
|
|
66
82
|
}
|
|
67
|
-
|
|
83
|
+
expandClassHierarchy(className) {
|
|
68
84
|
const chain = [];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
const visited = new Set();
|
|
86
|
+
const queue = [className];
|
|
87
|
+
while (queue.length > 0) {
|
|
88
|
+
const current = queue.shift();
|
|
89
|
+
// occurs check to avoid circular loops
|
|
90
|
+
if (visited.has(current))
|
|
91
|
+
continue;
|
|
92
|
+
visited.add(current);
|
|
93
|
+
const classDef = this.getClassDef(current);
|
|
94
|
+
chain.push(classDef);
|
|
95
|
+
queue.push(...classDef.getHierarchy());
|
|
72
96
|
}
|
|
73
97
|
return chain;
|
|
74
98
|
}
|
|
75
|
-
|
|
76
|
-
const classDef = this.context.lookup(
|
|
99
|
+
getClassDef(name) {
|
|
100
|
+
const classDef = this.context.lookup(name);
|
|
77
101
|
if (!isRuntimeClass(classDef))
|
|
78
|
-
throw
|
|
79
|
-
|
|
80
|
-
const classDefCopy = [...classDef.mixins];
|
|
81
|
-
if (classDef.mixins)
|
|
82
|
-
classDefCopy.reverse().forEach((mixinName) => {
|
|
83
|
-
this.expandClassHierarchy(mixinName, env, chain);
|
|
84
|
-
});
|
|
85
|
-
if (classDef.superclass)
|
|
86
|
-
this.expandClassHierarchy(classDef.superclass, env, chain);
|
|
102
|
+
throw error("expandClassHierarchy", "classDef was expected to be a RuntimeClass");
|
|
103
|
+
return classDef;
|
|
87
104
|
}
|
|
88
105
|
findMethodInChain(chain, methodName) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
return undefined;
|
|
106
|
+
const match = chain.find((def) => def.methods.has(methodName));
|
|
107
|
+
if (!match)
|
|
108
|
+
return undefined;
|
|
109
|
+
return {
|
|
110
|
+
method: match.methods.get(methodName),
|
|
111
|
+
holder: match,
|
|
112
|
+
};
|
|
97
113
|
}
|
|
98
114
|
/**
|
|
99
115
|
* Field Access (Get)
|
|
@@ -102,25 +118,40 @@ export class ObjectRuntime {
|
|
|
102
118
|
getField(receiver, fieldName) {
|
|
103
119
|
if (!isRuntimeObject(receiver))
|
|
104
120
|
throw new InterpreterError("FieldAccess", "Target is not an object");
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
throw new InterpreterError("FieldAccess", `Field '${fieldName}' not found in ${receiver.className}`);
|
|
109
|
-
}
|
|
110
|
-
return receiver.fields.get(fieldName);
|
|
121
|
+
if (receiver.hasMethod(fieldName))
|
|
122
|
+
return receiver.getMethod(fieldName);
|
|
123
|
+
return receiver.getField(fieldName);
|
|
111
124
|
}
|
|
112
125
|
/**
|
|
113
126
|
* Field Mutation (Set)
|
|
114
127
|
* e.g. self.myField = 10
|
|
115
128
|
*/
|
|
116
|
-
setField(
|
|
129
|
+
setField(obj, fieldName, value) {
|
|
117
130
|
if (!this.context.config.mutability)
|
|
118
131
|
throw new InterpreterError("FieldAssignment", `Cannot mutate field '${fieldName}': mutability is disabled`);
|
|
132
|
+
const receiver = this.getReceiver(obj);
|
|
119
133
|
if (!isRuntimeObject(receiver))
|
|
120
134
|
throw new InterpreterError("FieldAssignment", "Target is not an object");
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
135
|
+
receiver.setField(fieldName, value);
|
|
136
|
+
return new YuBoolean(true);
|
|
137
|
+
}
|
|
138
|
+
getReceiver(obj) {
|
|
139
|
+
if (isRuntimeObject(obj) || isRuntimeClass(obj))
|
|
140
|
+
return obj;
|
|
141
|
+
throw new InterpreterError("ObjectRuntime", "Receiver is not an OOP entity");
|
|
142
|
+
}
|
|
143
|
+
dispatchPrimitive(receiver, methodName, args) {
|
|
144
|
+
if (!receiver || receiver.isNil)
|
|
145
|
+
return new StepCommand(YuNil.getInstance());
|
|
146
|
+
// Obtenemos el identificador polimórfico del tipo (ej: "YuArray", "YuNumber", "YuString", "RuntimeFunction")
|
|
147
|
+
const typeKey = receiver.constructor.name;
|
|
148
|
+
const lookupKey = `${typeKey}.${methodName}`;
|
|
149
|
+
// Buscamos si el ecosistema/lenguaje proveyó una implementación externa para este caso
|
|
150
|
+
const nativeImpl = this.context.config.nativeProviders.get(lookupKey);
|
|
151
|
+
if (nativeImpl) {
|
|
152
|
+
// Delegamos la subtarea de forma declarativa pasándole el receptor como contexto
|
|
153
|
+
return new BindCommand(nativeImpl(receiver, args, this.context), (res) => new StepCommand(res));
|
|
154
|
+
}
|
|
155
|
+
return raise(error("ObjectRuntime.dispatch", `Primitive type '${typeKey}' does not understand method '${methodName}'.`));
|
|
125
156
|
}
|
|
126
157
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SourceLocation } from "yukigo-ast";
|
|
2
|
+
import { YuValue } from "./primitives/YuValue.js";
|
|
2
3
|
export interface ErrorFrame {
|
|
3
4
|
nodeType: string;
|
|
4
5
|
loc?: SourceLocation;
|
|
@@ -11,9 +12,18 @@ export declare class InterpreterError extends Error {
|
|
|
11
12
|
formatStack(): string;
|
|
12
13
|
toString(): string;
|
|
13
14
|
}
|
|
15
|
+
export declare class UnexpectedNode extends InterpreterError {
|
|
16
|
+
constructor(nodeCons: string, context: string);
|
|
17
|
+
}
|
|
14
18
|
export declare class UnexpectedValue extends InterpreterError {
|
|
15
19
|
constructor(ctx: string, expected: string, got: string);
|
|
16
20
|
}
|
|
17
21
|
export declare class UnboundVariable extends Error {
|
|
18
22
|
constructor(name: string);
|
|
19
23
|
}
|
|
24
|
+
export declare class NotConcatenable extends InterpreterError {
|
|
25
|
+
constructor();
|
|
26
|
+
}
|
|
27
|
+
export declare class UnsupportedOperation extends InterpreterError {
|
|
28
|
+
constructor(val: YuValue, op: string);
|
|
29
|
+
}
|
|
@@ -5,6 +5,7 @@ export class InterpreterError extends Error {
|
|
|
5
5
|
super(`[${context}] ${message}`);
|
|
6
6
|
this.context = context;
|
|
7
7
|
this.frames = frames;
|
|
8
|
+
this.name = "InterpreterError";
|
|
8
9
|
}
|
|
9
10
|
pushFrame(frame) {
|
|
10
11
|
this.frames.push(frame);
|
|
@@ -24,6 +25,12 @@ export class InterpreterError extends Error {
|
|
|
24
25
|
return `${this.message}${this.formatStack()}`;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
export class UnexpectedNode extends InterpreterError {
|
|
29
|
+
constructor(nodeCons, context) {
|
|
30
|
+
super(context, `${nodeCons} not expected in ${context}.`);
|
|
31
|
+
this.name = "UnexpectedNode";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
27
34
|
export class UnexpectedValue extends InterpreterError {
|
|
28
35
|
constructor(ctx, expected, got) {
|
|
29
36
|
super(ctx, `Expected ${expected} but got ${got}`);
|
|
@@ -34,3 +41,13 @@ export class UnboundVariable extends Error {
|
|
|
34
41
|
super(`Unbound variable: ${name}`);
|
|
35
42
|
}
|
|
36
43
|
}
|
|
44
|
+
export class NotConcatenable extends InterpreterError {
|
|
45
|
+
constructor() {
|
|
46
|
+
super("[Concat]", "Cannot concat non-concatenable types.");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export class UnsupportedOperation extends InterpreterError {
|
|
50
|
+
constructor(val, op) {
|
|
51
|
+
super("[Unsupported]", `${val.getType()} does not support '${op}'`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { AST, ASTNode } from "yukigo-ast";
|
|
2
|
+
import { RuntimeContext } from "./components/RuntimeContext.js";
|
|
3
|
+
import { YuValue } from "./primitives/index.js";
|
|
4
|
+
import { InterpreterConfig } from "../utils/helpers.js";
|
|
5
|
+
export * from "./primitives/index.js";
|
|
6
|
+
export type Bindings = [string, YuValue][];
|
|
4
7
|
/**
|
|
5
8
|
* The Interpreter class is responsible for evaluating the Abstract Syntax Tree (AST)
|
|
6
9
|
* generated by the parsers.
|
|
@@ -13,12 +16,13 @@ export declare class Interpreter {
|
|
|
13
16
|
/**
|
|
14
17
|
* @param ast The Abstract Syntax Tree (AST) of the program to be interpreted.
|
|
15
18
|
*/
|
|
16
|
-
constructor(ast: AST, config?: InterpreterConfig);
|
|
19
|
+
constructor(ast: AST, config?: Partial<InterpreterConfig>);
|
|
17
20
|
/**
|
|
18
21
|
* Evaluates a single Expression node within the context of the global environment.
|
|
19
22
|
*
|
|
20
23
|
* @param expr The root Expression node to be evaluated.
|
|
21
24
|
* @returns The resulting primitive value (number, string, boolean, etc.) after evaluation.
|
|
22
25
|
*/
|
|
23
|
-
evaluate(expr: ASTNode):
|
|
26
|
+
evaluate(expr: ASTNode): YuValue;
|
|
27
|
+
getContext(): RuntimeContext;
|
|
24
28
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { InterpreterVisitor } from "./components/Visitor.js";
|
|
2
1
|
import { EnvBuilderVisitor } from "./components/EnvBuilder.js";
|
|
3
|
-
import { InterpreterError } from "./errors.js";
|
|
4
|
-
import { idContinuation, trampoline } from "./trampoline.js";
|
|
5
2
|
import { RuntimeContext, } from "./components/RuntimeContext.js";
|
|
3
|
+
import { YukigoKernel } from "./components/kernel/index.js";
|
|
4
|
+
import { EvalCommand } from "./components/kernel/commands.js";
|
|
5
|
+
import { InterpreterVisitor } from "./components/evaluators/index.js";
|
|
6
|
+
export * from "./primitives/index.js";
|
|
6
7
|
/**
|
|
7
8
|
* The Interpreter class is responsible for evaluating the Abstract Syntax Tree (AST)
|
|
8
9
|
* generated by the parsers.
|
|
@@ -27,15 +28,12 @@ export class Interpreter {
|
|
|
27
28
|
* @returns The resulting primitive value (number, string, boolean, etc.) after evaluation.
|
|
28
29
|
*/
|
|
29
30
|
evaluate(expr) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
console.log(error.formatStack());
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
31
|
+
const visitor = new InterpreterVisitor(this.context);
|
|
32
|
+
const outputMode = this.context.config.outputMode;
|
|
33
|
+
const kernel = new YukigoKernel(visitor, outputMode);
|
|
34
|
+
return kernel.run(new EvalCommand(expr));
|
|
35
|
+
}
|
|
36
|
+
getContext() {
|
|
37
|
+
return this.context;
|
|
40
38
|
}
|
|
41
39
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExecutionCommand } from "../components/kernel/commands.js";
|
|
2
|
+
import { YuNumeric, YuSummable, YuSequence, YuLogic, YuComparable, YuStepResult } from "./capabilities.js";
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all Yukigo values.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class YuValue {
|
|
7
|
+
abstract toString(seen?: Set<YuValue>): string;
|
|
8
|
+
abstract toJSON(keyOrSeen?: string | Set<YuValue>): unknown;
|
|
9
|
+
getType(): string;
|
|
10
|
+
realize(): ExecutionCommand;
|
|
11
|
+
get asSummable(): YuSummable | undefined;
|
|
12
|
+
get asNumeric(): YuNumeric | undefined;
|
|
13
|
+
get asSequence(): YuSequence | undefined;
|
|
14
|
+
get asLogic(): YuLogic | undefined;
|
|
15
|
+
get asComparable(): YuComparable | undefined;
|
|
16
|
+
get asStepResult(): YuStepResult | undefined;
|
|
17
|
+
get isNil(): boolean;
|
|
18
|
+
abstract equals(other: YuValue): ExecutionCommand;
|
|
19
|
+
abstract compare(other: YuValue): ExecutionCommand;
|
|
20
|
+
isSame(other: YuValue): ExecutionCommand;
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StepCommand, } from "../components/kernel/commands.js";
|
|
2
|
+
import { boolean } from "../utils.js";
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all Yukigo values.
|
|
5
|
+
*/
|
|
6
|
+
export class YuValue {
|
|
7
|
+
getType() {
|
|
8
|
+
return this.constructor.name.replace("Yu", "");
|
|
9
|
+
}
|
|
10
|
+
realize() {
|
|
11
|
+
return new StepCommand(this);
|
|
12
|
+
}
|
|
13
|
+
// Capability Accessors (Delegation)
|
|
14
|
+
get asSummable() {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
get asNumeric() {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
get asSequence() {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
get asLogic() {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
get asComparable() {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
get asStepResult() {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
get isNil() {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
isSame(other) {
|
|
36
|
+
if (this.getType() !== other.getType())
|
|
37
|
+
return boolean(false);
|
|
38
|
+
return this.equals(other);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ExecutionCommand } from "../components/kernel/commands.js";
|
|
2
|
+
import { YuValue } from "./YuValue.js";
|
|
3
|
+
/**
|
|
4
|
+
* Capability for addition and concatenation.
|
|
5
|
+
*/
|
|
6
|
+
export interface Summable {
|
|
7
|
+
plus(other: YuValue): ExecutionCommand;
|
|
8
|
+
plusWithNumber(left: YuValue): ExecutionCommand;
|
|
9
|
+
plusWithString(left: YuValue): ExecutionCommand;
|
|
10
|
+
}
|
|
11
|
+
export type YuSummable = YuValue & Summable;
|
|
12
|
+
/**
|
|
13
|
+
* Capability for numeric operations.
|
|
14
|
+
*/
|
|
15
|
+
export interface Numeric extends Summable {
|
|
16
|
+
readonly value: number;
|
|
17
|
+
minus(other: YuValue): ExecutionCommand;
|
|
18
|
+
multiply(other: YuValue): ExecutionCommand;
|
|
19
|
+
divide(other: YuValue): ExecutionCommand;
|
|
20
|
+
modulo(other: YuValue): ExecutionCommand;
|
|
21
|
+
power(other: YuValue): ExecutionCommand;
|
|
22
|
+
min(other: YuValue): ExecutionCommand;
|
|
23
|
+
max(other: YuValue): ExecutionCommand;
|
|
24
|
+
round(): ExecutionCommand;
|
|
25
|
+
abs(): ExecutionCommand;
|
|
26
|
+
ceil(): ExecutionCommand;
|
|
27
|
+
floor(): ExecutionCommand;
|
|
28
|
+
negation(): ExecutionCommand;
|
|
29
|
+
sqrt(): ExecutionCommand;
|
|
30
|
+
minusWithNumber(left: YuValue): ExecutionCommand;
|
|
31
|
+
multiplyWithNumber(left: YuValue): ExecutionCommand;
|
|
32
|
+
divideWithNumber(left: YuValue): ExecutionCommand;
|
|
33
|
+
moduloWithNumber(left: YuValue): ExecutionCommand;
|
|
34
|
+
powerWithNumber(left: YuValue): ExecutionCommand;
|
|
35
|
+
minWithNumber(left: YuValue): ExecutionCommand;
|
|
36
|
+
maxWithNumber(left: YuValue): ExecutionCommand;
|
|
37
|
+
}
|
|
38
|
+
export type YuNumeric = YuValue & Numeric;
|
|
39
|
+
/**
|
|
40
|
+
* Capability for sequences.
|
|
41
|
+
*/
|
|
42
|
+
export interface Sequence {
|
|
43
|
+
step(): ExecutionCommand;
|
|
44
|
+
realize(): ExecutionCommand;
|
|
45
|
+
size(): ExecutionCommand;
|
|
46
|
+
concat(other: YuValue): ExecutionCommand;
|
|
47
|
+
concatWithArray(arr: YuValue): ExecutionCommand;
|
|
48
|
+
concatWithString(str: YuValue): ExecutionCommand;
|
|
49
|
+
[Symbol.iterator](): Iterator<YuValue>;
|
|
50
|
+
getType(): string;
|
|
51
|
+
toJSON(): unknown;
|
|
52
|
+
readonly isNil: boolean;
|
|
53
|
+
readonly asStepResult?: StepResult;
|
|
54
|
+
}
|
|
55
|
+
export type YuSequence = YuValue & Sequence;
|
|
56
|
+
/**
|
|
57
|
+
* Capability for logical operations.
|
|
58
|
+
*/
|
|
59
|
+
export interface Logic {
|
|
60
|
+
readonly value: boolean;
|
|
61
|
+
not(): ExecutionCommand;
|
|
62
|
+
toJSON(): unknown;
|
|
63
|
+
}
|
|
64
|
+
export type YuLogic = YuValue & Logic;
|
|
65
|
+
/**
|
|
66
|
+
* Capability for comparisons.
|
|
67
|
+
*/
|
|
68
|
+
export interface Comparable {
|
|
69
|
+
equals(other: YuValue): ExecutionCommand;
|
|
70
|
+
compare(other: YuValue): ExecutionCommand;
|
|
71
|
+
equalsWithNumber(left: YuValue): ExecutionCommand;
|
|
72
|
+
equalsWithBoolean(left: YuValue): ExecutionCommand;
|
|
73
|
+
equalsWithString(left: YuValue): ExecutionCommand;
|
|
74
|
+
equalsWithArray(left: YuValue): ExecutionCommand;
|
|
75
|
+
equalsWithNil(left: YuValue): ExecutionCommand;
|
|
76
|
+
compareWithNumber(left: YuValue): ExecutionCommand;
|
|
77
|
+
compareWithBoolean(left: YuValue): ExecutionCommand;
|
|
78
|
+
compareWithString(left: YuValue): ExecutionCommand;
|
|
79
|
+
compareWithArray(left: YuValue): ExecutionCommand;
|
|
80
|
+
compareWithNil(left: YuValue): ExecutionCommand;
|
|
81
|
+
}
|
|
82
|
+
export type YuComparable = YuValue & Comparable;
|
|
83
|
+
/**
|
|
84
|
+
* Result of stepping a sequence.
|
|
85
|
+
*/
|
|
86
|
+
export interface StepResult {
|
|
87
|
+
readonly head: YuValue;
|
|
88
|
+
readonly tail: YuSequence | null;
|
|
89
|
+
}
|
|
90
|
+
export type YuStepResult = YuValue & StepResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ExecutionCommand } from "../../components/kernel/commands.js";
|
|
2
|
+
import { RuntimeContext } from "../../components/RuntimeContext.js";
|
|
3
|
+
import { Sequence, StepResult, YuSequence, YuStepResult } from "../capabilities.js";
|
|
4
|
+
import { YuValue } from "../YuValue.js";
|
|
5
|
+
/**
|
|
6
|
+
* Represents the result of forcing one step of a LazyList.
|
|
7
|
+
* If null, the list is empty.
|
|
8
|
+
*/
|
|
9
|
+
export declare class LazyStepResult extends YuValue implements StepResult {
|
|
10
|
+
readonly head: YuValue;
|
|
11
|
+
readonly tail: YuSequence | null;
|
|
12
|
+
constructor(head: YuValue, tail: YuSequence | null);
|
|
13
|
+
get asStepResult(): YuStepResult;
|
|
14
|
+
equals(other: YuValue): ExecutionCommand;
|
|
15
|
+
compare(other: YuValue): ExecutionCommand;
|
|
16
|
+
toString(): string;
|
|
17
|
+
toJSON(): unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A LazyList represents a potentially infinite sequence of values evaluated on demand.
|
|
21
|
+
*/
|
|
22
|
+
export declare class LazyList extends YuValue implements Sequence {
|
|
23
|
+
private readonly producer;
|
|
24
|
+
readonly identifier: string;
|
|
25
|
+
readonly capturedContext?: RuntimeContext | undefined;
|
|
26
|
+
private memoized;
|
|
27
|
+
constructor(producer: (ctx?: RuntimeContext) => ExecutionCommand, identifier?: string, capturedContext?: RuntimeContext | undefined);
|
|
28
|
+
equals(other: YuValue): ExecutionCommand;
|
|
29
|
+
compare(other: YuValue): ExecutionCommand;
|
|
30
|
+
get asSequence(): YuSequence;
|
|
31
|
+
[Symbol.iterator](): Iterator<YuValue>;
|
|
32
|
+
/**
|
|
33
|
+
* Evaluates the first element of the list and returns it along with the tail.
|
|
34
|
+
*/
|
|
35
|
+
step(): ExecutionCommand;
|
|
36
|
+
size(): ExecutionCommand;
|
|
37
|
+
realize(): ExecutionCommand;
|
|
38
|
+
concat(other: YuValue): ExecutionCommand;
|
|
39
|
+
concatWithArray(arr: YuValue): ExecutionCommand;
|
|
40
|
+
concatWithString(str: YuValue): ExecutionCommand;
|
|
41
|
+
private createLazyConcat;
|
|
42
|
+
toJSON(): {
|
|
43
|
+
identifier: string;
|
|
44
|
+
memoized: unknown;
|
|
45
|
+
};
|
|
46
|
+
toString(): string;
|
|
47
|
+
}
|
|
48
|
+
export declare function isLazyList(prim: unknown): prim is LazyList;
|