mlogjs 0.1.10 → 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 -92
- 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 +59 -33
- 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/BlockStatement.js.map +1 -1
- package/build/handlers/CallExpression.d.ts +3 -3
- package/build/handlers/CallExpression.js +19 -19
- package/build/handlers/CallExpression.js.map +1 -1
- package/build/handlers/ForStatement.d.ts +2 -2
- package/build/handlers/ForStatement.js +31 -31
- package/build/handlers/ForStatement.js.map +1 -1
- package/build/handlers/Function.d.ts +4 -4
- package/build/handlers/Function.js +35 -32
- package/build/handlers/Function.js.map +1 -1
- package/build/handlers/Identifier.d.ts +2 -2
- package/build/handlers/Identifier.js +7 -7
- package/build/handlers/Identifier.js.map +1 -1
- package/build/handlers/IfStatement.d.ts +2 -2
- package/build/handlers/IfStatement.js +24 -24
- package/build/handlers/IfStatement.js.map +1 -1
- package/build/handlers/Literal.d.ts +2 -2
- package/build/handlers/Literal.js +17 -15
- package/build/handlers/Literal.js.map +1 -1
- package/build/handlers/Object.d.ts +4 -4
- package/build/handlers/Object.js +43 -43
- package/build/handlers/Object.js.map +1 -1
- package/build/handlers/OperationExpressions.d.ts +7 -7
- package/build/handlers/OperationExpressions.js +32 -31
- package/build/handlers/OperationExpressions.js.map +1 -1
- 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 -27
- package/build/handlers/Statements.js.map +1 -1
- package/build/handlers/TemplateExpression.d.ts +2 -2
- package/build/handlers/TemplateExpression.js +17 -17
- package/build/handlers/TemplateExpression.js.map +1 -1
- package/build/handlers/VariableDeclaration.d.ts +3 -3
- package/build/handlers/VariableDeclaration.js +55 -31
- package/build/handlers/VariableDeclaration.js.map +1 -1
- package/build/handlers/WhileStatement.d.ts +2 -2
- package/build/handlers/WhileStatement.js +22 -22
- package/build/handlers/WhileStatement.js.map +1 -1
- package/build/handlers/index.d.ts +14 -14
- package/build/handlers/index.js +30 -26
- package/build/handlers/index.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +7 -7
- package/build/index.js.map +1 -1
- 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 -31
- package/build/instructions/AddressResolver.js.map +1 -1
- package/build/instructions/ControlInstructions.d.ts +11 -11
- package/build/instructions/ControlInstructions.js +22 -22
- package/build/instructions/ControlInstructions.js.map +1 -1
- package/build/instructions/EndInstruction.d.ts +4 -4
- package/build/instructions/EndInstruction.js +10 -10
- package/build/instructions/EndInstruction.js.map +1 -1
- package/build/instructions/InstructionBase.d.ts +10 -10
- package/build/instructions/InstructionBase.js +20 -20
- package/build/instructions/InstructionBase.js.map +1 -1
- package/build/instructions/JumpInstruction.d.ts +15 -15
- package/build/instructions/JumpInstruction.js +21 -21
- package/build/instructions/JumpInstruction.js.map +1 -1
- package/build/instructions/OperationInstruction.d.ts +5 -5
- package/build/instructions/OperationInstruction.js +10 -10
- package/build/instructions/OperationInstruction.js.map +1 -1
- package/build/instructions/SetCounterInstruction.d.ts +5 -5
- package/build/instructions/SetCounterInstruction.js +10 -10
- package/build/instructions/SetCounterInstruction.js.map +1 -1
- package/build/instructions/SetInstruction.d.ts +5 -5
- package/build/instructions/SetInstruction.js +10 -10
- package/build/instructions/SetInstruction.js.map +1 -1
- package/build/instructions/ZeroSpaceInstruction.d.ts +4 -4
- package/build/instructions/ZeroSpaceInstruction.js +10 -10
- package/build/instructions/ZeroSpaceInstruction.js.map +1 -1
- package/build/instructions/index.d.ts +9 -9
- package/build/instructions/index.js +25 -21
- package/build/instructions/index.js.map +1 -1
- package/build/macros/Building.d.ts +11 -0
- package/build/macros/Building.js +81 -0
- package/build/macros/Building.js.map +1 -0
- package/build/macros/Function.d.ts +12 -12
- package/build/macros/Function.js +19 -19
- package/build/macros/Function.js.map +1 -1
- 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/{Blocks.d.ts → Memory.d.ts} +5 -5
- package/build/macros/Memory.js +61 -0
- package/build/macros/Memory.js.map +1 -0
- package/build/macros/Namespace.d.ts +21 -0
- package/build/macros/Namespace.js +98 -0
- package/build/macros/Namespace.js.map +1 -0
- package/build/macros/Other.d.ts +5 -8
- package/build/macros/Other.js +19 -28
- package/build/macros/Other.js.map +1 -1
- package/build/macros/{Draw.d.ts → RawValue.d.ts} +5 -5
- package/build/macros/RawValue.js +16 -0
- package/build/macros/RawValue.js.map +1 -0
- package/build/macros/commands/Control.d.ts +5 -0
- package/build/macros/commands/Control.js +25 -0
- package/build/macros/commands/Control.js.map +1 -0
- package/build/macros/commands/Draw.d.ts +5 -0
- package/build/macros/{Draw.js → commands/Draw.js} +38 -33
- package/build/macros/commands/Draw.js.map +1 -0
- package/build/macros/commands/DrawFlush.d.ts +5 -0
- package/build/macros/commands/DrawFlush.js +17 -0
- package/build/macros/commands/DrawFlush.js.map +1 -0
- package/build/macros/commands/GetLink.d.ts +5 -0
- package/build/macros/commands/GetLink.js +21 -0
- package/build/macros/commands/GetLink.js.map +1 -0
- package/build/macros/commands/Lookup.d.ts +5 -0
- package/build/macros/commands/Lookup.js +24 -0
- package/build/macros/commands/Lookup.js.map +1 -0
- package/build/macros/commands/Print.d.ts +5 -0
- package/build/macros/commands/Print.js +14 -0
- package/build/macros/commands/Print.js.map +1 -0
- package/build/macros/commands/PrintFlush.d.ts +5 -0
- package/build/macros/commands/PrintFlush.js +17 -0
- package/build/macros/commands/PrintFlush.js.map +1 -0
- package/build/macros/commands/Radar.d.ts +7 -0
- package/build/macros/commands/Radar.js +61 -0
- package/build/macros/commands/Radar.js.map +1 -0
- package/build/macros/commands/Sensor.d.ts +5 -0
- package/build/macros/commands/Sensor.js +20 -0
- package/build/macros/commands/Sensor.js.map +1 -0
- package/build/macros/commands/UnitBind.d.ts +5 -0
- package/build/macros/commands/UnitBind.js +17 -0
- package/build/macros/commands/UnitBind.js.map +1 -0
- package/build/macros/commands/UnitControl.d.ts +5 -0
- package/build/macros/commands/UnitControl.js +68 -0
- package/build/macros/commands/UnitControl.js.map +1 -0
- package/build/macros/commands/UnitLocate.d.ts +5 -0
- package/build/macros/commands/UnitLocate.js +55 -0
- package/build/macros/commands/UnitLocate.js.map +1 -0
- package/build/macros/commands/UnitRadar.d.ts +5 -0
- package/build/macros/commands/UnitRadar.js +41 -0
- package/build/macros/commands/UnitRadar.js.map +1 -0
- package/build/macros/commands/Wait.d.ts +5 -0
- package/build/macros/commands/Wait.js +18 -0
- package/build/macros/commands/Wait.js.map +1 -0
- package/build/macros/commands/index.d.ts +14 -0
- package/build/macros/commands/index.js +33 -0
- package/build/macros/commands/index.js.map +1 -0
- package/build/macros/index.d.ts +7 -5
- package/build/macros/index.js +39 -17
- package/build/macros/index.js.map +1 -1
- package/build/operators.d.ts +25 -22
- package/build/operators.js +101 -38
- package/build/operators.js.map +1 -1
- package/build/types.d.ts +49 -49
- package/build/types.js +27 -23
- package/build/types.js.map +1 -1
- package/build/utils.d.ts +3 -2
- package/build/utils.js +12 -8
- package/build/utils.js.map +1 -1
- package/build/values/BaseValue.d.ts +5 -5
- package/build/values/BaseValue.js +111 -101
- package/build/values/BaseValue.js.map +1 -1
- package/build/values/FunctionValue.d.ts +34 -34
- package/build/values/FunctionValue.js +103 -100
- package/build/values/FunctionValue.js.map +1 -1
- package/build/values/LiteralValue.d.ts +12 -12
- package/build/values/LiteralValue.js +87 -88
- 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/ObjectValue.js.map +1 -1
- package/build/values/StoreValue.d.ts +11 -11
- package/build/values/StoreValue.js +30 -30
- package/build/values/StoreValue.js.map +1 -1
- package/build/values/TempValue.d.ts +12 -12
- package/build/values/TempValue.js +66 -52
- 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/VoidValue.js.map +1 -1
- package/build/values/index.d.ts +6 -6
- package/build/values/index.js +22 -18
- package/build/values/index.js.map +1 -1
- package/dist/mlogjs.es.js +6366 -0
- package/dist/mlogjs.umd.js +8 -0
- package/lib/commands.d.ts +326 -0
- package/lib/eslib/index.d.ts +3 -0
- package/lib/eslib/lib.d.ts +9 -0
- package/lib/eslib/lib.es2015.collection.d.ts +89 -0
- package/lib/eslib/lib.es2015.core.d.ts +16 -0
- package/lib/eslib/lib.es2015.d.ts +30 -0
- package/lib/eslib/lib.es2015.generator.d.ts +79 -0
- package/lib/eslib/lib.es2015.iterable.d.ts +70 -0
- package/lib/eslib/lib.es5.d.ts +295 -0
- package/lib/eslib/lib.es6.d.ts +18 -0
- package/lib/globals.d.ts +328 -0
- package/lib/helpers.d.ts +23 -0
- package/lib/index.d.ts +7 -0
- package/lib/kinds.d.ts +36 -0
- package/lib/memory.d.ts +17 -0
- package/lib/traits.d.ts +121 -0
- package/lib/util.d.ts +32 -0
- package/package.json +73 -37
- package/.gitattributes +0 -2
- package/build/macros/Blocks.js +0 -134
- package/build/macros/Blocks.js.map +0 -1
- package/build/macros/Draw.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/scopes/FunctionScope.d.ts +0 -5
- package/build/scopes/FunctionScope.js +0 -13
- package/build/scopes/FunctionScope.js.map +0 -1
- package/build/scopes/LoopScope.d.ts +0 -5
- package/build/scopes/LoopScope.js +0 -13
- package/build/scopes/LoopScope.js.map +0 -1
- package/build/scopes/Scope.d.ts +0 -36
- package/build/scopes/Scope.js +0 -93
- package/build/scopes/Scope.js.map +0 -1
- package/build/scopes/index.d.ts +0 -3
- package/build/scopes/index.js +0 -16
- package/build/scopes/index.js.map +0 -1
- package/dist/bundle.js +0 -553
- package/docs/.nojekyll +0 -0
- package/docs/README.md +0 -17
- package/docs/_coverpage.md +0 -8
- package/docs/_sidebar.md +0 -3
- package/docs/data-types.md +0 -56
- package/docs/getting-started.md +0 -19
- package/docs/index.html +0 -41
- package/docs/mlogjs.png +0 -0
- package/mlogjs.d.ts +0 -72
- package/tsconfig.json +0 -22
- package/webpack.config.js +0 -22
package/build/types.js
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.es = void 0;
|
|
27
|
+
exports.es = __importStar(require("estree"));
|
|
24
28
|
//# sourceMappingURL=types.js.map
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6B"}
|
package/build/utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { es } from "./types";
|
|
2
|
-
export declare function nodeName(node: es.Node): string;
|
|
1
|
+
import { es } from "./types";
|
|
2
|
+
export declare function nodeName(node: es.Node): string;
|
|
3
|
+
export declare function camelToDashCase(name: string): string;
|
package/build/utils.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nodeName = void 0;
|
|
4
|
-
function nodeName(node) {
|
|
5
|
-
const { line, column } = node.loc.start;
|
|
6
|
-
return line + ":" + column;
|
|
7
|
-
}
|
|
8
|
-
exports.nodeName = nodeName;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camelToDashCase = exports.nodeName = void 0;
|
|
4
|
+
function nodeName(node) {
|
|
5
|
+
const { line, column } = node.loc.start;
|
|
6
|
+
return line + ":" + column;
|
|
7
|
+
}
|
|
8
|
+
exports.nodeName = nodeName;
|
|
9
|
+
function camelToDashCase(name) {
|
|
10
|
+
return name.replace(/[A-Z]/g, str => `-${str.toLowerCase()}`);
|
|
11
|
+
}
|
|
12
|
+
exports.camelToDashCase = camelToDashCase;
|
|
9
13
|
//# sourceMappingURL=utils.js.map
|
package/build/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,QAAQ,CAAC,IAAa;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,QAAQ,CAAC,IAAa;IACpC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IACxC,OAAO,IAAI,GAAG,GAAG,GAAG,MAAM,CAAC;AAC7B,CAAC;AAHD,4BAGC;AAED,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AAFD,0CAEC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IScope, IValue, TValueInstructions } from "../types";
|
|
2
|
-
import { VoidValue } from ".";
|
|
3
|
-
export declare class BaseValue extends VoidValue implements IValue {
|
|
4
|
-
"u-"(scope: IScope): TValueInstructions;
|
|
5
|
-
}
|
|
1
|
+
import { IScope, IValue, TValueInstructions } from "../types";
|
|
2
|
+
import { VoidValue } from ".";
|
|
3
|
+
export declare class BaseValue extends VoidValue implements IValue {
|
|
4
|
+
"u-"(scope: IScope): TValueInstructions;
|
|
5
|
+
}
|
|
@@ -1,102 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseValue = void 0;
|
|
4
|
-
const instructions_1 = require("../instructions");
|
|
5
|
-
const operators_1 = require("../operators");
|
|
6
|
-
const _1 = require(".");
|
|
7
|
-
class BaseValue extends _1.VoidValue {
|
|
8
|
-
"u-"(scope) {
|
|
9
|
-
const [that, inst] = this.eval(scope);
|
|
10
|
-
const temp = new _1.TempValue(scope);
|
|
11
|
-
return [
|
|
12
|
-
temp,
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
for (const
|
|
90
|
-
BaseValue.prototype[
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseValue = void 0;
|
|
4
|
+
const instructions_1 = require("../instructions");
|
|
5
|
+
const operators_1 = require("../operators");
|
|
6
|
+
const _1 = require(".");
|
|
7
|
+
class BaseValue extends _1.VoidValue {
|
|
8
|
+
"u-"(scope) {
|
|
9
|
+
const [that, inst] = this.eval(scope);
|
|
10
|
+
const temp = new _1.TempValue(scope);
|
|
11
|
+
return [
|
|
12
|
+
temp,
|
|
13
|
+
[
|
|
14
|
+
...inst,
|
|
15
|
+
new instructions_1.OperationInstruction("sub", temp, new _1.LiteralValue(scope, 0), that),
|
|
16
|
+
],
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.BaseValue = BaseValue;
|
|
21
|
+
const operatorMap = {
|
|
22
|
+
"==": "equal",
|
|
23
|
+
"===": "strictEqual",
|
|
24
|
+
"!=": "notEqual",
|
|
25
|
+
"!==": "notEqual",
|
|
26
|
+
"<": "lessThan",
|
|
27
|
+
">": "greaterThan",
|
|
28
|
+
"<=": "lessThanEq",
|
|
29
|
+
">=": "greaterThanEq",
|
|
30
|
+
"+": "add",
|
|
31
|
+
"-": "sub",
|
|
32
|
+
"*": "mul",
|
|
33
|
+
"/": "div",
|
|
34
|
+
"%": "mod",
|
|
35
|
+
"**": "pow",
|
|
36
|
+
"|": "or",
|
|
37
|
+
"&": "and",
|
|
38
|
+
"^": "xor",
|
|
39
|
+
">>": "shr",
|
|
40
|
+
">>>": "shr",
|
|
41
|
+
"<<": "shl",
|
|
42
|
+
"&&": "land",
|
|
43
|
+
"||": "or",
|
|
44
|
+
};
|
|
45
|
+
for (const key in operatorMap) {
|
|
46
|
+
const kind = operatorMap[key];
|
|
47
|
+
BaseValue.prototype[key] = function (scope, value) {
|
|
48
|
+
const [left, leftInst] = this.eval(scope);
|
|
49
|
+
const [right, rightInst] = value.eval(scope);
|
|
50
|
+
const temp = new _1.TempValue(scope);
|
|
51
|
+
return [
|
|
52
|
+
temp,
|
|
53
|
+
[
|
|
54
|
+
...leftInst,
|
|
55
|
+
...rightInst,
|
|
56
|
+
new instructions_1.OperationInstruction(kind, temp, left, right),
|
|
57
|
+
],
|
|
58
|
+
];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const unaryOperatorMap = {
|
|
62
|
+
"!": "not",
|
|
63
|
+
"~": "flip",
|
|
64
|
+
};
|
|
65
|
+
for (const key in unaryOperatorMap) {
|
|
66
|
+
const name = unaryOperatorMap[key];
|
|
67
|
+
BaseValue.prototype[key] = function (scope) {
|
|
68
|
+
const [that, inst] = this.eval(scope);
|
|
69
|
+
const temp = new _1.TempValue(scope);
|
|
70
|
+
return [temp, [...inst, new instructions_1.OperationInstruction(name, temp, that)]];
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const assignmentToBinary = {
|
|
74
|
+
"+=": "+",
|
|
75
|
+
"-=": "-",
|
|
76
|
+
"*=": "*",
|
|
77
|
+
"/=": "/",
|
|
78
|
+
"%=": "%",
|
|
79
|
+
"**=": "**",
|
|
80
|
+
"|=": "|",
|
|
81
|
+
"&=": "&",
|
|
82
|
+
"^=": "^",
|
|
83
|
+
">>=": ">>",
|
|
84
|
+
">>>=": ">>>",
|
|
85
|
+
"<<=": "<<",
|
|
86
|
+
"&&=": "&&",
|
|
87
|
+
"||=": "||",
|
|
88
|
+
};
|
|
89
|
+
for (const op in assignmentToBinary) {
|
|
90
|
+
BaseValue.prototype[op] = function (scope, value) {
|
|
91
|
+
const [opValue, opInst] = this[assignmentToBinary[op]](scope, value);
|
|
92
|
+
const [retValue, retInst] = this["="](scope, opValue);
|
|
93
|
+
return [retValue, [...opInst, ...retInst]];
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
for (const key of operators_1.updateOperators) {
|
|
97
|
+
BaseValue.prototype[key] = function (scope, prefix) {
|
|
98
|
+
let [ret, inst] = this.eval(scope);
|
|
99
|
+
if (!prefix) {
|
|
100
|
+
const temp = new _1.TempValue(scope);
|
|
101
|
+
const [tempValue, tempInst] = temp["="](scope, ret);
|
|
102
|
+
ret = tempValue;
|
|
103
|
+
inst.push(...tempInst);
|
|
104
|
+
}
|
|
105
|
+
const kind = key === "++" ? "+=" : "-=";
|
|
106
|
+
return [
|
|
107
|
+
ret,
|
|
108
|
+
[...inst, ...this[kind](scope, new _1.LiteralValue(scope, 1))[1]],
|
|
109
|
+
];
|
|
110
|
+
};
|
|
111
|
+
}
|
|
102
112
|
//# sourceMappingURL=BaseValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseValue.js","sourceRoot":"","sources":["../../src/values/BaseValue.ts"],"names":[],"mappings":";;;AAAA,kDAAuD;AACvD,4CAMsB;AAEtB,wBAAuD;AAEvD,MAAa,SAAU,SAAQ,YAAS;
|
|
1
|
+
{"version":3,"file":"BaseValue.js","sourceRoot":"","sources":["../../src/values/BaseValue.ts"],"names":[],"mappings":";;;AAAA,kDAAuD;AACvD,4CAMsB;AAEtB,wBAAuD;AAEvD,MAAa,SAAU,SAAQ,YAAS;IACtC,IAAI,CAAC,KAAa;QAChB,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CA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ue, IScope, IValue, TValueInstructions } from "../types";
|
|
3
|
-
import { StoreValue } from "./StoreValue";
|
|
4
|
-
import { VoidValue } from "./VoidValue";
|
|
5
|
-
export declare class FunctionValue extends VoidValue implements IFunctionValue {
|
|
6
|
-
constant: boolean;
|
|
7
|
-
macro: boolean;
|
|
8
|
-
private paramStores;
|
|
9
|
-
private paramNames;
|
|
10
|
-
private inst;
|
|
11
|
-
private addr;
|
|
12
|
-
private temp;
|
|
13
|
-
private ret;
|
|
14
|
-
private inline;
|
|
15
|
-
private tryingInline;
|
|
16
|
-
private body;
|
|
17
|
-
private name;
|
|
18
|
-
private c;
|
|
19
|
-
private callSize;
|
|
20
|
-
private inlineTemp;
|
|
21
|
-
private inlineEnd;
|
|
22
|
-
private bundled;
|
|
23
|
-
private createValues;
|
|
24
|
-
typeof(scope: IScope): TValueInstructions;
|
|
25
|
-
private createInst;
|
|
26
|
-
constructor(scope: IScope, name: string, paramNames: string[], paramStores: StoreValue[], body: es.BlockStatement, c: Compiler);
|
|
27
|
-
private normalReturn;
|
|
28
|
-
private normalCall;
|
|
29
|
-
private inlineReturn;
|
|
30
|
-
private inlineCall;
|
|
31
|
-
call(scope: IScope, args: IValue[]): TValueInstructions;
|
|
32
|
-
return(scope: IScope, arg: IValue): TValueInstructions;
|
|
33
|
-
eval(scope: IScope): TValueInstructions;
|
|
34
|
-
}
|
|
1
|
+
import { Compiler } from "../Compiler";
|
|
2
|
+
import { es, IFunctionValue, IScope, IValue, TValueInstructions } from "../types";
|
|
3
|
+
import { StoreValue } from "./StoreValue";
|
|
4
|
+
import { VoidValue } from "./VoidValue";
|
|
5
|
+
export declare class FunctionValue extends VoidValue implements IFunctionValue {
|
|
6
|
+
constant: boolean;
|
|
7
|
+
macro: boolean;
|
|
8
|
+
private paramStores;
|
|
9
|
+
private paramNames;
|
|
10
|
+
private inst;
|
|
11
|
+
private addr;
|
|
12
|
+
private temp;
|
|
13
|
+
private ret;
|
|
14
|
+
private inline;
|
|
15
|
+
private tryingInline;
|
|
16
|
+
private body;
|
|
17
|
+
private name;
|
|
18
|
+
private c;
|
|
19
|
+
private callSize;
|
|
20
|
+
private inlineTemp;
|
|
21
|
+
private inlineEnd;
|
|
22
|
+
private bundled;
|
|
23
|
+
private createValues;
|
|
24
|
+
typeof(scope: IScope): TValueInstructions;
|
|
25
|
+
private createInst;
|
|
26
|
+
constructor(scope: IScope, name: string, paramNames: string[], paramStores: StoreValue[], body: es.BlockStatement, c: Compiler);
|
|
27
|
+
private normalReturn;
|
|
28
|
+
private normalCall;
|
|
29
|
+
private inlineReturn;
|
|
30
|
+
private inlineCall;
|
|
31
|
+
call(scope: IScope, args: IValue[]): TValueInstructions;
|
|
32
|
+
return(scope: IScope, arg: IValue): TValueInstructions;
|
|
33
|
+
eval(scope: IScope): TValueInstructions;
|
|
34
|
+
}
|
|
@@ -1,101 +1,104 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FunctionValue = void 0;
|
|
4
|
-
const instructions_1 = require("../instructions");
|
|
5
|
-
const LiteralValue_1 = require("./LiteralValue");
|
|
6
|
-
const StoreValue_1 = require("./StoreValue");
|
|
7
|
-
const TempValue_1 = require("./TempValue");
|
|
8
|
-
const VoidValue_1 = require("./VoidValue");
|
|
9
|
-
class FunctionValue extends VoidValue_1.VoidValue {
|
|
10
|
-
constructor(scope, name, paramNames, paramStores, body, c) {
|
|
11
|
-
super(scope);
|
|
12
|
-
this.constant = true;
|
|
13
|
-
this.macro = true;
|
|
14
|
-
this.bundled = false;
|
|
15
|
-
this.name = name;
|
|
16
|
-
this.paramNames = paramNames;
|
|
17
|
-
this.paramStores = paramStores;
|
|
18
|
-
this.body = body;
|
|
19
|
-
this.c = c;
|
|
20
|
-
this.callSize = paramStores.length + 2;
|
|
21
|
-
scope.function = this;
|
|
22
|
-
this.createValues();
|
|
23
|
-
this.createInst();
|
|
24
|
-
}
|
|
25
|
-
createValues() {
|
|
26
|
-
this.addr = new LiteralValue_1.LiteralValue(this.scope, null);
|
|
27
|
-
this.temp = new StoreValue_1.StoreValue(this.scope, "f" + this.name);
|
|
28
|
-
this.ret = new StoreValue_1.StoreValue(this.scope, "r" + this.name);
|
|
29
|
-
}
|
|
30
|
-
typeof(scope) {
|
|
31
|
-
return [new LiteralValue_1.LiteralValue(scope, "function"), []];
|
|
32
|
-
}
|
|
33
|
-
createInst() {
|
|
34
|
-
this.inst = [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FunctionValue = void 0;
|
|
4
|
+
const instructions_1 = require("../instructions");
|
|
5
|
+
const LiteralValue_1 = require("./LiteralValue");
|
|
6
|
+
const StoreValue_1 = require("./StoreValue");
|
|
7
|
+
const TempValue_1 = require("./TempValue");
|
|
8
|
+
const VoidValue_1 = require("./VoidValue");
|
|
9
|
+
class FunctionValue extends VoidValue_1.VoidValue {
|
|
10
|
+
constructor(scope, name, paramNames, paramStores, body, c) {
|
|
11
|
+
super(scope);
|
|
12
|
+
this.constant = true;
|
|
13
|
+
this.macro = true;
|
|
14
|
+
this.bundled = false;
|
|
15
|
+
this.name = name;
|
|
16
|
+
this.paramNames = paramNames;
|
|
17
|
+
this.paramStores = paramStores;
|
|
18
|
+
this.body = body;
|
|
19
|
+
this.c = c;
|
|
20
|
+
this.callSize = paramStores.length + 2;
|
|
21
|
+
scope.function = this;
|
|
22
|
+
this.createValues();
|
|
23
|
+
this.createInst();
|
|
24
|
+
}
|
|
25
|
+
createValues() {
|
|
26
|
+
this.addr = new LiteralValue_1.LiteralValue(this.scope, null);
|
|
27
|
+
this.temp = new StoreValue_1.StoreValue(this.scope, "f" + this.name);
|
|
28
|
+
this.ret = new StoreValue_1.StoreValue(this.scope, "r" + this.name);
|
|
29
|
+
}
|
|
30
|
+
typeof(scope) {
|
|
31
|
+
return [new LiteralValue_1.LiteralValue(scope, "function"), []];
|
|
32
|
+
}
|
|
33
|
+
createInst() {
|
|
34
|
+
this.inst = [
|
|
35
|
+
new instructions_1.AddressResolver(this.addr),
|
|
36
|
+
...this.c.handle(this.scope, this.body)[1],
|
|
37
|
+
];
|
|
38
|
+
this.inst.push(new instructions_1.SetCounterInstruction(this.ret));
|
|
39
|
+
}
|
|
40
|
+
normalReturn(scope, arg) {
|
|
41
|
+
const argInst = arg ? this.temp["="](scope, arg)[1] : [];
|
|
42
|
+
return [null, [...argInst, new instructions_1.SetCounterInstruction(this.ret)]];
|
|
43
|
+
}
|
|
44
|
+
normalCall(scope, args) {
|
|
45
|
+
if (!this.bundled)
|
|
46
|
+
this.scope.inst.push(...this.inst);
|
|
47
|
+
this.bundled = true;
|
|
48
|
+
const callAddressLiteral = new LiteralValue_1.LiteralValue(scope, null);
|
|
49
|
+
const inst = this.paramStores
|
|
50
|
+
.map((param, i) => param["="](scope, args[i])[1])
|
|
51
|
+
.reduce((s, c) => s.concat(c), [])
|
|
52
|
+
.concat(...this.ret["="](scope, callAddressLiteral)[1], new instructions_1.JumpInstruction(this.addr, instructions_1.EJumpKind.Always), new instructions_1.AddressResolver(callAddressLiteral));
|
|
53
|
+
return [this.temp, inst];
|
|
54
|
+
}
|
|
55
|
+
inlineReturn(scope, arg) {
|
|
56
|
+
const argInst = arg ? this.inlineTemp["="](scope, arg)[1] : [];
|
|
57
|
+
return [null, [...argInst, new instructions_1.ReturnInstruction(this.inlineEnd)]];
|
|
58
|
+
}
|
|
59
|
+
inlineCall(scope, args) {
|
|
60
|
+
// create return value
|
|
61
|
+
this.inlineTemp = new TempValue_1.TempValue(scope);
|
|
62
|
+
this.inlineEnd = new LiteralValue_1.LiteralValue(scope, null);
|
|
63
|
+
// make a copy of the function scope
|
|
64
|
+
const fnScope = this.scope.copy();
|
|
65
|
+
// hard set variables within the function scope
|
|
66
|
+
this.paramNames.forEach((name, i) => fnScope.hardSet(name, args[i]));
|
|
67
|
+
this.tryingInline = true;
|
|
68
|
+
let inst = this.c.handle(fnScope, this.body)[1];
|
|
69
|
+
this.tryingInline = false;
|
|
70
|
+
// removing useless instruction
|
|
71
|
+
// get the last instructions
|
|
72
|
+
// const [jump] = inst.slice(-1);
|
|
73
|
+
// if (jump instanceof JumpInstruction) {
|
|
74
|
+
// // remove useless jump
|
|
75
|
+
// if (jump.args[1] === this.inlineEnd) inst.pop();
|
|
76
|
+
// }
|
|
77
|
+
inst.push(new instructions_1.AddressResolver(this.inlineEnd));
|
|
78
|
+
// return the function value
|
|
79
|
+
return [this.inlineTemp, inst];
|
|
80
|
+
}
|
|
81
|
+
call(scope, args) {
|
|
82
|
+
if (args.length !== this.paramStores.length)
|
|
83
|
+
throw new Error("Cannot call: argument count not matching.");
|
|
84
|
+
const inlineCall = this.inlineCall(scope, args);
|
|
85
|
+
const inlineSize = inlineCall[1].filter(i => !i.hidden).length;
|
|
86
|
+
if (this.inline || inlineSize <= this.callSize)
|
|
87
|
+
return inlineCall;
|
|
88
|
+
return this.normalCall(scope, args);
|
|
89
|
+
}
|
|
90
|
+
return(scope, arg) {
|
|
91
|
+
if (arg && arg.macro) {
|
|
92
|
+
this.inline = true;
|
|
93
|
+
return [null, []];
|
|
94
|
+
}
|
|
95
|
+
if (this.inline || this.tryingInline)
|
|
96
|
+
return this.inlineReturn(scope, arg);
|
|
97
|
+
return this.normalReturn(scope, arg);
|
|
98
|
+
}
|
|
99
|
+
eval(scope) {
|
|
100
|
+
return [this, []];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.FunctionValue = FunctionValue;
|
|
101
104
|
//# sourceMappingURL=FunctionValue.js.map
|