mlogjs 0.2.1 → 0.2.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 (218) hide show
  1. package/build/bin.cjs +69 -0
  2. package/dist/bin.cjs +69 -0
  3. package/dist/index.cjs +1817 -0
  4. package/dist/index.mjs +1813 -0
  5. package/dist/types/Compiler.d.ts +18 -0
  6. package/{build → dist/types}/Scope.d.ts +23 -26
  7. package/dist/types/bin.d.ts +1 -0
  8. package/dist/types/handlers/BlockStatement.d.ts +2 -0
  9. package/dist/types/handlers/CallExpression.d.ts +3 -0
  10. package/dist/types/handlers/ForStatement.d.ts +2 -0
  11. package/{build → dist/types}/handlers/Function.d.ts +4 -4
  12. package/{build → dist/types}/handlers/Identifier.d.ts +2 -2
  13. package/dist/types/handlers/IfStatement.d.ts +2 -0
  14. package/{build → dist/types}/handlers/Literal.d.ts +2 -2
  15. package/{build → dist/types}/handlers/Object.d.ts +4 -4
  16. package/{build → dist/types}/handlers/OperationExpressions.d.ts +7 -7
  17. package/dist/types/handlers/Program.d.ts +2 -0
  18. package/dist/types/handlers/Statements.d.ts +5 -0
  19. package/dist/types/handlers/TemplateExpression.d.ts +2 -0
  20. package/dist/types/handlers/VariableDeclaration.d.ts +3 -0
  21. package/dist/types/handlers/WhileStatement.d.ts +2 -0
  22. package/{build → dist/types}/handlers/index.d.ts +14 -14
  23. package/dist/types/index.d.ts +1 -0
  24. package/{build → dist/types}/initScope.d.ts +2 -2
  25. package/{build → dist/types}/instructions/AddressResolver.d.ts +12 -12
  26. package/{build → dist/types}/instructions/ControlInstructions.d.ts +11 -11
  27. package/{build → dist/types}/instructions/EndInstruction.d.ts +4 -4
  28. package/{build → dist/types}/instructions/InstructionBase.d.ts +10 -10
  29. package/{build → dist/types}/instructions/JumpInstruction.d.ts +15 -15
  30. package/{build → dist/types}/instructions/OperationInstruction.d.ts +5 -5
  31. package/{build → dist/types}/instructions/SetCounterInstruction.d.ts +5 -5
  32. package/{build → dist/types}/instructions/SetInstruction.d.ts +5 -5
  33. package/{build → dist/types}/instructions/ZeroSpaceInstruction.d.ts +4 -4
  34. package/{build → dist/types}/instructions/index.d.ts +9 -9
  35. package/{build → dist/types}/macros/Building.d.ts +11 -11
  36. package/dist/types/macros/Function.d.ts +12 -0
  37. package/{build → dist/types}/macros/Math.d.ts +5 -5
  38. package/{build → dist/types}/macros/Memory.d.ts +5 -5
  39. package/{build → dist/types}/macros/Namespace.d.ts +21 -21
  40. package/{build → dist/types}/macros/Other.d.ts +5 -5
  41. package/{build → dist/types}/macros/RawValue.d.ts +5 -5
  42. package/{build → dist/types}/macros/commands/Control.d.ts +5 -5
  43. package/{build → dist/types}/macros/commands/Draw.d.ts +5 -5
  44. package/{build → dist/types}/macros/commands/DrawFlush.d.ts +5 -5
  45. package/{build → dist/types}/macros/commands/GetLink.d.ts +5 -5
  46. package/{build → dist/types}/macros/commands/Lookup.d.ts +5 -5
  47. package/{build → dist/types}/macros/commands/Print.d.ts +5 -5
  48. package/{build → dist/types}/macros/commands/PrintFlush.d.ts +5 -5
  49. package/{build → dist/types}/macros/commands/Radar.d.ts +7 -7
  50. package/{build → dist/types}/macros/commands/Sensor.d.ts +5 -5
  51. package/{build → dist/types}/macros/commands/UnitBind.d.ts +5 -5
  52. package/dist/types/macros/commands/UnitControl.d.ts +5 -0
  53. package/{build → dist/types}/macros/commands/UnitLocate.d.ts +5 -5
  54. package/{build → dist/types}/macros/commands/UnitRadar.d.ts +5 -5
  55. package/{build → dist/types}/macros/commands/Wait.d.ts +5 -5
  56. package/{build → dist/types}/macros/commands/index.d.ts +14 -14
  57. package/{build → dist/types}/macros/index.d.ts +7 -7
  58. package/{build → dist/types}/operators.d.ts +25 -25
  59. package/dist/types/types.d.ts +100 -0
  60. package/{build → dist/types}/utils.d.ts +3 -3
  61. package/{build → dist/types}/values/BaseValue.d.ts +5 -5
  62. package/{build → dist/types}/values/FunctionValue.d.ts +34 -34
  63. package/{build → dist/types}/values/LiteralValue.d.ts +12 -12
  64. package/dist/types/values/ObjectValue.d.ts +19 -0
  65. package/{build → dist/types}/values/StoreValue.d.ts +11 -11
  66. package/{build → dist/types}/values/TempValue.d.ts +12 -12
  67. package/{build → dist/types}/values/VoidValue.d.ts +13 -11
  68. package/{build → dist/types}/values/index.d.ts +6 -6
  69. package/doc/README.md +9 -0
  70. package/lib/eslib/lib.es5.d.ts +1 -1
  71. package/lib/traits.d.ts +0 -1
  72. package/package.json +17 -27
  73. package/build/Compiler.d.ts +0 -18
  74. package/build/Compiler.js +0 -100
  75. package/build/Compiler.js.map +0 -1
  76. package/build/Scope.js +0 -61
  77. package/build/Scope.js.map +0 -1
  78. package/build/bin.d.ts +0 -2
  79. package/build/bin.js +0 -61
  80. package/build/bin.js.map +0 -1
  81. package/build/handlers/BlockStatement.d.ts +0 -2
  82. package/build/handlers/BlockStatement.js +0 -14
  83. package/build/handlers/BlockStatement.js.map +0 -1
  84. package/build/handlers/CallExpression.d.ts +0 -3
  85. package/build/handlers/CallExpression.js +0 -20
  86. package/build/handlers/CallExpression.js.map +0 -1
  87. package/build/handlers/ForStatement.d.ts +0 -2
  88. package/build/handlers/ForStatement.js +0 -32
  89. package/build/handlers/ForStatement.js.map +0 -1
  90. package/build/handlers/Function.js +0 -36
  91. package/build/handlers/Function.js.map +0 -1
  92. package/build/handlers/Identifier.js +0 -8
  93. package/build/handlers/Identifier.js.map +0 -1
  94. package/build/handlers/IfStatement.d.ts +0 -2
  95. package/build/handlers/IfStatement.js +0 -25
  96. package/build/handlers/IfStatement.js.map +0 -1
  97. package/build/handlers/Literal.js +0 -18
  98. package/build/handlers/Literal.js.map +0 -1
  99. package/build/handlers/Object.js +0 -44
  100. package/build/handlers/Object.js.map +0 -1
  101. package/build/handlers/OperationExpressions.js +0 -33
  102. package/build/handlers/OperationExpressions.js.map +0 -1
  103. package/build/handlers/Program.d.ts +0 -2
  104. package/build/handlers/Program.js +0 -9
  105. package/build/handlers/Program.js.map +0 -1
  106. package/build/handlers/Statements.d.ts +0 -5
  107. package/build/handlers/Statements.js +0 -30
  108. package/build/handlers/Statements.js.map +0 -1
  109. package/build/handlers/TemplateExpression.d.ts +0 -2
  110. package/build/handlers/TemplateExpression.js +0 -18
  111. package/build/handlers/TemplateExpression.js.map +0 -1
  112. package/build/handlers/VariableDeclaration.d.ts +0 -3
  113. package/build/handlers/VariableDeclaration.js +0 -56
  114. package/build/handlers/VariableDeclaration.js.map +0 -1
  115. package/build/handlers/WhileStatement.d.ts +0 -2
  116. package/build/handlers/WhileStatement.js +0 -23
  117. package/build/handlers/WhileStatement.js.map +0 -1
  118. package/build/handlers/index.js +0 -31
  119. package/build/handlers/index.js.map +0 -1
  120. package/build/index.d.ts +0 -1
  121. package/build/index.js +0 -8
  122. package/build/index.js.map +0 -1
  123. package/build/initScope.js +0 -40
  124. package/build/initScope.js.map +0 -1
  125. package/build/instructions/AddressResolver.js +0 -31
  126. package/build/instructions/AddressResolver.js.map +0 -1
  127. package/build/instructions/ControlInstructions.js +0 -23
  128. package/build/instructions/ControlInstructions.js.map +0 -1
  129. package/build/instructions/EndInstruction.js +0 -11
  130. package/build/instructions/EndInstruction.js.map +0 -1
  131. package/build/instructions/InstructionBase.js +0 -21
  132. package/build/instructions/InstructionBase.js.map +0 -1
  133. package/build/instructions/JumpInstruction.js +0 -22
  134. package/build/instructions/JumpInstruction.js.map +0 -1
  135. package/build/instructions/OperationInstruction.js +0 -11
  136. package/build/instructions/OperationInstruction.js.map +0 -1
  137. package/build/instructions/SetCounterInstruction.js +0 -11
  138. package/build/instructions/SetCounterInstruction.js.map +0 -1
  139. package/build/instructions/SetInstruction.js +0 -11
  140. package/build/instructions/SetInstruction.js.map +0 -1
  141. package/build/instructions/ZeroSpaceInstruction.js +0 -11
  142. package/build/instructions/ZeroSpaceInstruction.js.map +0 -1
  143. package/build/instructions/index.js +0 -26
  144. package/build/instructions/index.js.map +0 -1
  145. package/build/macros/Building.js +0 -81
  146. package/build/macros/Building.js.map +0 -1
  147. package/build/macros/Function.d.ts +0 -12
  148. package/build/macros/Function.js +0 -20
  149. package/build/macros/Function.js.map +0 -1
  150. package/build/macros/Math.js +0 -57
  151. package/build/macros/Math.js.map +0 -1
  152. package/build/macros/Memory.js +0 -61
  153. package/build/macros/Memory.js.map +0 -1
  154. package/build/macros/Namespace.js +0 -98
  155. package/build/macros/Namespace.js.map +0 -1
  156. package/build/macros/Other.js +0 -20
  157. package/build/macros/Other.js.map +0 -1
  158. package/build/macros/RawValue.js +0 -16
  159. package/build/macros/RawValue.js.map +0 -1
  160. package/build/macros/commands/Control.js +0 -25
  161. package/build/macros/commands/Control.js.map +0 -1
  162. package/build/macros/commands/Draw.js +0 -39
  163. package/build/macros/commands/Draw.js.map +0 -1
  164. package/build/macros/commands/DrawFlush.js +0 -17
  165. package/build/macros/commands/DrawFlush.js.map +0 -1
  166. package/build/macros/commands/GetLink.js +0 -21
  167. package/build/macros/commands/GetLink.js.map +0 -1
  168. package/build/macros/commands/Lookup.js +0 -24
  169. package/build/macros/commands/Lookup.js.map +0 -1
  170. package/build/macros/commands/Print.js +0 -14
  171. package/build/macros/commands/Print.js.map +0 -1
  172. package/build/macros/commands/PrintFlush.js +0 -17
  173. package/build/macros/commands/PrintFlush.js.map +0 -1
  174. package/build/macros/commands/Radar.js +0 -61
  175. package/build/macros/commands/Radar.js.map +0 -1
  176. package/build/macros/commands/Sensor.js +0 -20
  177. package/build/macros/commands/Sensor.js.map +0 -1
  178. package/build/macros/commands/UnitBind.js +0 -17
  179. package/build/macros/commands/UnitBind.js.map +0 -1
  180. package/build/macros/commands/UnitControl.d.ts +0 -5
  181. package/build/macros/commands/UnitControl.js +0 -68
  182. package/build/macros/commands/UnitControl.js.map +0 -1
  183. package/build/macros/commands/UnitLocate.js +0 -55
  184. package/build/macros/commands/UnitLocate.js.map +0 -1
  185. package/build/macros/commands/UnitRadar.js +0 -41
  186. package/build/macros/commands/UnitRadar.js.map +0 -1
  187. package/build/macros/commands/Wait.js +0 -18
  188. package/build/macros/commands/Wait.js.map +0 -1
  189. package/build/macros/commands/index.js +0 -33
  190. package/build/macros/commands/index.js.map +0 -1
  191. package/build/macros/index.js +0 -40
  192. package/build/macros/index.js.map +0 -1
  193. package/build/operators.js +0 -102
  194. package/build/operators.js.map +0 -1
  195. package/build/types.d.ts +0 -49
  196. package/build/types.js +0 -28
  197. package/build/types.js.map +0 -1
  198. package/build/utils.js +0 -13
  199. package/build/utils.js.map +0 -1
  200. package/build/values/BaseValue.js +0 -112
  201. package/build/values/BaseValue.js.map +0 -1
  202. package/build/values/FunctionValue.js +0 -104
  203. package/build/values/FunctionValue.js.map +0 -1
  204. package/build/values/LiteralValue.js +0 -88
  205. package/build/values/LiteralValue.js.map +0 -1
  206. package/build/values/ObjectValue.d.ts +0 -17
  207. package/build/values/ObjectValue.js +0 -50
  208. package/build/values/ObjectValue.js.map +0 -1
  209. package/build/values/StoreValue.js +0 -31
  210. package/build/values/StoreValue.js.map +0 -1
  211. package/build/values/TempValue.js +0 -67
  212. package/build/values/TempValue.js.map +0 -1
  213. package/build/values/VoidValue.js +0 -31
  214. package/build/values/VoidValue.js.map +0 -1
  215. package/build/values/index.js +0 -23
  216. package/build/values/index.js.map +0 -1
  217. package/dist/mlogjs.es.js +0 -6366
  218. package/dist/mlogjs.umd.js +0 -8
@@ -0,0 +1,18 @@
1
+ import { es, IScope, IValue, THandler, TValueInstructions } from "./types";
2
+ declare type THandlerMap = {
3
+ [k in es.Node["type"]]?: THandler<IValue | null>;
4
+ };
5
+ export declare class Compiler {
6
+ protected stackName?: string;
7
+ protected usingStack: boolean;
8
+ protected handlers: THandlerMap;
9
+ constructor(stackName?: string);
10
+ compile(script: string): [string, null, es.Node[]] | [null, Error, es.Node[]];
11
+ protected resolve(valueInst: TValueInstructions<IValue | null>): void;
12
+ protected serialize(resLines: TValueInstructions<IValue | null>): string;
13
+ protected parse(script: string): es.Node;
14
+ handle(scope: IScope, node: es.Node): TValueInstructions<IValue | null>;
15
+ handleEval(scope: IScope, node: es.Node): TValueInstructions;
16
+ handleMany<T extends es.Node>(scope: IScope, nodes: T[], handler?: (scope: IScope, node: T) => TValueInstructions<IValue | null>): TValueInstructions<null>;
17
+ }
18
+ export {};
@@ -1,26 +1,23 @@
1
- import { AddressResolver } from "./instructions";
2
- import { IFunctionValue, IInstruction, IScope, IValue } from "./types";
3
- export declare class Scope implements IScope {
4
- parent: IScope;
5
- name: string;
6
- data: {
7
- [k: string]: IValue;
8
- };
9
- stacked: boolean;
10
- ntemp: number;
11
- inst: IInstruction[];
12
- break: AddressResolver;
13
- continue: AddressResolver;
14
- function: IFunctionValue;
15
- constructor(values: {
16
- [k: string]: IValue;
17
- }, parent?: IScope, stacked?: boolean, ntemp?: number, name?: string, inst?: any[]);
18
- copy(): IScope;
19
- createScope(): IScope;
20
- createFunction(name: string, stacked?: boolean): IScope;
21
- has(name: string): boolean;
22
- get(name: string): IValue;
23
- set(name: string, value: IValue): IValue;
24
- hardSet(name: string, value: IValue): IValue;
25
- make(name: string, storeName: string): IValue;
26
- }
1
+ import { StoreValue } from "./values";
2
+ import { AddressResolver } from "./instructions";
3
+ import { IFunctionValue, IInstruction, IScope, IValue } from "./types";
4
+ export declare class Scope implements IScope {
5
+ parent: IScope | null;
6
+ stacked: boolean;
7
+ ntemp: number;
8
+ name: string;
9
+ inst: IInstruction[];
10
+ data: Record<string, IValue | null>;
11
+ break: AddressResolver;
12
+ continue: AddressResolver;
13
+ function: IFunctionValue;
14
+ constructor(values: Record<string, IValue | null>, parent?: IScope | null, stacked?: boolean, ntemp?: number, name?: string, inst?: IInstruction[]);
15
+ copy(): IScope;
16
+ createScope(): IScope;
17
+ createFunction(name: string, stacked?: boolean): IScope;
18
+ has(name: string): boolean;
19
+ get(name: string): IValue;
20
+ set<T extends IValue>(name: string, value: T): T;
21
+ hardSet<T extends IValue>(name: string, value: T): T;
22
+ make(name: string, storeName: string): StoreValue;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { IValue, THandler } from "../types";
2
+ export declare const BlockStatement: THandler<IValue | null>;
@@ -0,0 +1,3 @@
1
+ import { IValue, THandler } from "../types";
2
+ export declare const CallExpression: THandler<IValue | null>;
3
+ export declare const NewExpression: THandler<IValue | null>;
@@ -0,0 +1,2 @@
1
+ import { THandler } from "../types";
2
+ export declare const ForStatement: THandler<null>;
@@ -1,4 +1,4 @@
1
- import { THandler } from "../types";
2
- export declare const ArrowFunctionExpression: THandler;
3
- export declare const FunctionDeclaration: THandler;
4
- export declare const FunctionExpression: THandler;
1
+ import { THandler } from "../types";
2
+ export declare const ArrowFunctionExpression: THandler;
3
+ export declare const FunctionDeclaration: THandler;
4
+ export declare const FunctionExpression: THandler;
@@ -1,2 +1,2 @@
1
- import { THandler } from "../types";
2
- export declare const Identifier: THandler;
1
+ import { THandler } from "../types";
2
+ export declare const Identifier: THandler;
@@ -0,0 +1,2 @@
1
+ import { THandler } from "../types";
2
+ export declare const IfStatement: THandler<null>;
@@ -1,2 +1,2 @@
1
- import { THandler } from "../types";
2
- export declare const Literal: THandler;
1
+ import { THandler } from "../types";
2
+ export declare const Literal: THandler;
@@ -1,4 +1,4 @@
1
- import { THandler } from "../types";
2
- export declare const ObjectExpression: THandler;
3
- export declare const ArrayExpression: THandler;
4
- export declare const MemberExpression: THandler;
1
+ import { THandler } from "../types";
2
+ export declare const ObjectExpression: THandler;
3
+ export declare const ArrayExpression: THandler;
4
+ export declare const MemberExpression: THandler;
@@ -1,7 +1,7 @@
1
- import { THandler } from "../types";
2
- export declare const LRExpression: THandler;
3
- export declare const BinaryExpression: THandler;
4
- export declare const LogicalExpression: THandler;
5
- export declare const AssignmentExpression: THandler;
6
- export declare const UnaryExpression: THandler;
7
- export declare const UpdateExpression: THandler;
1
+ import { THandler } from "../types";
2
+ export declare const LRExpression: THandler;
3
+ export declare const BinaryExpression: THandler;
4
+ export declare const LogicalExpression: THandler;
5
+ export declare const AssignmentExpression: THandler;
6
+ export declare const UnaryExpression: THandler;
7
+ export declare const UpdateExpression: THandler;
@@ -0,0 +1,2 @@
1
+ import { THandler } from "../types";
2
+ export declare const Program: THandler<null>;
@@ -0,0 +1,5 @@
1
+ import { IValue, THandler } from "../types";
2
+ export declare const ExpressionStatement: THandler<IValue | null>;
3
+ export declare const BreakStatement: THandler<null>;
4
+ export declare const ContinueStatement: THandler<null>;
5
+ export declare const ReturnStatement: THandler<IValue | null>;
@@ -0,0 +1,2 @@
1
+ import { THandler } from "../types";
2
+ export declare const TemplateLiteral: THandler<null>;
@@ -0,0 +1,3 @@
1
+ import { THandler, IValue } from "../types";
2
+ export declare const VariableDeclaration: THandler<null>;
3
+ export declare const VariableDeclarator: THandler<IValue | null>;
@@ -0,0 +1,2 @@
1
+ import { THandler } from "../types";
2
+ export declare const WhileStatement: THandler<null>;
@@ -1,14 +1,14 @@
1
- export * from "./Program";
2
- export * from "./VariableDeclaration";
3
- export * from "./Literal";
4
- export * from "./OperationExpressions";
5
- export * from "./Identifier";
6
- export * from "./Statements";
7
- export * from "./IfStatement";
8
- export * from "./WhileStatement";
9
- export * from "./ForStatement";
10
- export * from "./Function";
11
- export * from "./CallExpression";
12
- export * from "./Object";
13
- export * from "./TemplateExpression";
14
- export * from "./BlockStatement";
1
+ export * from "./Program";
2
+ export * from "./VariableDeclaration";
3
+ export * from "./Literal";
4
+ export * from "./OperationExpressions";
5
+ export * from "./Identifier";
6
+ export * from "./Statements";
7
+ export * from "./IfStatement";
8
+ export * from "./WhileStatement";
9
+ export * from "./ForStatement";
10
+ export * from "./Function";
11
+ export * from "./CallExpression";
12
+ export * from "./Object";
13
+ export * from "./TemplateExpression";
14
+ export * from "./BlockStatement";
@@ -0,0 +1 @@
1
+ export declare const compile: (script: string) => [string, null, import("estree").Node[]] | [null, Error, import("estree").Node[]];
@@ -1,2 +1,2 @@
1
- import { Scope } from "./Scope";
2
- export declare function initScope(scope: Scope): void;
1
+ import { Scope } from "./Scope";
2
+ export declare function initScope(scope: Scope): void;
@@ -1,12 +1,12 @@
1
- import { InstructionBase } from ".";
2
- import { IBindableValue, IScope } from "../types";
3
- export declare class AddressResolver extends InstructionBase {
4
- get hidden(): boolean;
5
- set hidden(value: boolean);
6
- bonds: IBindableValue[];
7
- constructor(...bonds: IBindableValue[]);
8
- resolve(i: number): void;
9
- bind(bond: IBindableValue): void;
10
- bindBreak(scope: IScope): this;
11
- bindContinue(scope: IScope): this;
12
- }
1
+ import { InstructionBase } from ".";
2
+ import { IBindableValue, IScope } from "../types";
3
+ export declare class AddressResolver extends InstructionBase {
4
+ get hidden(): boolean;
5
+ set hidden(value: boolean);
6
+ bonds: IBindableValue[];
7
+ constructor(...bonds: IBindableValue[]);
8
+ resolve(i: number): void;
9
+ bind(bond: IBindableValue): void;
10
+ bindBreak(scope: IScope): this;
11
+ bindContinue(scope: IScope): this;
12
+ }
@@ -1,11 +1,11 @@
1
- import { IBindableValue } from "../types";
2
- import { JumpInstruction } from "./JumpInstruction";
3
- export declare class BreakInstruction extends JumpInstruction {
4
- constructor(address: IBindableValue);
5
- }
6
- export declare class ContinueInstruction extends JumpInstruction {
7
- constructor(address: IBindableValue);
8
- }
9
- export declare class ReturnInstruction extends JumpInstruction {
10
- constructor(address: IBindableValue);
11
- }
1
+ import { IBindableValue } from "../types";
2
+ import { JumpInstruction } from "./JumpInstruction";
3
+ export declare class BreakInstruction extends JumpInstruction {
4
+ constructor(address: IBindableValue);
5
+ }
6
+ export declare class ContinueInstruction extends JumpInstruction {
7
+ constructor(address: IBindableValue);
8
+ }
9
+ export declare class ReturnInstruction extends JumpInstruction {
10
+ constructor(address: IBindableValue);
11
+ }
@@ -1,4 +1,4 @@
1
- import { InstructionBase } from "./InstructionBase";
2
- export declare class EndInstruction extends InstructionBase {
3
- constructor();
4
- }
1
+ import { InstructionBase } from "./InstructionBase";
2
+ export declare class EndInstruction extends InstructionBase {
3
+ constructor();
4
+ }
@@ -1,10 +1,10 @@
1
- import { IInstruction, IValue } from "../types";
2
- export declare class InstructionBase implements IInstruction {
3
- private _hidden;
4
- get hidden(): boolean;
5
- set hidden(value: boolean);
6
- args: (string | IValue)[];
7
- constructor(...args: (string | IValue)[]);
8
- resolve(i: number): void;
9
- toString(): string;
10
- }
1
+ import { IInstruction, IValue } from "../types";
2
+ export declare class InstructionBase implements IInstruction {
3
+ private _hidden;
4
+ get hidden(): boolean;
5
+ set hidden(value: boolean);
6
+ args: (string | IValue | null)[];
7
+ constructor(...args: (string | IValue | null)[]);
8
+ resolve(i: number): void;
9
+ toString(): string;
10
+ }
@@ -1,15 +1,15 @@
1
- import { IBindableValue, IValue } from "../types";
2
- import { InstructionBase } from "./InstructionBase";
3
- export declare enum EJumpKind {
4
- Equal = "equal",
5
- NotEqual = "notEqual",
6
- LessThan = "lessThan",
7
- LessThanEq = "lessThanEq",
8
- GreaterThan = "greaterThan",
9
- GreaterThanEq = "greaterThanEq",
10
- StrictEqual = "strictEqual",
11
- Always = "always"
12
- }
13
- export declare class JumpInstruction extends InstructionBase {
14
- constructor(address: IBindableValue, kind: EJumpKind, left?: IValue, right?: IValue);
15
- }
1
+ import { IBindableValue, IValue } from "../types";
2
+ import { InstructionBase } from "./InstructionBase";
3
+ export declare enum EJumpKind {
4
+ Equal = "equal",
5
+ NotEqual = "notEqual",
6
+ LessThan = "lessThan",
7
+ LessThanEq = "lessThanEq",
8
+ GreaterThan = "greaterThan",
9
+ GreaterThanEq = "greaterThanEq",
10
+ StrictEqual = "strictEqual",
11
+ Always = "always"
12
+ }
13
+ export declare class JumpInstruction extends InstructionBase {
14
+ constructor(address: IBindableValue, kind: EJumpKind, left?: IValue | null, right?: IValue | null);
15
+ }
@@ -1,5 +1,5 @@
1
- import { InstructionBase } from ".";
2
- import { IValue } from "../types";
3
- export declare class OperationInstruction extends InstructionBase {
4
- constructor(kind: string, temp: IValue, left: IValue, right?: IValue);
5
- }
1
+ import { InstructionBase } from ".";
2
+ import { IValue } from "../types";
3
+ export declare class OperationInstruction extends InstructionBase {
4
+ constructor(kind: string, temp: IValue, left: IValue, right: IValue | null);
5
+ }
@@ -1,5 +1,5 @@
1
- import { InstructionBase } from ".";
2
- import { IValue } from "../types";
3
- export declare class SetCounterInstruction extends InstructionBase {
4
- constructor(value: IValue);
5
- }
1
+ import { InstructionBase } from ".";
2
+ import { IValue } from "../types";
3
+ export declare class SetCounterInstruction extends InstructionBase {
4
+ constructor(value: IValue);
5
+ }
@@ -1,5 +1,5 @@
1
- import { InstructionBase } from ".";
2
- import { IValue } from "../types";
3
- export declare class SetInstruction extends InstructionBase {
4
- constructor(store: IValue, value: IValue);
5
- }
1
+ import { InstructionBase } from ".";
2
+ import { IValue } from "../types";
3
+ export declare class SetInstruction extends InstructionBase {
4
+ constructor(store: IValue, value: IValue);
5
+ }
@@ -1,4 +1,4 @@
1
- import { InstructionBase } from "./InstructionBase";
2
- export declare class ZeroSpaceInstruction extends InstructionBase {
3
- toString(): string;
4
- }
1
+ import { InstructionBase } from "./InstructionBase";
2
+ export declare class ZeroSpaceInstruction extends InstructionBase {
3
+ toString(): string;
4
+ }
@@ -1,9 +1,9 @@
1
- export * from "./InstructionBase";
2
- export * from "./OperationInstruction";
3
- export * from "./SetInstruction";
4
- export * from "./EndInstruction";
5
- export * from "./AddressResolver";
6
- export * from "./JumpInstruction";
7
- export * from "./SetCounterInstruction";
8
- export * from "./ZeroSpaceInstruction";
9
- export * from "./ControlInstructions";
1
+ export * from "./InstructionBase";
2
+ export * from "./OperationInstruction";
3
+ export * from "./SetInstruction";
4
+ export * from "./EndInstruction";
5
+ export * from "./AddressResolver";
6
+ export * from "./JumpInstruction";
7
+ export * from "./SetCounterInstruction";
8
+ export * from "./ZeroSpaceInstruction";
9
+ export * from "./ControlInstructions";
@@ -1,11 +1,11 @@
1
- import { IScope } from "../types";
2
- import { ObjectValue } from "../values";
3
- export declare const itemNames: string[];
4
- export declare class Building extends ObjectValue {
5
- name: string;
6
- toString(): string;
7
- constructor(scope: IScope, name: string);
8
- }
9
- export declare class BuildingBuilder extends ObjectValue {
10
- constructor(scope: IScope);
11
- }
1
+ import { IScope } from "../types";
2
+ import { ObjectValue } from "../values";
3
+ export declare const itemNames: string[];
4
+ export declare class Building extends ObjectValue {
5
+ name: string;
6
+ toString(): string;
7
+ constructor(scope: IScope, name: string);
8
+ }
9
+ export declare class BuildingBuilder extends ObjectValue {
10
+ constructor(scope: IScope);
11
+ }
@@ -0,0 +1,12 @@
1
+ import { IScope, IValue, TValueInstructions } from "../types";
2
+ import { VoidValue } from "../values";
3
+ declare type TFunction<T extends IValue | null> = (...args: IValue[]) => TValueInstructions<T>;
4
+ export declare class MacroFunction<RT extends IValue | null = IValue> extends VoidValue {
5
+ macro: boolean;
6
+ constant: boolean;
7
+ fn: TFunction<RT>;
8
+ constructor(scope: IScope, fn: TFunction<RT>);
9
+ call(scope: IScope, args: IValue[]): TValueInstructions<RT>;
10
+ eval(scope: IScope): TValueInstructions;
11
+ }
12
+ export {};
@@ -1,5 +1,5 @@
1
- import { IScope } from "../types";
2
- import { ObjectValue } from "../values";
3
- export declare class MlogMath extends ObjectValue {
4
- constructor(scope: IScope);
5
- }
1
+ import { IScope } from "../types";
2
+ import { ObjectValue } from "../values";
3
+ export declare class MlogMath extends ObjectValue {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { IScope } from "../types";
2
- import { ObjectValue } from "../values";
3
- export declare class MemoryBuilder extends ObjectValue {
4
- constructor(scope: IScope);
5
- }
1
+ import { IScope } from "../types";
2
+ import { ObjectValue } from "../values";
3
+ export declare class MemoryBuilder extends ObjectValue {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,21 +1,21 @@
1
- import { IScope } from "../types";
2
- import { ObjectValue } from "../values";
3
- interface NamespaceMacroOptions {
4
- changeCasing?: boolean;
5
- }
6
- export declare class NamespaceMacro extends ObjectValue {
7
- changeCasing: boolean;
8
- constructor(scope: IScope, { changeCasing }?: NamespaceMacroOptions);
9
- }
10
- export declare class VarsNamespace extends NamespaceMacro {
11
- constructor(scope: IScope);
12
- }
13
- export declare class UCommandsNamespace extends NamespaceMacro {
14
- constructor(scope: IScope);
15
- }
16
- export declare class Unit extends ObjectValue {
17
- name: string;
18
- constructor(scope: IScope, name: string);
19
- toString(): string;
20
- }
21
- export {};
1
+ import { IScope } from "../types";
2
+ import { ObjectValue } from "../values";
3
+ interface NamespaceMacroOptions {
4
+ changeCasing?: boolean;
5
+ }
6
+ export declare class NamespaceMacro extends ObjectValue {
7
+ changeCasing: boolean;
8
+ constructor(scope: IScope, { changeCasing }?: NamespaceMacroOptions);
9
+ }
10
+ export declare class VarsNamespace extends NamespaceMacro {
11
+ constructor(scope: IScope);
12
+ }
13
+ export declare class UCommandsNamespace extends NamespaceMacro {
14
+ constructor(scope: IScope);
15
+ }
16
+ export declare class Unit extends ObjectValue {
17
+ name: string;
18
+ constructor(scope: IScope, name: string);
19
+ toString(): string;
20
+ }
21
+ export {};
@@ -1,5 +1,5 @@
1
- import { IScope } from "../types";
2
- import { MacroFunction } from "./Function";
3
- export declare class Concat extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { IScope } from "../types";
2
+ import { MacroFunction } from "./Function";
3
+ export declare class Concat extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { IScope } from "../types";
2
- import { MacroFunction } from "./Function";
3
- export declare class RawValueMacro extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { IScope } from "../types";
2
+ import { MacroFunction } from "./Function";
3
+ export declare class RawValueMacro extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class Control extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Control extends MacroFunction<null> {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { IScope } from "../../types";
2
- import { MacroFunction } from "../Function";
3
- export declare class Draw extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { IScope } from "../../types";
2
+ import { MacroFunction } from "../Function";
3
+ export declare class Draw extends MacroFunction<null> {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class DrawFlush extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class DrawFlush extends MacroFunction<null> {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class GetLink extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class GetLink extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class Lookup extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Lookup extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class Print extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Print extends MacroFunction<null> {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class PrintFlush extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class PrintFlush extends MacroFunction<null> {
4
+ constructor(scope: IScope);
5
+ }
@@ -1,7 +1,7 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare const validRadarFilters: string[];
4
- export declare const validRadarSorts: string[];
5
- export declare class Radar extends MacroFunction {
6
- constructor(scope: IScope);
7
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare const validRadarFilters: string[];
4
+ export declare const validRadarSorts: string[];
5
+ export declare class Radar extends MacroFunction {
6
+ constructor(scope: IScope);
7
+ }
@@ -1,5 +1,5 @@
1
- import { MacroFunction } from "..";
2
- import { IScope } from "../../types";
3
- export declare class Sensor extends MacroFunction {
4
- constructor(scope: IScope);
5
- }
1
+ import { MacroFunction } from "..";
2
+ import { IScope } from "../../types";
3
+ export declare class Sensor extends MacroFunction {
4
+ constructor(scope: IScope);
5
+ }