mlogjs 0.4.0 → 0.4.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.
Files changed (148) hide show
  1. package/dist/Scope.d.ts +1 -0
  2. package/dist/handlers/Statements.d.ts +1 -0
  3. package/dist/index.cjs +500 -350
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.mjs +500 -350
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/instructions/SetInstruction.d.ts +2 -0
  8. package/dist/macros/Asm.d.ts +1 -2
  9. package/dist/macros/Function.d.ts +4 -4
  10. package/dist/macros/GetGlobal.d.ts +2 -2
  11. package/dist/macros/Memory.d.ts +1 -2
  12. package/dist/macros/Namespace.d.ts +1 -1
  13. package/dist/macros/Other.d.ts +1 -2
  14. package/dist/macros/commands/ApplyStatus.d.ts +1 -2
  15. package/dist/macros/commands/Control.d.ts +1 -2
  16. package/dist/macros/commands/Cutscene.d.ts +1 -2
  17. package/dist/macros/commands/Draw.d.ts +1 -2
  18. package/dist/macros/commands/DrawFlush.d.ts +1 -2
  19. package/dist/macros/commands/End.d.ts +1 -2
  20. package/dist/macros/commands/Explosion.d.ts +1 -2
  21. package/dist/macros/commands/Fetch.d.ts +1 -2
  22. package/dist/macros/commands/FlushMessage.d.ts +1 -2
  23. package/dist/macros/commands/GetBlock.d.ts +1 -2
  24. package/dist/macros/commands/GetFlag.d.ts +1 -2
  25. package/dist/macros/commands/GetLink.d.ts +1 -2
  26. package/dist/macros/commands/Lookup.d.ts +1 -2
  27. package/dist/macros/commands/PackColor.d.ts +1 -2
  28. package/dist/macros/commands/Print.d.ts +1 -2
  29. package/dist/macros/commands/PrintFlush.d.ts +1 -2
  30. package/dist/macros/commands/Radar.d.ts +1 -2
  31. package/dist/macros/commands/Sensor.d.ts +1 -2
  32. package/dist/macros/commands/SetBlock.d.ts +1 -2
  33. package/dist/macros/commands/SetFlag.d.ts +1 -2
  34. package/dist/macros/commands/SetRate.d.ts +1 -2
  35. package/dist/macros/commands/SetRule.d.ts +1 -2
  36. package/dist/macros/commands/SpawnUnit.d.ts +1 -2
  37. package/dist/macros/commands/SpawnWave.d.ts +1 -2
  38. package/dist/macros/commands/Stop.d.ts +1 -2
  39. package/dist/macros/commands/UnitBind.d.ts +1 -2
  40. package/dist/macros/commands/UnitControl.d.ts +1 -2
  41. package/dist/macros/commands/UnitLocate.d.ts +1 -2
  42. package/dist/macros/commands/UnitRadar.d.ts +1 -2
  43. package/dist/macros/commands/Wait.d.ts +1 -2
  44. package/dist/macros/util.d.ts +2 -3
  45. package/dist/operators.d.ts +4 -4
  46. package/dist/types.d.ts +3 -1
  47. package/dist/values/BaseValue.d.ts +2 -2
  48. package/dist/values/DestructuringValue.d.ts +1 -1
  49. package/dist/values/FunctionValue.d.ts +3 -4
  50. package/dist/values/LiteralValue.d.ts +3 -2
  51. package/dist/values/ObjectValue.d.ts +3 -3
  52. package/dist/values/StoreValue.d.ts +4 -2
  53. package/dist/values/VoidValue.d.ts +0 -2
  54. package/lib/commands.d.ts +306 -40
  55. package/lib/eslib/lib.es5.d.ts +23 -0
  56. package/lib/globals.d.ts +2 -3
  57. package/lib/helpers.d.ts +2 -1
  58. package/lib/kinds.d.ts +5 -2
  59. package/lib/traits.d.ts +10 -6
  60. package/package.json +2 -7
  61. package/dist/types/Compiler.d.ts +0 -39
  62. package/dist/types/CompilerError.d.ts +0 -33
  63. package/dist/types/Scope.d.ts +0 -24
  64. package/dist/types/assertions.d.ts +0 -28
  65. package/dist/types/bin.d.ts +0 -1
  66. package/dist/types/handlers/BlockStatement.d.ts +0 -2
  67. package/dist/types/handlers/CallExpression.d.ts +0 -4
  68. package/dist/types/handlers/File.d.ts +0 -2
  69. package/dist/types/handlers/ForStatement.d.ts +0 -2
  70. package/dist/types/handlers/Function.d.ts +0 -5
  71. package/dist/types/handlers/Identifier.d.ts +0 -2
  72. package/dist/types/handlers/IfStatement.d.ts +0 -2
  73. package/dist/types/handlers/Literal.d.ts +0 -5
  74. package/dist/types/handlers/Object.d.ts +0 -6
  75. package/dist/types/handlers/OperationExpressions.d.ts +0 -8
  76. package/dist/types/handlers/Program.d.ts +0 -2
  77. package/dist/types/handlers/Statements.d.ts +0 -5
  78. package/dist/types/handlers/SwitchStatement.d.ts +0 -2
  79. package/dist/types/handlers/TemplateExpression.d.ts +0 -2
  80. package/dist/types/handlers/Typescript.d.ts +0 -7
  81. package/dist/types/handlers/VariableDeclaration.d.ts +0 -3
  82. package/dist/types/handlers/WhileStatement.d.ts +0 -3
  83. package/dist/types/handlers/index.d.ts +0 -17
  84. package/dist/types/index.d.ts +0 -3
  85. package/dist/types/initScope.d.ts +0 -5
  86. package/dist/types/instructions/AddressResolver.d.ts +0 -12
  87. package/dist/types/instructions/ControlInstructions.d.ts +0 -10
  88. package/dist/types/instructions/EndInstruction.d.ts +0 -4
  89. package/dist/types/instructions/InstructionBase.d.ts +0 -14
  90. package/dist/types/instructions/JumpInstruction.d.ts +0 -16
  91. package/dist/types/instructions/OperationInstruction.d.ts +0 -5
  92. package/dist/types/instructions/SetCounterInstruction.d.ts +0 -5
  93. package/dist/types/instructions/SetInstruction.d.ts +0 -6
  94. package/dist/types/instructions/ZeroSpaceInstruction.d.ts +0 -4
  95. package/dist/types/instructions/index.d.ts +0 -9
  96. package/dist/types/macros/Asm.d.ts +0 -5
  97. package/dist/types/macros/Function.d.ts +0 -13
  98. package/dist/types/macros/GetGlobal.d.ts +0 -5
  99. package/dist/types/macros/Math.d.ts +0 -5
  100. package/dist/types/macros/Memory.d.ts +0 -5
  101. package/dist/types/macros/Namespace.d.ts +0 -13
  102. package/dist/types/macros/Other.d.ts +0 -5
  103. package/dist/types/macros/commands/ApplyStatus.d.ts +0 -5
  104. package/dist/types/macros/commands/Control.d.ts +0 -5
  105. package/dist/types/macros/commands/Cutscene.d.ts +0 -5
  106. package/dist/types/macros/commands/Draw.d.ts +0 -5
  107. package/dist/types/macros/commands/DrawFlush.d.ts +0 -5
  108. package/dist/types/macros/commands/End.d.ts +0 -5
  109. package/dist/types/macros/commands/Explosion.d.ts +0 -5
  110. package/dist/types/macros/commands/Fetch.d.ts +0 -5
  111. package/dist/types/macros/commands/FlushMessage.d.ts +0 -5
  112. package/dist/types/macros/commands/GetBlock.d.ts +0 -5
  113. package/dist/types/macros/commands/GetFlag.d.ts +0 -5
  114. package/dist/types/macros/commands/GetLink.d.ts +0 -5
  115. package/dist/types/macros/commands/Lookup.d.ts +0 -5
  116. package/dist/types/macros/commands/PackColor.d.ts +0 -5
  117. package/dist/types/macros/commands/Print.d.ts +0 -5
  118. package/dist/types/macros/commands/PrintFlush.d.ts +0 -5
  119. package/dist/types/macros/commands/Radar.d.ts +0 -7
  120. package/dist/types/macros/commands/Sensor.d.ts +0 -5
  121. package/dist/types/macros/commands/SetBlock.d.ts +0 -5
  122. package/dist/types/macros/commands/SetFlag.d.ts +0 -5
  123. package/dist/types/macros/commands/SetRate.d.ts +0 -5
  124. package/dist/types/macros/commands/SetRule.d.ts +0 -5
  125. package/dist/types/macros/commands/SpawnUnit.d.ts +0 -5
  126. package/dist/types/macros/commands/SpawnWave.d.ts +0 -5
  127. package/dist/types/macros/commands/Stop.d.ts +0 -5
  128. package/dist/types/macros/commands/UnitBind.d.ts +0 -5
  129. package/dist/types/macros/commands/UnitControl.d.ts +0 -5
  130. package/dist/types/macros/commands/UnitLocate.d.ts +0 -5
  131. package/dist/types/macros/commands/UnitRadar.d.ts +0 -5
  132. package/dist/types/macros/commands/Wait.d.ts +0 -5
  133. package/dist/types/macros/commands/index.d.ts +0 -30
  134. package/dist/types/macros/index.d.ts +0 -6
  135. package/dist/types/macros/util.d.ts +0 -18
  136. package/dist/types/operators.d.ts +0 -25
  137. package/dist/types/types.d.ts +0 -238
  138. package/dist/types/utils.d.ts +0 -47
  139. package/dist/types/values/BaseValue.d.ts +0 -9
  140. package/dist/types/values/DestructuringValue.d.ts +0 -17
  141. package/dist/types/values/FunctionValue.d.ts +0 -47
  142. package/dist/types/values/LiteralValue.d.ts +0 -13
  143. package/dist/types/values/ObjectValue.d.ts +0 -23
  144. package/dist/types/values/SenseableValue.d.ts +0 -23
  145. package/dist/types/values/StoreValue.d.ts +0 -15
  146. package/dist/types/values/ValueOwner.d.ts +0 -27
  147. package/dist/types/values/VoidValue.d.ts +0 -16
  148. package/dist/types/values/index.d.ts +0 -7
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class Control extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class Cutscene extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class Draw extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class DrawFlush extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class End extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class Explosion extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class Fetch extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class FlushMessage extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class GetBlock extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class GetFlag extends MacroFunction {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class GetLink extends MacroFunction {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class Lookup extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class PackColor extends MacroFunction {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class Print extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class PrintFlush extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,7 +1,6 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare const validRadarFilters: readonly ["any", "enemy", "ally", "player", "attacker", "flying", "boss", "ground"];
4
3
  export declare const validRadarSorts: readonly ["distance", "health", "shield", "armor", "maxHealth"];
5
4
  export declare class Radar extends MacroFunction {
6
- constructor(scope: IScope);
5
+ constructor();
7
6
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class Sensor extends MacroFunction {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class SetBlock extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class SetFlag extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class SetRate extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class SetRule extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class SpawnUnit extends MacroFunction {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class SpawnWave extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { MacroFunction } from "../Function";
3
2
  export declare class Stop extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class UnitBind extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class UnitControl extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
- import { IScope } from "../../types";
2
1
  import { ObjectValue } from "../../values";
3
2
  export declare class UnitLocate extends ObjectValue {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class UnitRadar extends MacroFunction {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
2
  export declare class Wait extends MacroFunction<null> {
4
- constructor(scope: IScope);
3
+ constructor();
5
4
  }
@@ -2,7 +2,6 @@ import { IParameterDescriptor } from "../assertions";
2
2
  import { IScope, IValue, TValueInstructions } from "../types";
3
3
  import { MacroFunction } from "./Function";
4
4
  interface IOverloadNamespaceOptions<K extends string> {
5
- scope: IScope;
6
5
  overloads: Record<K, {
7
6
  /**
8
7
  * Pass the name of the options argument to tell if this overload uses
@@ -11,8 +10,8 @@ interface IOverloadNamespaceOptions<K extends string> {
11
10
  named?: string;
12
11
  args: (IParameterDescriptor | string)[];
13
12
  }>;
14
- handler(overload: K, ...args: (IValue | string)[]): TValueInstructions<IValue | null>;
13
+ handler(scope: IScope, overload: K, ...args: (IValue | string)[]): TValueInstructions<IValue | null>;
15
14
  }
16
15
  /** Used to create namespaces that contain multiple methods that map into instructions */
17
- export declare function createOverloadNamespace<K extends string>({ scope, overloads, handler, }: IOverloadNamespaceOptions<K>): Record<string, MacroFunction<IValue | null>>;
16
+ export declare function createOverloadNamespace<K extends string>({ overloads, handler, }: IOverloadNamespaceOptions<K>): Record<string, MacroFunction<IValue | null>>;
18
17
  export {};
@@ -6,11 +6,11 @@ export declare type BinaryOperator = typeof binaryOperators[number];
6
6
  export declare const logicalOperators: readonly ["&&", "??", "||"];
7
7
  export declare type LogicalOperator = typeof logicalOperators[number];
8
8
  export declare const arithmeticAssignmentOperators: readonly ["%=", "&=", "*=", "**=", "+=", "-=", "/="];
9
- export declare const logicalAssignmentOperators: readonly ["&&=", "||="];
9
+ export declare const logicalAssignmentOperators: readonly ["&&=", "||=", "??="];
10
10
  export declare const bitwiseAssignmentOperators: readonly ["<<=", ">>=", ">>>=", "^=", "|="];
11
- export declare const assignmentOperators: readonly ["%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "<<=", ">>=", ">>>=", "^=", "|=", "="];
11
+ export declare const assignmentOperators: readonly ["%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "??=", "<<=", ">>=", ">>>=", "^=", "|=", "="];
12
12
  export declare type AssignementOperator = typeof assignmentOperators[number];
13
- export declare const leftRightOperators: readonly ["*", "**", "+", "-", "/", "%", "!=", "!==", "<", "<=", "==", "===", ">", ">=", "&", "<<", ">>", ">>>", "^", "|", "instanceof", "in", "&&", "??", "||", "%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "<<=", ">>=", ">>>=", "^=", "|=", "="];
13
+ export declare const leftRightOperators: readonly ["*", "**", "+", "-", "/", "%", "!=", "!==", "<", "<=", "==", "===", ">", ">=", "&", "<<", ">>", ">>>", "^", "|", "instanceof", "in", "&&", "??", "||", "%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "??=", "<<=", ">>=", ">>>=", "^=", "|=", "="];
14
14
  export declare type LeftRightOperator = typeof leftRightOperators[number];
15
15
  export declare const unaryOperators: readonly ["!", "u+", "u-", "delete", "typeof", "void", "~"];
16
16
  export declare type UnaryOperator = typeof unaryOperators[number];
@@ -18,7 +18,7 @@ export declare const updateOperators: readonly ["++", "--"];
18
18
  export declare type UpdateOperator = typeof updateOperators[number];
19
19
  export declare const singleOperators: readonly ["!", "u+", "u-", "delete", "typeof", "void", "~", "++", "--"];
20
20
  export declare type SingleOperator = typeof singleOperators[number];
21
- export declare const operators: readonly ["*", "**", "+", "-", "/", "%", "!=", "!==", "<", "<=", "==", "===", ">", ">=", "&", "<<", ">>", ">>>", "^", "|", "instanceof", "in", "&&", "??", "||", "%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "<<=", ">>=", ">>>=", "^=", "|=", "=", "!", "u+", "u-", "delete", "typeof", "void", "~", "++", "--"];
21
+ export declare const operators: readonly ["*", "**", "+", "-", "/", "%", "!=", "!==", "<", "<=", "==", "===", ">", ">=", "&", "<<", ">>", ">>>", "^", "|", "instanceof", "in", "&&", "??", "||", "%=", "&=", "*=", "**=", "+=", "-=", "/=", "&&=", "||=", "??=", "<<=", ">>=", ">>>=", "^=", "|=", "=", "!", "u+", "u-", "delete", "typeof", "void", "~", "++", "--"];
22
22
  export declare type Operator = typeof operators[number];
23
23
  export declare const operatorMap: {
24
24
  [k in Exclude<BinaryOperator, "instanceof" | "in"> | Exclude<LogicalOperator, "??">]: string;
package/dist/types.d.ts CHANGED
@@ -38,6 +38,8 @@ export interface IScope {
38
38
  * the instructions that make the body of a function
39
39
  */
40
40
  inst: IInstruction[];
41
+ /** The label applied to this scope */
42
+ label?: string;
41
43
  /** Where to jump to on a break statement */
42
44
  break: AddressResolver;
43
45
  /** Where to jump to on a continue statement */
@@ -174,6 +176,7 @@ export interface IValueOperators {
174
176
  "/="(scope: IScope, value: IValue): TValueInstructions;
175
177
  "&&="(scope: IScope, value: IValue): TValueInstructions;
176
178
  "||="(scope: IScope, value: IValue): TValueInstructions;
179
+ "??="(scope: IScope, value: IValue): TValueInstructions;
177
180
  "<<="(scope: IScope, value: IValue): TValueInstructions;
178
181
  ">>="(scope: IScope, value: IValue): TValueInstructions;
179
182
  ">>>="(scope: IScope, value: IValue): TValueInstructions;
@@ -198,7 +201,6 @@ export declare enum EMutability {
198
201
  }
199
202
  export interface IValue extends IValueOperators {
200
203
  owner: IValueOwner | null;
201
- scope: IScope;
202
204
  mutability: EMutability;
203
205
  macro: boolean;
204
206
  /**
@@ -1,9 +1,9 @@
1
- import { IOwnedValue, IScope, IValue, TValueInstructions } from "../types";
1
+ import { IScope, IValue, TValueInstructions } from "../types";
2
2
  import { VoidValue } from ".";
3
3
  export declare class BaseValue extends VoidValue implements IValue {
4
4
  "u-"(scope: IScope): TValueInstructions;
5
5
  "u+"(scope: IScope): TValueInstructions;
6
6
  "!"(scope: IScope): TValueInstructions;
7
7
  "~"(scope: IScope): TValueInstructions;
8
- ensureOwned(): asserts this is IOwnedValue;
8
+ "??"(scope: IScope, other: IValue): TValueInstructions;
9
9
  }
@@ -10,7 +10,7 @@ import { VoidValue } from "./VoidValue";
10
10
  export declare class DestructuringValue extends VoidValue {
11
11
  members: Map<IValue, IValue>;
12
12
  macro: boolean;
13
- constructor(scope: IScope, members: Map<IValue, IValue>);
13
+ constructor(members: Map<IValue, IValue>);
14
14
  "="(scope: IScope, right: IValue): TValueInstructions;
15
15
  eval(_scope: IScope): TValueInstructions<IValue>;
16
16
  consume(_scope: IScope): TValueInstructions<IValue>;
@@ -9,7 +9,7 @@ export declare type TFunctionValueInitParams = (childScope: IScope) => {
9
9
  export declare class FunctionValue extends VoidValue implements IFunctionValue {
10
10
  mutability: EMutability;
11
11
  macro: boolean;
12
- private node;
12
+ scope: IScope;
13
13
  private childScope;
14
14
  private params;
15
15
  private paramOwners;
@@ -26,14 +26,13 @@ export declare class FunctionValue extends VoidValue implements IFunctionValue {
26
26
  private inlineEnd?;
27
27
  private bundled;
28
28
  private initialized;
29
- constructor({ scope, params, body, c, node, }: {
29
+ constructor({ scope, params, body, c, }: {
30
30
  scope: IScope;
31
31
  body: es.BlockStatement;
32
32
  c: Compiler;
33
- node: es.Function;
34
33
  params: es.Identifier[];
35
34
  });
36
- typeof(scope: IScope): TValueInstructions;
35
+ typeof(): TValueInstructions;
37
36
  private initScope;
38
37
  private ensureInit;
39
38
  private normalReturn;
@@ -3,11 +3,12 @@ import { BaseValue } from ".";
3
3
  export declare class LiteralValue extends BaseValue implements IBindableValue {
4
4
  data: TLiteral;
5
5
  mutability: EMutability;
6
- constructor(scope: IScope, data: TLiteral);
6
+ constructor(data: TLiteral);
7
7
  eval(_scope: IScope): TValueInstructions;
8
8
  consume(_scope: IScope): TValueInstructions;
9
9
  toString(): string;
10
10
  get(scope: IScope, name: IValue): TValueInstructions;
11
11
  get num(): number;
12
- typeof(scope: IScope): TValueInstructions;
12
+ typeof(): TValueInstructions;
13
+ ensureOwned(): void;
13
14
  }
@@ -12,9 +12,9 @@ export declare class ObjectValue extends VoidValue {
12
12
  mutability: EMutability;
13
13
  macro: boolean;
14
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;
15
+ constructor(data?: IObjectValueData);
16
+ static fromArray(items: IObjectValueData[keyof IObjectValueData][], intialData?: IObjectValueData): ObjectValue;
17
+ typeof(): TValueInstructions;
18
18
  get(scope: IScope, key: LiteralValue): TValueInstructions;
19
19
  eval(scope: IScope): TValueInstructions;
20
20
  consume(scope: IScope): TValueInstructions;
@@ -1,15 +1,17 @@
1
1
  import { BaseValue } from ".";
2
- import { EMutability, IScope, IValue, TValueInstructions } from "../types";
2
+ import { EMutability, IOwnedValue, 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
7
  export declare class StoreValue extends BaseValue implements IValue {
8
+ scope: IScope;
8
9
  mutability: EMutability;
9
10
  constructor(scope: IScope);
10
- typeof(scope: IScope): TValueInstructions;
11
+ typeof(): TValueInstructions;
11
12
  "="(scope: IScope, value: IValue): TValueInstructions;
12
13
  eval(_scope: IScope): TValueInstructions;
13
14
  consume(_scope: IScope): TValueInstructions;
15
+ ensureOwned(): asserts this is IOwnedValue;
14
16
  toString(): string;
15
17
  }
@@ -1,10 +1,8 @@
1
1
  import { EMutability, IScope, IValue, IValueOperators, IValueOwner, TValueInstructions } from "../types";
2
2
  export declare class VoidValue implements IValue {
3
3
  owner: IValueOwner | null;
4
- scope: IScope;
5
4
  mutability: EMutability;
6
5
  macro: boolean;
7
- constructor(scope: IScope);
8
6
  eval(_scope: IScope): TValueInstructions;
9
7
  consume(_scope: IScope): TValueInstructions<IValue>;
10
8
  call(_scope: IScope, _args: IValue[]): TValueInstructions<IValue | null>;