mlogjs 0.2.0 → 0.2.1
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/LICENSE +21 -21
- package/README.md +68 -18
- package/build/Compiler.d.ts +18 -18
- package/build/Compiler.js +99 -119
- package/build/Compiler.js.map +1 -1
- package/build/Scope.d.ts +26 -26
- package/build/Scope.js +60 -60
- package/build/Scope.js.map +1 -1
- package/build/bin.d.ts +2 -2
- package/build/bin.js +60 -41
- package/build/bin.js.map +1 -1
- package/build/handlers/BlockStatement.d.ts +2 -2
- package/build/handlers/BlockStatement.js +13 -13
- package/build/handlers/CallExpression.d.ts +3 -3
- package/build/handlers/CallExpression.js +19 -19
- package/build/handlers/ForStatement.d.ts +2 -2
- package/build/handlers/ForStatement.js +31 -31
- package/build/handlers/Function.d.ts +4 -4
- package/build/handlers/Function.js +35 -35
- package/build/handlers/Identifier.d.ts +2 -2
- package/build/handlers/Identifier.js +7 -7
- package/build/handlers/IfStatement.d.ts +2 -2
- package/build/handlers/IfStatement.js +24 -24
- package/build/handlers/Literal.d.ts +2 -2
- package/build/handlers/Literal.js +17 -17
- package/build/handlers/Object.d.ts +4 -4
- package/build/handlers/Object.js +43 -43
- package/build/handlers/OperationExpressions.d.ts +7 -7
- package/build/handlers/OperationExpressions.js +32 -32
- package/build/handlers/Program.d.ts +2 -2
- package/build/handlers/Program.js +8 -8
- package/build/handlers/Program.js.map +1 -1
- package/build/handlers/Statements.d.ts +5 -5
- package/build/handlers/Statements.js +29 -29
- package/build/handlers/TemplateExpression.d.ts +2 -2
- package/build/handlers/TemplateExpression.js +17 -17
- package/build/handlers/VariableDeclaration.d.ts +3 -3
- package/build/handlers/VariableDeclaration.js +55 -55
- package/build/handlers/WhileStatement.d.ts +2 -2
- package/build/handlers/WhileStatement.js +22 -22
- package/build/handlers/index.d.ts +14 -14
- package/build/handlers/index.js +30 -30
- package/build/index.d.ts +1 -1
- package/build/index.js +7 -7
- package/build/initScope.d.ts +2 -0
- package/build/initScope.js +40 -0
- package/build/initScope.js.map +1 -0
- package/build/instructions/AddressResolver.d.ts +12 -12
- package/build/instructions/AddressResolver.js +30 -30
- package/build/instructions/ControlInstructions.d.ts +11 -11
- package/build/instructions/ControlInstructions.js +22 -22
- package/build/instructions/EndInstruction.d.ts +4 -4
- package/build/instructions/EndInstruction.js +10 -10
- package/build/instructions/InstructionBase.d.ts +10 -10
- package/build/instructions/InstructionBase.js +20 -20
- package/build/instructions/JumpInstruction.d.ts +15 -15
- package/build/instructions/JumpInstruction.js +21 -21
- package/build/instructions/OperationInstruction.d.ts +5 -5
- package/build/instructions/OperationInstruction.js +10 -10
- package/build/instructions/SetCounterInstruction.d.ts +5 -5
- package/build/instructions/SetCounterInstruction.js +10 -10
- package/build/instructions/SetInstruction.d.ts +5 -5
- package/build/instructions/SetInstruction.js +10 -10
- package/build/instructions/ZeroSpaceInstruction.d.ts +4 -4
- package/build/instructions/ZeroSpaceInstruction.js +10 -10
- package/build/instructions/index.d.ts +9 -9
- package/build/instructions/index.js +25 -25
- package/build/macros/Building.d.ts +11 -11
- package/build/macros/Building.js +80 -80
- package/build/macros/Function.d.ts +12 -12
- package/build/macros/Function.js +19 -19
- package/build/macros/Math.d.ts +5 -5
- package/build/macros/Math.js +56 -56
- package/build/macros/Math.js.map +1 -1
- package/build/macros/Memory.d.ts +5 -5
- package/build/macros/Memory.js +60 -60
- package/build/macros/Namespace.d.ts +21 -21
- package/build/macros/Namespace.js +97 -97
- package/build/macros/Other.d.ts +5 -5
- package/build/macros/Other.js +19 -19
- package/build/macros/RawValue.d.ts +5 -5
- package/build/macros/RawValue.js +15 -15
- package/build/macros/commands/{control.d.ts → Control.d.ts} +5 -5
- package/build/macros/commands/{control.js → Control.js} +24 -24
- package/build/macros/commands/{control.js.map → Control.js.map} +0 -0
- package/build/macros/commands/Draw.d.ts +5 -5
- package/build/macros/commands/Draw.js +38 -38
- package/build/macros/commands/DrawFlush.d.ts +5 -5
- package/build/macros/commands/DrawFlush.js +16 -16
- package/build/macros/commands/GetLink.d.ts +5 -5
- package/build/macros/commands/GetLink.js +20 -20
- package/build/macros/commands/Lookup.d.ts +5 -5
- package/build/macros/commands/Lookup.js +23 -23
- package/build/macros/commands/Print.d.ts +5 -5
- package/build/macros/commands/Print.js +13 -13
- package/build/macros/commands/PrintFlush.d.ts +5 -5
- package/build/macros/commands/PrintFlush.js +16 -16
- package/build/macros/commands/Radar.d.ts +7 -7
- package/build/macros/commands/Radar.js +60 -60
- package/build/macros/commands/Sensor.d.ts +5 -5
- package/build/macros/commands/Sensor.js +19 -19
- package/build/macros/commands/UnitBind.d.ts +5 -5
- package/build/macros/commands/UnitBind.js +16 -16
- package/build/macros/commands/UnitControl.d.ts +5 -5
- package/build/macros/commands/UnitControl.js +67 -67
- package/build/macros/commands/UnitLocate.d.ts +5 -5
- package/build/macros/commands/UnitLocate.js +54 -54
- package/build/macros/commands/UnitRadar.d.ts +5 -5
- package/build/macros/commands/UnitRadar.js +40 -40
- package/build/macros/commands/Wait.d.ts +5 -5
- package/build/macros/commands/Wait.js +17 -17
- package/build/macros/commands/index.d.ts +14 -14
- package/build/macros/commands/index.js +32 -32
- package/build/macros/index.d.ts +7 -7
- package/build/macros/index.js +39 -39
- package/build/operators.d.ts +25 -25
- package/build/operators.js +101 -101
- package/build/types.d.ts +49 -49
- package/build/types.js +27 -27
- package/build/utils.d.ts +3 -3
- package/build/utils.js +12 -12
- package/build/values/BaseValue.d.ts +5 -5
- package/build/values/BaseValue.js +111 -111
- package/build/values/FunctionValue.d.ts +34 -34
- package/build/values/FunctionValue.js +103 -103
- package/build/values/LiteralValue.d.ts +12 -12
- package/build/values/LiteralValue.js +87 -87
- package/build/values/LiteralValue.js.map +1 -1
- package/build/values/ObjectValue.d.ts +17 -17
- package/build/values/ObjectValue.js +49 -49
- package/build/values/StoreValue.d.ts +11 -11
- package/build/values/StoreValue.js +30 -30
- package/build/values/TempValue.d.ts +12 -12
- package/build/values/TempValue.js +66 -66
- package/build/values/TempValue.js.map +1 -1
- package/build/values/VoidValue.d.ts +11 -11
- package/build/values/VoidValue.js +30 -30
- package/build/values/index.d.ts +6 -6
- package/build/values/index.js +22 -22
- package/dist/mlogjs.es.js +6366 -0
- package/dist/mlogjs.umd.js +8 -0
- package/lib/commands.d.ts +326 -326
- package/lib/eslib/index.d.ts +3 -3
- package/lib/eslib/lib.d.ts +9 -9
- package/lib/eslib/lib.es2015.collection.d.ts +89 -89
- package/lib/eslib/lib.es2015.core.d.ts +16 -16
- package/lib/eslib/lib.es2015.d.ts +30 -30
- package/lib/eslib/lib.es2015.generator.d.ts +79 -79
- package/lib/eslib/lib.es2015.iterable.d.ts +70 -70
- package/lib/eslib/lib.es5.d.ts +295 -295
- package/lib/eslib/lib.es6.d.ts +18 -18
- package/lib/globals.d.ts +328 -328
- package/lib/helpers.d.ts +23 -23
- package/lib/index.d.ts +7 -7
- package/lib/kinds.d.ts +36 -36
- package/lib/memory.d.ts +17 -17
- package/lib/traits.d.ts +121 -121
- package/lib/util.d.ts +32 -32
- package/package.json +73 -48
- package/build/macros/Blocks.d.ts +0 -5
- package/build/macros/Blocks.js +0 -143
- package/build/macros/Blocks.js.map +0 -1
- package/build/macros/Draw.d.ts +0 -5
- package/build/macros/Draw.js +0 -39
- package/build/macros/Draw.js.map +0 -1
- package/build/macros/Items.d.ts +0 -5
- package/build/macros/Items.js +0 -20
- package/build/macros/Items.js.map +0 -1
- package/build/macros/Liquids.d.ts +0 -5
- package/build/macros/Liquids.js +0 -18
- package/build/macros/Liquids.js.map +0 -1
- package/build/macros/Symbol.d.ts +0 -0
- package/build/macros/Symbol.js +0 -1
- package/build/macros/Symbol.js.map +0 -1
- package/build/macros/SymbolNamespace.d.ts +0 -0
- package/build/macros/SymbolNamespace.js +0 -1
- package/build/macros/SymbolNamespace.js.map +0 -1
- package/build/macros/TypeFactory.d.ts +0 -8
- package/build/macros/TypeFactory.js +0 -22
- package/build/macros/TypeFactory.js.map +0 -1
- package/build/macros/Units.d.ts +0 -5
- package/build/macros/Units.js +0 -18
- package/build/macros/Units.js.map +0 -1
- package/build/macros/Vars.d.ts +0 -5
- package/build/macros/Vars.js +0 -18
- package/build/macros/Vars.js.map +0 -1
- package/build/macros/commands/Asm.d.ts +0 -5
- package/build/macros/commands/Asm.js +0 -21
- package/build/macros/commands/Asm.js.map +0 -1
- package/build/macros/commands/io.d.ts +0 -8
- package/build/macros/commands/io.js +0 -47
- package/build/macros/commands/io.js.map +0 -1
- package/build/macros/helpers/GetBuilding.d.ts +0 -5
- package/build/macros/helpers/GetBuilding.js +0 -16
- package/build/macros/helpers/GetBuilding.js.map +0 -1
- package/build/macros/helpers/GetVar.d.ts +0 -5
- package/build/macros/helpers/GetVar.js +0 -16
- package/build/macros/helpers/GetVar.js.map +0 -1
- package/build/macros/helpers/index.d.ts +0 -2
- package/build/macros/helpers/index.js +0 -15
- package/build/macros/helpers/index.js.map +0 -1
- package/dist/bundle.js +0 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateExpression = exports.UnaryExpression = exports.AssignmentExpression = exports.LogicalExpression = exports.BinaryExpression = exports.LRExpression = void 0;
|
|
4
|
-
const LRExpression = (c, scope, node) => {
|
|
5
|
-
const [left, leftInst] = c.handleEval(scope, node.left);
|
|
6
|
-
const [right, rightInst] = c.handleEval(scope, node.right);
|
|
7
|
-
const [op, opInst] = left[node.operator](scope, right);
|
|
8
|
-
return [op, [...leftInst, ...rightInst, ...opInst]];
|
|
9
|
-
};
|
|
10
|
-
exports.LRExpression = LRExpression;
|
|
11
|
-
exports.BinaryExpression = exports.LRExpression;
|
|
12
|
-
exports.LogicalExpression = exports.LRExpression;
|
|
13
|
-
const AssignmentExpression = (c, scope, node) => {
|
|
14
|
-
const [left, leftInst] = c.handle(scope, node.left);
|
|
15
|
-
const [right, rightInst] = c.handleEval(scope, node.right);
|
|
16
|
-
const [op, opInst] = left[node.operator](scope, right);
|
|
17
|
-
return [op, [...leftInst, ...rightInst, ...opInst]];
|
|
18
|
-
};
|
|
19
|
-
exports.AssignmentExpression = AssignmentExpression;
|
|
20
|
-
const UnaryExpression = (c, scope, { argument, operator }) => {
|
|
21
|
-
const [arg, argInst] = c.handleEval(scope, argument);
|
|
22
|
-
const operatorId = operator == "+" || operator == "-" ? "u" + operator : operator;
|
|
23
|
-
const [op, opInst] = arg[operatorId](scope);
|
|
24
|
-
return [op, [...argInst, ...opInst]];
|
|
25
|
-
};
|
|
26
|
-
exports.UnaryExpression = UnaryExpression;
|
|
27
|
-
const UpdateExpression = (c, scope, { argument, operator, prefix }) => {
|
|
28
|
-
const [arg, argInst] = c.handle(scope, argument);
|
|
29
|
-
const [op, opInst] = arg[operator](scope, prefix);
|
|
30
|
-
return [op, [...argInst, ...opInst]];
|
|
31
|
-
};
|
|
32
|
-
exports.UpdateExpression = UpdateExpression;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateExpression = exports.UnaryExpression = exports.AssignmentExpression = exports.LogicalExpression = exports.BinaryExpression = exports.LRExpression = void 0;
|
|
4
|
+
const LRExpression = (c, scope, node) => {
|
|
5
|
+
const [left, leftInst] = c.handleEval(scope, node.left);
|
|
6
|
+
const [right, rightInst] = c.handleEval(scope, node.right);
|
|
7
|
+
const [op, opInst] = left[node.operator](scope, right);
|
|
8
|
+
return [op, [...leftInst, ...rightInst, ...opInst]];
|
|
9
|
+
};
|
|
10
|
+
exports.LRExpression = LRExpression;
|
|
11
|
+
exports.BinaryExpression = exports.LRExpression;
|
|
12
|
+
exports.LogicalExpression = exports.LRExpression;
|
|
13
|
+
const AssignmentExpression = (c, scope, node) => {
|
|
14
|
+
const [left, leftInst] = c.handle(scope, node.left);
|
|
15
|
+
const [right, rightInst] = c.handleEval(scope, node.right);
|
|
16
|
+
const [op, opInst] = left[node.operator](scope, right);
|
|
17
|
+
return [op, [...leftInst, ...rightInst, ...opInst]];
|
|
18
|
+
};
|
|
19
|
+
exports.AssignmentExpression = AssignmentExpression;
|
|
20
|
+
const UnaryExpression = (c, scope, { argument, operator }) => {
|
|
21
|
+
const [arg, argInst] = c.handleEval(scope, argument);
|
|
22
|
+
const operatorId = operator == "+" || operator == "-" ? "u" + operator : operator;
|
|
23
|
+
const [op, opInst] = arg[operatorId](scope);
|
|
24
|
+
return [op, [...argInst, ...opInst]];
|
|
25
|
+
};
|
|
26
|
+
exports.UnaryExpression = UnaryExpression;
|
|
27
|
+
const UpdateExpression = (c, scope, { argument, operator, prefix }) => {
|
|
28
|
+
const [arg, argInst] = c.handle(scope, argument);
|
|
29
|
+
const [op, opInst] = arg[operator](scope, prefix);
|
|
30
|
+
return [op, [...argInst, ...opInst]];
|
|
31
|
+
};
|
|
32
|
+
exports.UpdateExpression = UpdateExpression;
|
|
33
33
|
//# sourceMappingURL=OperationExpressions.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const Program: THandler;
|
|
1
|
+
import { THandler } from "../types";
|
|
2
|
+
export declare const Program: THandler;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Program = void 0;
|
|
4
|
-
const Scope_1 = require("../Scope");
|
|
5
|
-
const Program = (c, scope, node) => {
|
|
6
|
-
return c.handleMany(scope
|
|
7
|
-
};
|
|
8
|
-
exports.Program = Program;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Program = void 0;
|
|
4
|
+
const Scope_1 = require("../Scope");
|
|
5
|
+
const Program = (c, scope, node) => {
|
|
6
|
+
return c.handleMany(scope ?? new Scope_1.Scope({}), node.body);
|
|
7
|
+
};
|
|
8
|
+
exports.Program = Program;
|
|
9
9
|
//# sourceMappingURL=Program.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Program.js","sourceRoot":"","sources":["../../src/handlers/Program.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAG1B,MAAM,OAAO,GAAa,CAAC,CAAC,EAAE,KAAK,EAAE,IAAgB,EAAE,EAAE;IAC9D,OAAO,CAAC,CAAC,UAAU,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"Program.js","sourceRoot":"","sources":["../../src/handlers/Program.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAG1B,MAAM,OAAO,GAAa,CAAC,CAAC,EAAE,KAAK,EAAE,IAAgB,EAAE,EAAE;IAC9D,OAAO,CAAC,CAAC,UAAU,CAAC,KAAK,IAAI,IAAI,aAAK,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC,CAAC;AAFW,QAAA,OAAO,WAElB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const ExpressionStatement: THandler;
|
|
3
|
-
export declare const BreakStatement: THandler;
|
|
4
|
-
export declare const ContinueStatement: THandler;
|
|
5
|
-
export declare const ReturnStatement: THandler;
|
|
1
|
+
import { THandler } from "../types";
|
|
2
|
+
export declare const ExpressionStatement: THandler;
|
|
3
|
+
export declare const BreakStatement: THandler;
|
|
4
|
+
export declare const ContinueStatement: THandler;
|
|
5
|
+
export declare const ReturnStatement: THandler;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReturnStatement = exports.ContinueStatement = exports.BreakStatement = exports.ExpressionStatement = void 0;
|
|
4
|
-
const instructions_1 = require("../instructions");
|
|
5
|
-
const values_1 = require("../values");
|
|
6
|
-
const ExpressionStatement = (c, scope, node) => {
|
|
7
|
-
return c.handle(scope, node.expression);
|
|
8
|
-
};
|
|
9
|
-
exports.ExpressionStatement = ExpressionStatement;
|
|
10
|
-
const BreakStatement = (_, scope) => {
|
|
11
|
-
const addr = new values_1.LiteralValue(scope, null);
|
|
12
|
-
scope.break.bind(addr);
|
|
13
|
-
return [null, [new instructions_1.BreakInstruction(addr)]];
|
|
14
|
-
};
|
|
15
|
-
exports.BreakStatement = BreakStatement;
|
|
16
|
-
const ContinueStatement = (_, scope) => {
|
|
17
|
-
const addr = new values_1.LiteralValue(scope, null);
|
|
18
|
-
scope.continue.bind(addr);
|
|
19
|
-
return [null, [new instructions_1.ContinueInstruction(addr)]];
|
|
20
|
-
};
|
|
21
|
-
exports.ContinueStatement = ContinueStatement;
|
|
22
|
-
const ReturnStatement = (c, scope, node) => {
|
|
23
|
-
const [arg, argInst] = node.argument
|
|
24
|
-
? c.handle(scope, node.argument)
|
|
25
|
-
: [null, []];
|
|
26
|
-
const [ret, retInst] = scope.function.return(scope, arg);
|
|
27
|
-
return [ret, [...argInst, ...retInst]];
|
|
28
|
-
};
|
|
29
|
-
exports.ReturnStatement = ReturnStatement;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReturnStatement = exports.ContinueStatement = exports.BreakStatement = exports.ExpressionStatement = void 0;
|
|
4
|
+
const instructions_1 = require("../instructions");
|
|
5
|
+
const values_1 = require("../values");
|
|
6
|
+
const ExpressionStatement = (c, scope, node) => {
|
|
7
|
+
return c.handle(scope, node.expression);
|
|
8
|
+
};
|
|
9
|
+
exports.ExpressionStatement = ExpressionStatement;
|
|
10
|
+
const BreakStatement = (_, scope) => {
|
|
11
|
+
const addr = new values_1.LiteralValue(scope, null);
|
|
12
|
+
scope.break.bind(addr);
|
|
13
|
+
return [null, [new instructions_1.BreakInstruction(addr)]];
|
|
14
|
+
};
|
|
15
|
+
exports.BreakStatement = BreakStatement;
|
|
16
|
+
const ContinueStatement = (_, scope) => {
|
|
17
|
+
const addr = new values_1.LiteralValue(scope, null);
|
|
18
|
+
scope.continue.bind(addr);
|
|
19
|
+
return [null, [new instructions_1.ContinueInstruction(addr)]];
|
|
20
|
+
};
|
|
21
|
+
exports.ContinueStatement = ContinueStatement;
|
|
22
|
+
const ReturnStatement = (c, scope, node) => {
|
|
23
|
+
const [arg, argInst] = node.argument
|
|
24
|
+
? c.handle(scope, node.argument)
|
|
25
|
+
: [null, []];
|
|
26
|
+
const [ret, retInst] = scope.function.return(scope, arg);
|
|
27
|
+
return [ret, [...argInst, ...retInst]];
|
|
28
|
+
};
|
|
29
|
+
exports.ReturnStatement = ReturnStatement;
|
|
30
30
|
//# sourceMappingURL=Statements.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const TemplateLiteral: THandler;
|
|
1
|
+
import { THandler } from "../types";
|
|
2
|
+
export declare const TemplateLiteral: THandler;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TemplateLiteral = void 0;
|
|
4
|
-
const instructions_1 = require("../instructions");
|
|
5
|
-
const TemplateLiteral = (c, scope, node) => {
|
|
6
|
-
const args = [];
|
|
7
|
-
const inst = [];
|
|
8
|
-
node.expressions.forEach((expression, i) => {
|
|
9
|
-
const [v, vi] = c.handleEval(scope, expression);
|
|
10
|
-
inst.push(...vi);
|
|
11
|
-
args.push(node.quasis[i].value.raw, v);
|
|
12
|
-
});
|
|
13
|
-
args.push(node.quasis.slice(-1)[0].value.raw);
|
|
14
|
-
inst.push(new instructions_1.ZeroSpaceInstruction(...args));
|
|
15
|
-
return [null, inst];
|
|
16
|
-
};
|
|
17
|
-
exports.TemplateLiteral = TemplateLiteral;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TemplateLiteral = void 0;
|
|
4
|
+
const instructions_1 = require("../instructions");
|
|
5
|
+
const TemplateLiteral = (c, scope, node) => {
|
|
6
|
+
const args = [];
|
|
7
|
+
const inst = [];
|
|
8
|
+
node.expressions.forEach((expression, i) => {
|
|
9
|
+
const [v, vi] = c.handleEval(scope, expression);
|
|
10
|
+
inst.push(...vi);
|
|
11
|
+
args.push(node.quasis[i].value.raw, v);
|
|
12
|
+
});
|
|
13
|
+
args.push(node.quasis.slice(-1)[0].value.raw);
|
|
14
|
+
inst.push(new instructions_1.ZeroSpaceInstruction(...args));
|
|
15
|
+
return [null, inst];
|
|
16
|
+
};
|
|
17
|
+
exports.TemplateLiteral = TemplateLiteral;
|
|
18
18
|
//# sourceMappingURL=TemplateExpression.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const VariableDeclaration: THandler;
|
|
3
|
-
export declare const VariableDeclarator: THandler;
|
|
1
|
+
import { THandler } from "../types";
|
|
2
|
+
export declare const VariableDeclaration: THandler;
|
|
3
|
+
export declare const VariableDeclarator: THandler;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VariableDeclarator = exports.VariableDeclaration = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
const VariableDeclaration = (c, scope, node) => {
|
|
6
|
-
return c.handleMany(scope, node.declarations, (scope, child) => (0, exports.VariableDeclarator)(c, scope, child, node.kind));
|
|
7
|
-
};
|
|
8
|
-
exports.VariableDeclaration = VariableDeclaration;
|
|
9
|
-
const VariableDeclarator = (c, scope, node, kind = "let") => {
|
|
10
|
-
let valinst = node.init
|
|
11
|
-
? c.handleEval(scope, node.init)
|
|
12
|
-
: [null, []];
|
|
13
|
-
switch (node.id.type) {
|
|
14
|
-
case "Identifier": {
|
|
15
|
-
const { name } = node.id;
|
|
16
|
-
const [init] = valinst;
|
|
17
|
-
if (kind === "const" && !init)
|
|
18
|
-
throw Error("Cannot create constant with void value.");
|
|
19
|
-
if (kind === "const" && init.constant) {
|
|
20
|
-
scope.set(name, init);
|
|
21
|
-
return valinst;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const value = scope.make(name, (0, utils_1.nodeName)(node));
|
|
25
|
-
if (init) {
|
|
26
|
-
if (init.macro)
|
|
27
|
-
throw new Error("Macro value must be constant.");
|
|
28
|
-
valinst[1].push(...value["="](scope, valinst[0])[1]);
|
|
29
|
-
}
|
|
30
|
-
if (kind === "const")
|
|
31
|
-
value.constant = true;
|
|
32
|
-
return valinst;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
case "ArrayPattern": {
|
|
36
|
-
const { elements } = node.id;
|
|
37
|
-
const [init] = valinst;
|
|
38
|
-
if (!init)
|
|
39
|
-
throw new Error("Cannot use array destructuring with constant with void value.");
|
|
40
|
-
if (!init.macro)
|
|
41
|
-
throw new Error("Cannot use array destructuring on non macro values");
|
|
42
|
-
for (let i = 0; i < elements.length; i++) {
|
|
43
|
-
const element = elements[i];
|
|
44
|
-
if (!element)
|
|
45
|
-
continue;
|
|
46
|
-
const val = init.data[i];
|
|
47
|
-
scope.set(element.name, val);
|
|
48
|
-
}
|
|
49
|
-
return valinst;
|
|
50
|
-
}
|
|
51
|
-
default:
|
|
52
|
-
throw new Error("");
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
exports.VariableDeclarator = VariableDeclarator;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VariableDeclarator = exports.VariableDeclaration = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const VariableDeclaration = (c, scope, node) => {
|
|
6
|
+
return c.handleMany(scope, node.declarations, (scope, child) => (0, exports.VariableDeclarator)(c, scope, child, node.kind));
|
|
7
|
+
};
|
|
8
|
+
exports.VariableDeclaration = VariableDeclaration;
|
|
9
|
+
const VariableDeclarator = (c, scope, node, kind = "let") => {
|
|
10
|
+
let valinst = node.init
|
|
11
|
+
? c.handleEval(scope, node.init)
|
|
12
|
+
: [null, []];
|
|
13
|
+
switch (node.id.type) {
|
|
14
|
+
case "Identifier": {
|
|
15
|
+
const { name } = node.id;
|
|
16
|
+
const [init] = valinst;
|
|
17
|
+
if (kind === "const" && !init)
|
|
18
|
+
throw Error("Cannot create constant with void value.");
|
|
19
|
+
if (kind === "const" && init.constant) {
|
|
20
|
+
scope.set(name, init);
|
|
21
|
+
return valinst;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const value = scope.make(name, (0, utils_1.nodeName)(node));
|
|
25
|
+
if (init) {
|
|
26
|
+
if (init.macro)
|
|
27
|
+
throw new Error("Macro value must be constant.");
|
|
28
|
+
valinst[1].push(...value["="](scope, valinst[0])[1]);
|
|
29
|
+
}
|
|
30
|
+
if (kind === "const")
|
|
31
|
+
value.constant = true;
|
|
32
|
+
return valinst;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
case "ArrayPattern": {
|
|
36
|
+
const { elements } = node.id;
|
|
37
|
+
const [init] = valinst;
|
|
38
|
+
if (!init)
|
|
39
|
+
throw new Error("Cannot use array destructuring with constant with void value.");
|
|
40
|
+
if (!init.macro)
|
|
41
|
+
throw new Error("Cannot use array destructuring on non macro values");
|
|
42
|
+
for (let i = 0; i < elements.length; i++) {
|
|
43
|
+
const element = elements[i];
|
|
44
|
+
if (!element)
|
|
45
|
+
continue;
|
|
46
|
+
const val = init.data[i];
|
|
47
|
+
scope.set(element.name, val);
|
|
48
|
+
}
|
|
49
|
+
return valinst;
|
|
50
|
+
}
|
|
51
|
+
default:
|
|
52
|
+
throw new Error("");
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.VariableDeclarator = VariableDeclarator;
|
|
56
56
|
//# sourceMappingURL=VariableDeclaration.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const WhileStatement: THandler;
|
|
1
|
+
import { THandler } from "../types";
|
|
2
|
+
export declare const WhileStatement: THandler;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WhileStatement = void 0;
|
|
4
|
-
const instructions_1 = require("../instructions");
|
|
5
|
-
const values_1 = require("../values");
|
|
6
|
-
const WhileStatement = (c, scope, node) => {
|
|
7
|
-
const lines = [];
|
|
8
|
-
const [test, testLines] = c.handleEval(scope, node.test);
|
|
9
|
-
const startLoopAddr = new values_1.LiteralValue(scope, null);
|
|
10
|
-
const endLoopAddr = new values_1.LiteralValue(scope, null);
|
|
11
|
-
const startLoopLine = new instructions_1.AddressResolver(startLoopAddr).bindContinue(scope);
|
|
12
|
-
const endLoopLine = new instructions_1.AddressResolver(endLoopAddr).bindBreak(scope);
|
|
13
|
-
if (test instanceof values_1.LiteralValue) {
|
|
14
|
-
if (test.data) {
|
|
15
|
-
lines.push(startLoopLine, ...c.handle(scope, node.body)[1], new instructions_1.JumpInstruction(startLoopAddr, instructions_1.EJumpKind.Always), endLoopLine);
|
|
16
|
-
}
|
|
17
|
-
return [null, lines];
|
|
18
|
-
}
|
|
19
|
-
lines.push(startLoopLine, ...testLines, new instructions_1.JumpInstruction(endLoopAddr, instructions_1.EJumpKind.Equal, test, new values_1.LiteralValue(scope, 0)), ...c.handle(scope, node.body)[1], new instructions_1.JumpInstruction(startLoopAddr, instructions_1.EJumpKind.Always), endLoopLine);
|
|
20
|
-
return [null, lines];
|
|
21
|
-
};
|
|
22
|
-
exports.WhileStatement = WhileStatement;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhileStatement = void 0;
|
|
4
|
+
const instructions_1 = require("../instructions");
|
|
5
|
+
const values_1 = require("../values");
|
|
6
|
+
const WhileStatement = (c, scope, node) => {
|
|
7
|
+
const lines = [];
|
|
8
|
+
const [test, testLines] = c.handleEval(scope, node.test);
|
|
9
|
+
const startLoopAddr = new values_1.LiteralValue(scope, null);
|
|
10
|
+
const endLoopAddr = new values_1.LiteralValue(scope, null);
|
|
11
|
+
const startLoopLine = new instructions_1.AddressResolver(startLoopAddr).bindContinue(scope);
|
|
12
|
+
const endLoopLine = new instructions_1.AddressResolver(endLoopAddr).bindBreak(scope);
|
|
13
|
+
if (test instanceof values_1.LiteralValue) {
|
|
14
|
+
if (test.data) {
|
|
15
|
+
lines.push(startLoopLine, ...c.handle(scope, node.body)[1], new instructions_1.JumpInstruction(startLoopAddr, instructions_1.EJumpKind.Always), endLoopLine);
|
|
16
|
+
}
|
|
17
|
+
return [null, lines];
|
|
18
|
+
}
|
|
19
|
+
lines.push(startLoopLine, ...testLines, new instructions_1.JumpInstruction(endLoopAddr, instructions_1.EJumpKind.Equal, test, new values_1.LiteralValue(scope, 0)), ...c.handle(scope, node.body)[1], new instructions_1.JumpInstruction(startLoopAddr, instructions_1.EJumpKind.Always), endLoopLine);
|
|
20
|
+
return [null, lines];
|
|
21
|
+
};
|
|
22
|
+
exports.WhileStatement = WhileStatement;
|
|
23
23
|
//# sourceMappingURL=WhileStatement.js.map
|
|
@@ -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";
|
package/build/handlers/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Program"), exports);
|
|
18
|
-
__exportStar(require("./VariableDeclaration"), exports);
|
|
19
|
-
__exportStar(require("./Literal"), exports);
|
|
20
|
-
__exportStar(require("./OperationExpressions"), exports);
|
|
21
|
-
__exportStar(require("./Identifier"), exports);
|
|
22
|
-
__exportStar(require("./Statements"), exports);
|
|
23
|
-
__exportStar(require("./IfStatement"), exports);
|
|
24
|
-
__exportStar(require("./WhileStatement"), exports);
|
|
25
|
-
__exportStar(require("./ForStatement"), exports);
|
|
26
|
-
__exportStar(require("./Function"), exports);
|
|
27
|
-
__exportStar(require("./CallExpression"), exports);
|
|
28
|
-
__exportStar(require("./Object"), exports);
|
|
29
|
-
__exportStar(require("./TemplateExpression"), exports);
|
|
30
|
-
__exportStar(require("./BlockStatement"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Program"), exports);
|
|
18
|
+
__exportStar(require("./VariableDeclaration"), exports);
|
|
19
|
+
__exportStar(require("./Literal"), exports);
|
|
20
|
+
__exportStar(require("./OperationExpressions"), exports);
|
|
21
|
+
__exportStar(require("./Identifier"), exports);
|
|
22
|
+
__exportStar(require("./Statements"), exports);
|
|
23
|
+
__exportStar(require("./IfStatement"), exports);
|
|
24
|
+
__exportStar(require("./WhileStatement"), exports);
|
|
25
|
+
__exportStar(require("./ForStatement"), exports);
|
|
26
|
+
__exportStar(require("./Function"), exports);
|
|
27
|
+
__exportStar(require("./CallExpression"), exports);
|
|
28
|
+
__exportStar(require("./Object"), exports);
|
|
29
|
+
__exportStar(require("./TemplateExpression"), exports);
|
|
30
|
+
__exportStar(require("./BlockStatement"), exports);
|
|
31
31
|
//# sourceMappingURL=index.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const compile: (script: string) => string;
|
|
1
|
+
export declare const compile: (script: string) => [string, Error, import("estree").Node[]];
|
package/build/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compile = void 0;
|
|
4
|
-
const Compiler_1 = require("./Compiler");
|
|
5
|
-
const compiler = new Compiler_1.Compiler();
|
|
6
|
-
const compile = (script) => compiler.compile(script);
|
|
7
|
-
exports.compile = compile;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compile = void 0;
|
|
4
|
+
const Compiler_1 = require("./Compiler");
|
|
5
|
+
const compiler = new Compiler_1.Compiler();
|
|
6
|
+
const compile = (script) => compiler.compile(script);
|
|
7
|
+
exports.compile = compile;
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initScope = void 0;
|
|
4
|
+
const macros_1 = require("./macros");
|
|
5
|
+
const Namespace_1 = require("./macros/Namespace");
|
|
6
|
+
const RawValue_1 = require("./macros/RawValue");
|
|
7
|
+
function initScope(scope) {
|
|
8
|
+
// namespaces
|
|
9
|
+
scope.hardSet("ControlKind", new macros_1.NamespaceMacro(scope));
|
|
10
|
+
scope.hardSet("Vars", new macros_1.VarsNamespace(scope));
|
|
11
|
+
scope.hardSet("Items", new macros_1.NamespaceMacro(scope, { changeCasing: true }));
|
|
12
|
+
scope.hardSet("Liquids", new macros_1.NamespaceMacro(scope));
|
|
13
|
+
scope.hardSet("Units", new macros_1.NamespaceMacro(scope));
|
|
14
|
+
scope.hardSet("LAccess", new macros_1.NamespaceMacro(scope));
|
|
15
|
+
scope.hardSet("UnitCommands", new Namespace_1.UCommandsNamespace(scope));
|
|
16
|
+
scope.hardSet("Blocks", new macros_1.NamespaceMacro(scope, { changeCasing: true }));
|
|
17
|
+
// helper methods
|
|
18
|
+
scope.hardSet("getBuilding", new macros_1.BuildingBuilder(scope));
|
|
19
|
+
scope.hardSet("getVar", new RawValue_1.RawValueMacro(scope));
|
|
20
|
+
scope.hardSet("concat", new macros_1.Concat(scope));
|
|
21
|
+
scope.hardSet("Math", new macros_1.MlogMath(scope));
|
|
22
|
+
scope.hardSet("Memory", new macros_1.MemoryBuilder(scope));
|
|
23
|
+
// commands
|
|
24
|
+
scope.hardSet("draw", new macros_1.commands.Draw(scope));
|
|
25
|
+
scope.hardSet("print", new macros_1.commands.Print(scope));
|
|
26
|
+
scope.hardSet("printFlush", new macros_1.commands.PrintFlush(scope));
|
|
27
|
+
scope.hardSet("drawFlush", new macros_1.commands.DrawFlush(scope));
|
|
28
|
+
scope.hardSet("getLink", new macros_1.commands.GetLink(scope));
|
|
29
|
+
scope.hardSet("control", new macros_1.commands.Control(scope));
|
|
30
|
+
scope.hardSet("radar", new macros_1.commands.Radar(scope));
|
|
31
|
+
scope.hardSet("sensor", new macros_1.commands.Sensor(scope));
|
|
32
|
+
scope.hardSet("wait", new macros_1.commands.Wait(scope));
|
|
33
|
+
scope.hardSet("lookup", new macros_1.commands.Lookup(scope));
|
|
34
|
+
scope.hardSet("unitBind", new macros_1.commands.UnitBind(scope));
|
|
35
|
+
scope.hardSet("unitControl", new macros_1.commands.UnitControl(scope));
|
|
36
|
+
scope.hardSet("unitRadar", new macros_1.commands.UnitRadar(scope));
|
|
37
|
+
scope.hardSet("unitLocate", new macros_1.commands.UnitLocate(scope));
|
|
38
|
+
}
|
|
39
|
+
exports.initScope = initScope;
|
|
40
|
+
//# sourceMappingURL=initScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initScope.js","sourceRoot":"","sources":["../src/initScope.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { InstructionBase } from ".";
|
|
2
|
-
import {
|
|
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,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AddressResolver = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
class AddressResolver extends _1.InstructionBase {
|
|
6
|
-
constructor(...bonds) {
|
|
7
|
-
super();
|
|
8
|
-
this.bonds = bonds;
|
|
9
|
-
}
|
|
10
|
-
get hidden() {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
set hidden(value) { }
|
|
14
|
-
resolve(i) {
|
|
15
|
-
for (const literal of this.bonds)
|
|
16
|
-
literal.data = i;
|
|
17
|
-
}
|
|
18
|
-
bind(bond) {
|
|
19
|
-
this.bonds.push(bond);
|
|
20
|
-
}
|
|
21
|
-
bindBreak(scope) {
|
|
22
|
-
scope.break = this;
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
bindContinue(scope) {
|
|
26
|
-
scope.continue = this;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.AddressResolver = AddressResolver;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressResolver = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
class AddressResolver extends _1.InstructionBase {
|
|
6
|
+
constructor(...bonds) {
|
|
7
|
+
super();
|
|
8
|
+
this.bonds = bonds;
|
|
9
|
+
}
|
|
10
|
+
get hidden() {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
set hidden(value) { }
|
|
14
|
+
resolve(i) {
|
|
15
|
+
for (const literal of this.bonds)
|
|
16
|
+
literal.data = i;
|
|
17
|
+
}
|
|
18
|
+
bind(bond) {
|
|
19
|
+
this.bonds.push(bond);
|
|
20
|
+
}
|
|
21
|
+
bindBreak(scope) {
|
|
22
|
+
scope.break = this;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
bindContinue(scope) {
|
|
26
|
+
scope.continue = this;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.AddressResolver = AddressResolver;
|
|
31
31
|
//# sourceMappingURL=AddressResolver.js.map
|