mlogjs 0.3.0-beta.0 → 0.4.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/Compiler.d.ts +39 -0
- package/dist/CompilerError.d.ts +33 -0
- package/dist/Scope.d.ts +24 -0
- package/dist/assertions.d.ts +28 -0
- package/dist/bin.cjs +7 -14
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.d.ts +1 -0
- package/dist/handlers/BlockStatement.d.ts +2 -0
- package/dist/handlers/CallExpression.d.ts +4 -0
- package/dist/handlers/File.d.ts +2 -0
- package/dist/handlers/ForStatement.d.ts +2 -0
- package/dist/handlers/Function.d.ts +5 -0
- package/dist/handlers/Identifier.d.ts +2 -0
- package/dist/handlers/IfStatement.d.ts +2 -0
- package/dist/handlers/Literal.d.ts +5 -0
- package/dist/handlers/Object.d.ts +6 -0
- package/dist/handlers/OperationExpressions.d.ts +8 -0
- package/dist/handlers/Program.d.ts +2 -0
- package/dist/handlers/Statements.d.ts +5 -0
- package/dist/handlers/SwitchStatement.d.ts +2 -0
- package/dist/handlers/TemplateExpression.d.ts +2 -0
- package/dist/handlers/Typescript.d.ts +7 -0
- package/dist/handlers/VariableDeclaration.d.ts +3 -0
- package/dist/handlers/WhileStatement.d.ts +3 -0
- package/dist/handlers/index.d.ts +17 -0
- package/dist/index.cjs +1096 -341
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +1096 -341
- package/dist/index.mjs.map +1 -1
- package/dist/initScope.d.ts +5 -0
- package/dist/instructions/AddressResolver.d.ts +12 -0
- package/dist/instructions/ControlInstructions.d.ts +10 -0
- package/dist/instructions/EndInstruction.d.ts +4 -0
- package/dist/instructions/InstructionBase.d.ts +14 -0
- package/dist/instructions/JumpInstruction.d.ts +16 -0
- package/dist/instructions/OperationInstruction.d.ts +5 -0
- package/dist/instructions/SetCounterInstruction.d.ts +5 -0
- package/dist/instructions/SetInstruction.d.ts +6 -0
- package/dist/instructions/ZeroSpaceInstruction.d.ts +4 -0
- package/dist/instructions/index.d.ts +9 -0
- package/dist/{types/macros/RawValue.d.ts → macros/Asm.d.ts} +1 -1
- package/dist/macros/Function.d.ts +13 -0
- package/dist/macros/GetGlobal.d.ts +5 -0
- package/dist/macros/Math.d.ts +5 -0
- package/dist/macros/Memory.d.ts +5 -0
- package/dist/macros/Namespace.d.ts +13 -0
- package/dist/macros/Other.d.ts +5 -0
- package/dist/macros/commands/ApplyStatus.d.ts +5 -0
- package/dist/macros/commands/Control.d.ts +5 -0
- package/dist/macros/commands/Cutscene.d.ts +5 -0
- package/dist/macros/commands/Draw.d.ts +5 -0
- package/dist/macros/commands/DrawFlush.d.ts +5 -0
- package/dist/macros/commands/End.d.ts +5 -0
- package/dist/macros/commands/Explosion.d.ts +5 -0
- package/dist/macros/commands/Fetch.d.ts +5 -0
- package/dist/macros/commands/FlushMessage.d.ts +5 -0
- package/dist/macros/commands/GetBlock.d.ts +5 -0
- package/dist/macros/commands/GetFlag.d.ts +5 -0
- package/dist/macros/commands/GetLink.d.ts +5 -0
- package/dist/macros/commands/Lookup.d.ts +5 -0
- package/dist/macros/commands/PackColor.d.ts +5 -0
- package/dist/macros/commands/Print.d.ts +5 -0
- package/dist/macros/commands/PrintFlush.d.ts +5 -0
- package/dist/macros/commands/Radar.d.ts +7 -0
- package/dist/macros/commands/Sensor.d.ts +5 -0
- package/dist/macros/commands/SetBlock.d.ts +5 -0
- package/dist/macros/commands/SetFlag.d.ts +5 -0
- package/dist/macros/commands/SetRate.d.ts +5 -0
- package/dist/macros/commands/SetRule.d.ts +5 -0
- package/dist/macros/commands/SpawnUnit.d.ts +5 -0
- package/dist/macros/commands/SpawnWave.d.ts +5 -0
- package/dist/macros/commands/Stop.d.ts +5 -0
- package/dist/macros/commands/UnitBind.d.ts +5 -0
- package/dist/macros/commands/UnitControl.d.ts +5 -0
- package/dist/macros/commands/UnitLocate.d.ts +5 -0
- package/dist/macros/commands/UnitRadar.d.ts +5 -0
- package/dist/macros/commands/Wait.d.ts +5 -0
- package/dist/macros/commands/index.d.ts +30 -0
- package/dist/macros/index.d.ts +6 -0
- package/dist/macros/util.d.ts +18 -0
- package/dist/operators.d.ts +25 -0
- package/dist/types/Compiler.d.ts +17 -4
- package/dist/types/CompilerError.d.ts +28 -4
- package/dist/types/assertions.d.ts +28 -0
- package/dist/types/handlers/CallExpression.d.ts +1 -0
- package/dist/types/handlers/SwitchStatement.d.ts +2 -0
- package/dist/types/handlers/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/instructions/ControlInstructions.d.ts +3 -1
- package/dist/types/instructions/InstructionBase.d.ts +5 -1
- package/dist/types/instructions/JumpInstruction.d.ts +1 -0
- package/dist/types/macros/Asm.d.ts +5 -0
- package/dist/types/macros/GetGlobal.d.ts +2 -2
- package/dist/types/macros/Namespace.d.ts +0 -3
- package/dist/types/macros/commands/ApplyStatus.d.ts +5 -0
- package/dist/types/macros/commands/Control.d.ts +2 -2
- package/dist/types/macros/commands/Cutscene.d.ts +5 -0
- package/dist/types/macros/commands/Draw.d.ts +2 -2
- package/dist/types/macros/commands/Explosion.d.ts +5 -0
- package/dist/types/macros/commands/Fetch.d.ts +5 -0
- package/dist/types/macros/commands/FlushMessage.d.ts +5 -0
- package/dist/types/macros/commands/GetBlock.d.ts +5 -0
- package/dist/types/macros/commands/GetFlag.d.ts +5 -0
- package/dist/types/macros/commands/Lookup.d.ts +2 -2
- package/dist/types/macros/commands/PackColor.d.ts +5 -0
- package/dist/types/macros/commands/Radar.d.ts +2 -2
- package/dist/types/macros/commands/SetBlock.d.ts +5 -0
- package/dist/types/macros/commands/SetFlag.d.ts +5 -0
- package/dist/types/macros/commands/SetRate.d.ts +5 -0
- package/dist/types/macros/commands/SetRule.d.ts +5 -0
- package/dist/types/macros/commands/SpawnUnit.d.ts +5 -0
- package/dist/types/macros/commands/SpawnWave.d.ts +5 -0
- package/dist/types/macros/commands/Stop.d.ts +5 -0
- package/dist/types/macros/commands/UnitControl.d.ts +3 -3
- package/dist/types/macros/commands/UnitLocate.d.ts +2 -2
- package/dist/types/macros/commands/index.d.ts +15 -0
- package/dist/types/macros/util.d.ts +18 -0
- package/dist/types/types.d.ts +30 -1
- package/dist/types/utils.d.ts +24 -1
- package/dist/types/values/BaseValue.d.ts +2 -0
- package/dist/types/values/FunctionValue.d.ts +3 -3
- package/dist/types/values/LiteralValue.d.ts +2 -2
- package/dist/types/values/ObjectValue.d.ts +3 -3
- package/dist/types/values/SenseableValue.d.ts +5 -5
- package/dist/types/values/StoreValue.d.ts +2 -2
- package/dist/types/values/VoidValue.d.ts +2 -2
- package/dist/types.d.ts +238 -0
- package/dist/utils.d.ts +47 -0
- package/dist/values/BaseValue.d.ts +9 -0
- package/dist/values/DestructuringValue.d.ts +17 -0
- package/dist/values/FunctionValue.d.ts +47 -0
- package/dist/values/LiteralValue.d.ts +13 -0
- package/dist/values/ObjectValue.d.ts +23 -0
- package/dist/values/SenseableValue.d.ts +23 -0
- package/dist/{types/values/StackValue.d.ts → values/StoreValue.d.ts} +5 -6
- package/dist/values/ValueOwner.d.ts +27 -0
- package/dist/values/VoidValue.d.ts +16 -0
- package/dist/values/index.d.ts +7 -0
- package/lib/commands.d.ts +849 -418
- package/lib/eslib/lib.es2015.core.d.ts +3 -0
- package/lib/globals.d.ts +331 -19
- package/lib/helpers.d.ts +14 -0
- package/lib/kinds.d.ts +3 -2
- package/lib/memory.d.ts +1 -1
- package/lib/traits.d.ts +6 -0
- package/lib/util.d.ts +16 -0
- package/package.json +15 -16
- package/build/Compiler.js +0 -105
- package/build/Compiler.js.map +0 -1
- package/build/CompilerError.js +0 -11
- package/build/CompilerError.js.map +0 -1
- package/build/Scope.js +0 -71
- package/build/Scope.js.map +0 -1
- package/build/bin.js +0 -75
- package/build/bin.js.map +0 -1
- package/build/handlers/BlockStatement.js +0 -14
- package/build/handlers/BlockStatement.js.map +0 -1
- package/build/handlers/CallExpression.js +0 -20
- package/build/handlers/CallExpression.js.map +0 -1
- package/build/handlers/File.js +0 -9
- package/build/handlers/File.js.map +0 -1
- package/build/handlers/ForStatement.js +0 -32
- package/build/handlers/ForStatement.js.map +0 -1
- package/build/handlers/Function.js +0 -47
- package/build/handlers/Function.js.map +0 -1
- package/build/handlers/Identifier.js +0 -8
- package/build/handlers/Identifier.js.map +0 -1
- package/build/handlers/IfStatement.js +0 -25
- package/build/handlers/IfStatement.js.map +0 -1
- package/build/handlers/Literal.js +0 -15
- package/build/handlers/Literal.js.map +0 -1
- package/build/handlers/Object.js +0 -55
- package/build/handlers/Object.js.map +0 -1
- package/build/handlers/OperationExpressions.js +0 -38
- package/build/handlers/OperationExpressions.js.map +0 -1
- package/build/handlers/Program.js +0 -9
- package/build/handlers/Program.js.map +0 -1
- package/build/handlers/Statements.js +0 -30
- package/build/handlers/Statements.js.map +0 -1
- package/build/handlers/TemplateExpression.js +0 -18
- package/build/handlers/TemplateExpression.js.map +0 -1
- package/build/handlers/VariableDeclaration.js +0 -72
- package/build/handlers/VariableDeclaration.js.map +0 -1
- package/build/handlers/WhileStatement.js +0 -23
- package/build/handlers/WhileStatement.js.map +0 -1
- package/build/handlers/index.js +0 -32
- package/build/handlers/index.js.map +0 -1
- package/build/index.js +0 -8
- package/build/index.js.map +0 -1
- package/build/initScope.js +0 -40
- package/build/initScope.js.map +0 -1
- package/build/instructions/AddressResolver.js +0 -31
- package/build/instructions/AddressResolver.js.map +0 -1
- package/build/instructions/ControlInstructions.js +0 -23
- package/build/instructions/ControlInstructions.js.map +0 -1
- package/build/instructions/EndInstruction.js +0 -11
- package/build/instructions/EndInstruction.js.map +0 -1
- package/build/instructions/InstructionBase.js +0 -21
- package/build/instructions/InstructionBase.js.map +0 -1
- package/build/instructions/JumpInstruction.js +0 -22
- package/build/instructions/JumpInstruction.js.map +0 -1
- package/build/instructions/OperationInstruction.js +0 -11
- package/build/instructions/OperationInstruction.js.map +0 -1
- package/build/instructions/SetCounterInstruction.js +0 -11
- package/build/instructions/SetCounterInstruction.js.map +0 -1
- package/build/instructions/SetInstruction.js +0 -11
- package/build/instructions/SetInstruction.js.map +0 -1
- package/build/instructions/ZeroSpaceInstruction.js +0 -11
- package/build/instructions/ZeroSpaceInstruction.js.map +0 -1
- package/build/instructions/index.js +0 -26
- package/build/instructions/index.js.map +0 -1
- package/build/macros/Building.js +0 -89
- package/build/macros/Building.js.map +0 -1
- package/build/macros/Function.js +0 -20
- package/build/macros/Function.js.map +0 -1
- package/build/macros/Math.js +0 -62
- package/build/macros/Math.js.map +0 -1
- package/build/macros/Memory.js +0 -63
- package/build/macros/Memory.js.map +0 -1
- package/build/macros/Namespace.js +0 -111
- package/build/macros/Namespace.js.map +0 -1
- package/build/macros/Other.js +0 -21
- package/build/macros/Other.js.map +0 -1
- package/build/macros/RawValue.js +0 -17
- package/build/macros/RawValue.js.map +0 -1
- package/build/macros/commands/Control.js +0 -26
- package/build/macros/commands/Control.js.map +0 -1
- package/build/macros/commands/Draw.js +0 -40
- package/build/macros/commands/Draw.js.map +0 -1
- package/build/macros/commands/DrawFlush.js +0 -18
- package/build/macros/commands/DrawFlush.js.map +0 -1
- package/build/macros/commands/GetLink.js +0 -25
- package/build/macros/commands/GetLink.js.map +0 -1
- package/build/macros/commands/Lookup.js +0 -25
- package/build/macros/commands/Lookup.js.map +0 -1
- package/build/macros/commands/Print.js +0 -18
- package/build/macros/commands/Print.js.map +0 -1
- package/build/macros/commands/PrintFlush.js +0 -18
- package/build/macros/commands/PrintFlush.js.map +0 -1
- package/build/macros/commands/Radar.js +0 -65
- package/build/macros/commands/Radar.js.map +0 -1
- package/build/macros/commands/Sensor.js +0 -21
- package/build/macros/commands/Sensor.js.map +0 -1
- package/build/macros/commands/UnitBind.js +0 -18
- package/build/macros/commands/UnitBind.js.map +0 -1
- package/build/macros/commands/UnitControl.js +0 -73
- package/build/macros/commands/UnitControl.js.map +0 -1
- package/build/macros/commands/UnitLocate.js +0 -76
- package/build/macros/commands/UnitLocate.js.map +0 -1
- package/build/macros/commands/UnitRadar.js +0 -48
- package/build/macros/commands/UnitRadar.js.map +0 -1
- package/build/macros/commands/Wait.js +0 -19
- package/build/macros/commands/Wait.js.map +0 -1
- package/build/macros/commands/index.js +0 -33
- package/build/macros/commands/index.js.map +0 -1
- package/build/macros/index.js +0 -40
- package/build/macros/index.js.map +0 -1
- package/build/operators.js +0 -102
- package/build/operators.js.map +0 -1
- package/build/types.js +0 -28
- package/build/types.js.map +0 -1
- package/build/utils.js +0 -18
- package/build/utils.js.map +0 -1
- package/build/values/BaseValue.js +0 -112
- package/build/values/BaseValue.js.map +0 -1
- package/build/values/FunctionValue.js +0 -116
- package/build/values/FunctionValue.js.map +0 -1
- package/build/values/LiteralValue.js +0 -89
- package/build/values/LiteralValue.js.map +0 -1
- package/build/values/ObjectValue.js +0 -55
- package/build/values/ObjectValue.js.map +0 -1
- package/build/values/StoreValue.js +0 -32
- package/build/values/StoreValue.js.map +0 -1
- package/build/values/TempValue.js +0 -78
- package/build/values/TempValue.js.map +0 -1
- package/build/values/VoidValue.js +0 -32
- package/build/values/VoidValue.js.map +0 -1
- package/build/values/index.js +0 -23
- package/build/values/index.js.map +0 -1
- package/dist/types/macros/Building.d.ts +0 -10
- package/dist/types/macros/Entities.d.ts +0 -11
- package/dist/types/values/TempValue.d.ts +0 -19
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Compiler } from "../Compiler";
|
|
2
|
+
import { EMutability, es, IFunctionValue, IScope, IValue, TValueInstructions } from "../types";
|
|
3
|
+
import { StoreValue } from "./StoreValue";
|
|
4
|
+
import { VoidValue } from "./VoidValue";
|
|
5
|
+
export declare type TFunctionValueInitParams = (childScope: IScope) => {
|
|
6
|
+
paramStores: StoreValue[];
|
|
7
|
+
paramNames: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare class FunctionValue extends VoidValue implements IFunctionValue {
|
|
10
|
+
mutability: EMutability;
|
|
11
|
+
macro: boolean;
|
|
12
|
+
private node;
|
|
13
|
+
private childScope;
|
|
14
|
+
private params;
|
|
15
|
+
private paramOwners;
|
|
16
|
+
private inst;
|
|
17
|
+
private addr;
|
|
18
|
+
private temp;
|
|
19
|
+
private ret;
|
|
20
|
+
private inline;
|
|
21
|
+
private tryingInline;
|
|
22
|
+
private body;
|
|
23
|
+
private c;
|
|
24
|
+
private callSize;
|
|
25
|
+
private inlineTemp;
|
|
26
|
+
private inlineEnd?;
|
|
27
|
+
private bundled;
|
|
28
|
+
private initialized;
|
|
29
|
+
constructor({ scope, params, body, c, node, }: {
|
|
30
|
+
scope: IScope;
|
|
31
|
+
body: es.BlockStatement;
|
|
32
|
+
c: Compiler;
|
|
33
|
+
node: es.Function;
|
|
34
|
+
params: es.Identifier[];
|
|
35
|
+
});
|
|
36
|
+
typeof(scope: IScope): TValueInstructions;
|
|
37
|
+
private initScope;
|
|
38
|
+
private ensureInit;
|
|
39
|
+
private normalReturn;
|
|
40
|
+
private normalCall;
|
|
41
|
+
private inlineReturn;
|
|
42
|
+
private inlineCall;
|
|
43
|
+
call(scope: IScope, args: IValue[]): TValueInstructions;
|
|
44
|
+
return(scope: IScope, arg: IValue | null): TValueInstructions<IValue | null>;
|
|
45
|
+
eval(_scope: IScope): TValueInstructions;
|
|
46
|
+
consume(_scope: IScope): TValueInstructions;
|
|
47
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IScope, IBindableValue, TLiteral, TValueInstructions, IValue, EMutability } from "../types";
|
|
2
|
+
import { BaseValue } from ".";
|
|
3
|
+
export declare class LiteralValue extends BaseValue implements IBindableValue {
|
|
4
|
+
data: TLiteral;
|
|
5
|
+
mutability: EMutability;
|
|
6
|
+
constructor(scope: IScope, data: TLiteral);
|
|
7
|
+
eval(_scope: IScope): TValueInstructions;
|
|
8
|
+
consume(_scope: IScope): TValueInstructions;
|
|
9
|
+
toString(): string;
|
|
10
|
+
get(scope: IScope, name: IValue): TValueInstructions;
|
|
11
|
+
get num(): number;
|
|
12
|
+
typeof(scope: IScope): TValueInstructions;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MacroFunction } from "../macros";
|
|
2
|
+
import { EMutability, IOwnedValue, IScope, IValue, TOperatorMacroMap, TValueInstructions } from "../types";
|
|
3
|
+
import { LiteralValue } from "./LiteralValue";
|
|
4
|
+
import { VoidValue } from "./VoidValue";
|
|
5
|
+
export interface IObjectValueData extends TOperatorMacroMap {
|
|
6
|
+
[k: string]: IValue | undefined;
|
|
7
|
+
$get?: MacroFunction<IValue>;
|
|
8
|
+
$eval?: MacroFunction<IValue>;
|
|
9
|
+
$consume?: MacroFunction<IValue>;
|
|
10
|
+
}
|
|
11
|
+
export declare class ObjectValue extends VoidValue {
|
|
12
|
+
mutability: EMutability;
|
|
13
|
+
macro: boolean;
|
|
14
|
+
data: IObjectValueData;
|
|
15
|
+
constructor(scope: IScope, data?: IObjectValueData);
|
|
16
|
+
static fromArray(scope: IScope, items: IObjectValueData[keyof IObjectValueData][], intialData?: IObjectValueData): ObjectValue;
|
|
17
|
+
typeof(scope: IScope): TValueInstructions;
|
|
18
|
+
get(scope: IScope, key: LiteralValue): TValueInstructions;
|
|
19
|
+
eval(scope: IScope): TValueInstructions;
|
|
20
|
+
consume(scope: IScope): TValueInstructions;
|
|
21
|
+
call(scope: IScope, args: IValue[]): TValueInstructions<IValue | null>;
|
|
22
|
+
ensureOwned(): asserts this is IOwnedValue;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EMutability, IScope, IValue, TValueInstructions } from "../types";
|
|
2
|
+
import { StoreValue } from "./StoreValue";
|
|
3
|
+
/**
|
|
4
|
+
* Senseable values are "objects" in the mlog runtime that
|
|
5
|
+
* have special properties that can be accessed
|
|
6
|
+
* via the `sense` instruction.
|
|
7
|
+
*
|
|
8
|
+
* This class extends `StoreValue` to allow dynamic behavior
|
|
9
|
+
* that is not possible with object macros.
|
|
10
|
+
*
|
|
11
|
+
* Note that these values are constant by default, so make sure
|
|
12
|
+
* to set that field to `false` if you want them to be assignable. Example:
|
|
13
|
+
* ```
|
|
14
|
+
* const value = assign(new SenseableValue(scope), {
|
|
15
|
+
* mutability: EMutability.mutable
|
|
16
|
+
* })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class SenseableValue extends StoreValue {
|
|
20
|
+
mutability: EMutability;
|
|
21
|
+
constructor(scope: IScope);
|
|
22
|
+
get(scope: IScope, prop: IValue): TValueInstructions<IValue>;
|
|
23
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { BaseValue } from ".";
|
|
2
|
-
import { IScope, IValue, TValueInstructions } from "../types";
|
|
2
|
+
import { EMutability, IScope, IValue, TValueInstructions } from "../types";
|
|
3
3
|
/**
|
|
4
|
-
* `
|
|
4
|
+
* `StoreValue` represents values unknown at compile time,
|
|
5
5
|
* mostly used with mutable variables and temporary values
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
8
|
-
|
|
9
|
-
offset: number;
|
|
7
|
+
export declare class StoreValue extends BaseValue implements IValue {
|
|
8
|
+
mutability: EMutability;
|
|
10
9
|
constructor(scope: IScope);
|
|
11
10
|
typeof(scope: IScope): TValueInstructions;
|
|
12
11
|
"="(scope: IScope, value: IValue): TValueInstructions;
|
|
13
|
-
eval(
|
|
12
|
+
eval(_scope: IScope): TValueInstructions;
|
|
14
13
|
consume(_scope: IScope): TValueInstructions;
|
|
15
14
|
toString(): string;
|
|
16
15
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IScope, IValue, IValueOwner } from "../types";
|
|
2
|
+
export interface IValueOwnerParams<T extends IValue> {
|
|
3
|
+
scope: IScope;
|
|
4
|
+
constant?: boolean;
|
|
5
|
+
value: T;
|
|
6
|
+
/** The identifier of the variable that `this` represents */
|
|
7
|
+
identifier?: string;
|
|
8
|
+
/** The name that the variable will have during transpilation to mlog */
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class ValueOwner<T extends IValue = IValue> implements IValueOwner<T> {
|
|
12
|
+
scope: IScope;
|
|
13
|
+
constant: boolean;
|
|
14
|
+
value: T;
|
|
15
|
+
owned: Set<T>;
|
|
16
|
+
identifier?: string;
|
|
17
|
+
name: string;
|
|
18
|
+
persistent: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new `ValueOwner`, if `value` is already owned,
|
|
21
|
+
* `this` will be aliased to `value`, else `this` will own `value`
|
|
22
|
+
*/
|
|
23
|
+
constructor({ scope, constant, value, identifier, name, }: IValueOwnerParams<T>);
|
|
24
|
+
own(target: T): void;
|
|
25
|
+
replace(target: T): void;
|
|
26
|
+
moveInto(owner: IValueOwner<T>): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EMutability, IScope, IValue, IValueOperators, IValueOwner, TValueInstructions } from "../types";
|
|
2
|
+
export declare class VoidValue implements IValue {
|
|
3
|
+
owner: IValueOwner | null;
|
|
4
|
+
scope: IScope;
|
|
5
|
+
mutability: EMutability;
|
|
6
|
+
macro: boolean;
|
|
7
|
+
constructor(scope: IScope);
|
|
8
|
+
eval(_scope: IScope): TValueInstructions;
|
|
9
|
+
consume(_scope: IScope): TValueInstructions<IValue>;
|
|
10
|
+
call(_scope: IScope, _args: IValue[]): TValueInstructions<IValue | null>;
|
|
11
|
+
get(_scope: IScope, _name: IValue): TValueInstructions;
|
|
12
|
+
ensureOwned(): void;
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
15
|
+
export interface VoidValue extends IValueOperators {
|
|
16
|
+
}
|