mlogjs 0.1.11 → 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.
- package/LICENSE +21 -21
- package/README.md +68 -18
- package/build/bin.cjs +69 -0
- package/dist/bin.cjs +69 -0
- package/dist/index.cjs +1817 -0
- package/dist/index.mjs +1813 -0
- package/dist/types/Compiler.d.ts +18 -0
- package/{build → dist/types}/Scope.d.ts +8 -11
- package/dist/types/bin.d.ts +1 -0
- package/dist/types/handlers/BlockStatement.d.ts +2 -0
- package/dist/types/handlers/CallExpression.d.ts +3 -0
- package/dist/types/handlers/ForStatement.d.ts +2 -0
- package/{build → dist/types}/handlers/Function.d.ts +0 -0
- package/{build → dist/types}/handlers/Identifier.d.ts +0 -0
- package/dist/types/handlers/IfStatement.d.ts +2 -0
- package/{build → dist/types}/handlers/Literal.d.ts +0 -0
- package/{build → dist/types}/handlers/Object.d.ts +0 -0
- package/{build → dist/types}/handlers/OperationExpressions.d.ts +0 -0
- package/dist/types/handlers/Program.d.ts +2 -0
- package/dist/types/handlers/Statements.d.ts +5 -0
- package/dist/types/handlers/TemplateExpression.d.ts +2 -0
- package/dist/types/handlers/VariableDeclaration.d.ts +3 -0
- package/dist/types/handlers/WhileStatement.d.ts +2 -0
- package/{build → dist/types}/handlers/index.d.ts +0 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/initScope.d.ts +2 -0
- package/{build → dist/types}/instructions/AddressResolver.d.ts +1 -1
- package/{build → dist/types}/instructions/ControlInstructions.d.ts +0 -0
- package/{build → dist/types}/instructions/EndInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/InstructionBase.d.ts +2 -2
- package/{build → dist/types}/instructions/JumpInstruction.d.ts +1 -1
- package/{build → dist/types}/instructions/OperationInstruction.d.ts +1 -1
- package/{build → dist/types}/instructions/SetCounterInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/SetInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/ZeroSpaceInstruction.d.ts +0 -0
- package/{build → dist/types}/instructions/index.d.ts +0 -0
- package/dist/types/macros/Building.d.ts +11 -0
- package/dist/types/macros/Function.d.ts +12 -0
- package/{build → dist/types}/macros/Math.d.ts +0 -0
- package/{build/macros/Blocks.d.ts → dist/types/macros/Memory.d.ts} +1 -1
- package/dist/types/macros/Namespace.d.ts +21 -0
- package/{build/macros/Draw.d.ts → dist/types/macros/Other.d.ts} +1 -1
- package/dist/types/macros/RawValue.d.ts +5 -0
- package/dist/types/macros/commands/Control.d.ts +5 -0
- package/dist/types/macros/commands/Draw.d.ts +5 -0
- package/dist/types/macros/commands/DrawFlush.d.ts +5 -0
- package/dist/types/macros/commands/GetLink.d.ts +5 -0
- package/dist/types/macros/commands/Lookup.d.ts +5 -0
- package/dist/types/macros/commands/Print.d.ts +5 -0
- package/dist/types/macros/commands/PrintFlush.d.ts +5 -0
- package/dist/types/macros/commands/Radar.d.ts +7 -0
- package/dist/types/macros/commands/Sensor.d.ts +5 -0
- package/dist/types/macros/commands/UnitBind.d.ts +5 -0
- package/dist/types/macros/commands/UnitControl.d.ts +5 -0
- package/dist/types/macros/commands/UnitLocate.d.ts +5 -0
- package/dist/types/macros/commands/UnitRadar.d.ts +5 -0
- package/dist/types/macros/commands/Wait.d.ts +5 -0
- package/dist/types/macros/commands/index.d.ts +14 -0
- package/dist/types/macros/index.d.ts +7 -0
- package/{build → dist/types}/operators.d.ts +3 -0
- package/dist/types/types.d.ts +100 -0
- package/{build → dist/types}/utils.d.ts +1 -0
- package/{build → dist/types}/values/BaseValue.d.ts +0 -0
- package/{build → dist/types}/values/FunctionValue.d.ts +1 -1
- package/{build → dist/types}/values/LiteralValue.d.ts +0 -0
- package/dist/types/values/ObjectValue.d.ts +19 -0
- package/{build → dist/types}/values/StoreValue.d.ts +0 -0
- package/{build → dist/types}/values/TempValue.d.ts +0 -0
- package/{build → dist/types}/values/VoidValue.d.ts +3 -1
- package/{build → dist/types}/values/index.d.ts +0 -0
- package/{docs → doc}/README.md +9 -17
- 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 +120 -0
- package/lib/util.d.ts +32 -0
- package/package.json +63 -37
- package/.gitattributes +0 -2
- package/build/Compiler.d.ts +0 -18
- package/build/Compiler.js +0 -93
- package/build/Compiler.js.map +0 -1
- package/build/Scope.js +0 -61
- package/build/Scope.js.map +0 -1
- package/build/bin.d.ts +0 -2
- package/build/bin.js +0 -35
- package/build/bin.js.map +0 -1
- package/build/handlers/BlockStatement.d.ts +0 -2
- package/build/handlers/BlockStatement.js +0 -14
- package/build/handlers/BlockStatement.js.map +0 -1
- package/build/handlers/CallExpression.d.ts +0 -3
- package/build/handlers/CallExpression.js +0 -20
- package/build/handlers/CallExpression.js.map +0 -1
- package/build/handlers/ForStatement.d.ts +0 -2
- package/build/handlers/ForStatement.js +0 -32
- package/build/handlers/ForStatement.js.map +0 -1
- package/build/handlers/Function.js +0 -33
- package/build/handlers/Function.js.map +0 -1
- package/build/handlers/Identifier.js +0 -8
- package/build/handlers/Identifier.js.map +0 -1
- package/build/handlers/IfStatement.d.ts +0 -2
- package/build/handlers/IfStatement.js +0 -25
- package/build/handlers/IfStatement.js.map +0 -1
- package/build/handlers/Literal.js +0 -16
- package/build/handlers/Literal.js.map +0 -1
- package/build/handlers/Object.js +0 -44
- package/build/handlers/Object.js.map +0 -1
- package/build/handlers/OperationExpressions.js +0 -32
- package/build/handlers/OperationExpressions.js.map +0 -1
- package/build/handlers/Program.d.ts +0 -2
- package/build/handlers/Program.js +0 -9
- package/build/handlers/Program.js.map +0 -1
- package/build/handlers/Statements.d.ts +0 -5
- package/build/handlers/Statements.js +0 -28
- package/build/handlers/Statements.js.map +0 -1
- package/build/handlers/TemplateExpression.d.ts +0 -2
- package/build/handlers/TemplateExpression.js +0 -18
- package/build/handlers/TemplateExpression.js.map +0 -1
- package/build/handlers/VariableDeclaration.d.ts +0 -3
- package/build/handlers/VariableDeclaration.js +0 -32
- package/build/handlers/VariableDeclaration.js.map +0 -1
- package/build/handlers/WhileStatement.d.ts +0 -2
- package/build/handlers/WhileStatement.js +0 -23
- package/build/handlers/WhileStatement.js.map +0 -1
- package/build/handlers/index.js +0 -27
- package/build/handlers/index.js.map +0 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -8
- package/build/index.js.map +0 -1
- package/build/instructions/AddressResolver.js +0 -32
- package/build/instructions/AddressResolver.js.map +0 -1
- package/build/instructions/ControlInstructions.js +0 -23
- package/build/instructions/ControlInstructions.js.map +0 -1
- package/build/instructions/EndInstruction.js +0 -11
- package/build/instructions/EndInstruction.js.map +0 -1
- package/build/instructions/InstructionBase.js +0 -21
- package/build/instructions/InstructionBase.js.map +0 -1
- package/build/instructions/JumpInstruction.js +0 -22
- package/build/instructions/JumpInstruction.js.map +0 -1
- package/build/instructions/OperationInstruction.js +0 -11
- package/build/instructions/OperationInstruction.js.map +0 -1
- package/build/instructions/SetCounterInstruction.js +0 -11
- package/build/instructions/SetCounterInstruction.js.map +0 -1
- package/build/instructions/SetInstruction.js +0 -11
- package/build/instructions/SetInstruction.js.map +0 -1
- package/build/instructions/ZeroSpaceInstruction.js +0 -11
- package/build/instructions/ZeroSpaceInstruction.js.map +0 -1
- package/build/instructions/index.js +0 -22
- package/build/instructions/index.js.map +0 -1
- package/build/macros/Blocks.js +0 -137
- package/build/macros/Blocks.js.map +0 -1
- package/build/macros/Draw.js +0 -34
- package/build/macros/Draw.js.map +0 -1
- package/build/macros/Function.d.ts +0 -12
- package/build/macros/Function.js +0 -20
- package/build/macros/Function.js.map +0 -1
- package/build/macros/Math.js +0 -57
- package/build/macros/Math.js.map +0 -1
- package/build/macros/Other.d.ts +0 -8
- package/build/macros/Other.js +0 -29
- package/build/macros/Other.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/index.d.ts +0 -5
- package/build/macros/index.js +0 -18
- package/build/macros/index.js.map +0 -1
- package/build/operators.js +0 -39
- package/build/operators.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/build/types.d.ts +0 -49
- package/build/types.js +0 -24
- package/build/types.js.map +0 -1
- package/build/utils.js +0 -9
- package/build/utils.js.map +0 -1
- package/build/values/BaseValue.js +0 -102
- package/build/values/BaseValue.js.map +0 -1
- package/build/values/FunctionValue.js +0 -101
- package/build/values/FunctionValue.js.map +0 -1
- package/build/values/LiteralValue.js +0 -89
- package/build/values/LiteralValue.js.map +0 -1
- package/build/values/ObjectValue.d.ts +0 -17
- package/build/values/ObjectValue.js +0 -50
- package/build/values/ObjectValue.js.map +0 -1
- package/build/values/StoreValue.js +0 -31
- package/build/values/StoreValue.js.map +0 -1
- package/build/values/TempValue.js +0 -53
- package/build/values/TempValue.js.map +0 -1
- package/build/values/VoidValue.js +0 -31
- package/build/values/VoidValue.js.map +0 -1
- package/build/values/index.js +0 -19
- package/build/values/index.js.map +0 -1
- package/dist/bundle.js +0 -553
- package/docs/.nojekyll +0 -0
- 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/docs/.nojekyll
DELETED
|
File without changes
|
package/docs/_coverpage.md
DELETED
package/docs/_sidebar.md
DELETED
package/docs/data-types.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Data Types
|
|
2
|
-
|
|
3
|
-
There are a total of four different data types:
|
|
4
|
-
|
|
5
|
-
- Literal
|
|
6
|
-
- Stora
|
|
7
|
-
- Function
|
|
8
|
-
- Object
|
|
9
|
-
|
|
10
|
-
## Literal
|
|
11
|
-
|
|
12
|
-
Literal values are the raw values that you write directly. They are constant strings or numbers.
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
123 // is a literal
|
|
16
|
-
const a = 123 // is a literal as well
|
|
17
|
-
const b = "some string" // string literal
|
|
18
|
-
typeof a === "literal" // true
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Store
|
|
22
|
-
|
|
23
|
-
Store values are the registers in the game inside a processor. They are mutable.
|
|
24
|
-
|
|
25
|
-
```js
|
|
26
|
-
let a = 123 // is a store number
|
|
27
|
-
let b = "string" // is a store string
|
|
28
|
-
typeof b === "store" // true
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Function
|
|
32
|
-
|
|
33
|
-
Function values are constants.
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
function add(a,b) {
|
|
37
|
-
return a + b
|
|
38
|
-
}
|
|
39
|
-
typeof add === "function" // true
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Object
|
|
43
|
-
|
|
44
|
-
Object values are constants and support operator overriding.
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
const obj = {
|
|
48
|
-
a: 1,
|
|
49
|
-
b: (a,b) => a + b,
|
|
50
|
-
$call: (a,b) => a * b,
|
|
51
|
-
}
|
|
52
|
-
obj.a // 1
|
|
53
|
-
obj.b(1,2) // 3
|
|
54
|
-
obj(2,2) // 4
|
|
55
|
-
typeof obj === "object" // true
|
|
56
|
-
```
|
package/docs/getting-started.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Getting started.
|
|
2
|
-
|
|
3
|
-
## How to use it?
|
|
4
|
-
|
|
5
|
-
You can use it through the online version, the Discord bot, or the command-line interface tool.
|
|
6
|
-
|
|
7
|
-
## CLI installation
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
npm i -g mlogjs
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Web version
|
|
14
|
-
|
|
15
|
-
https://weisrc.github.io/mlogjs-web-editor/
|
|
16
|
-
|
|
17
|
-
## Discord bot
|
|
18
|
-
|
|
19
|
-
Coming soon!
|
package/docs/index.html
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<title>Document</title>
|
|
7
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
8
|
-
<meta name="description" content="Description" />
|
|
9
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
|
|
10
|
-
<link rel="stylesheet"
|
|
11
|
-
href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css" />
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
<div id="app"></div>
|
|
18
|
-
<script src="//cdn.jsdelivr.net/npm/docsify-edit-on-github"></script>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
window.$docsify = {
|
|
22
|
-
plugins: [EditOnGithubPlugin.create("https://github.com/str1z/mlogcc/tree/main/docs/")],
|
|
23
|
-
name: "MlogJS",
|
|
24
|
-
repo: "https://github.com/str1z/mlogcc",
|
|
25
|
-
coverpage: true,
|
|
26
|
-
loadSidebar: true,
|
|
27
|
-
subMaxLevel: 3,
|
|
28
|
-
copyCode: {
|
|
29
|
-
buttonText: "Copy",
|
|
30
|
-
errorText: "Error",
|
|
31
|
-
successText: "Copied",
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
</script>
|
|
35
|
-
<!-- Docsify v4 -->
|
|
36
|
-
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
|
|
37
|
-
<script src="https://unpkg.com/docsify-copy-code@2"></script>
|
|
38
|
-
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
|
39
|
-
</body>
|
|
40
|
-
|
|
41
|
-
</html>
|
package/docs/mlogjs.png
DELETED
|
Binary file
|
package/mlogjs.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
declare type TTarget =
|
|
2
|
-
| "any"
|
|
3
|
-
| "enemy"
|
|
4
|
-
| "ally"
|
|
5
|
-
| "player"
|
|
6
|
-
| "attacker"
|
|
7
|
-
| "flying"
|
|
8
|
-
| "boss"
|
|
9
|
-
| "ground";
|
|
10
|
-
|
|
11
|
-
declare class Block {
|
|
12
|
-
constructor(name: string);
|
|
13
|
-
write(i: number, value: number): number;
|
|
14
|
-
read(i: number): number;
|
|
15
|
-
printFlush(): void;
|
|
16
|
-
drawFlush(): void;
|
|
17
|
-
puts(...values: (number | string)[]): void;
|
|
18
|
-
sensor(attr: string): number | boolean;
|
|
19
|
-
control(attr: "enabled" | "shoot" | "shootp" | "configure" | "color", ...args: number[]): void;
|
|
20
|
-
radar(
|
|
21
|
-
target0: TTarget,
|
|
22
|
-
target1: TTarget,
|
|
23
|
-
target2: TTarget,
|
|
24
|
-
sort: "distance" | "health" | "shield" | "armor" | "maxHealth",
|
|
25
|
-
distance: number
|
|
26
|
-
): any;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare class Store {
|
|
30
|
-
constructor(name: string);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare class Temp {}
|
|
34
|
-
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
declare const Math = {
|
|
37
|
-
max: (a: number, b: number) => Math.max(a, b),
|
|
38
|
-
min: (a: number, b: number) => Math.min(a, b),
|
|
39
|
-
angle: (a: number, b: number) => Math.atan2(a, b),
|
|
40
|
-
len: (a: number, b: number) => Math.sqrt(a ** 2 + b ** 2),
|
|
41
|
-
noise: (x: any, y: any) => x + y,
|
|
42
|
-
abs: (a: number) => Math.abs(a),
|
|
43
|
-
log: (a: number) => Math.log(a),
|
|
44
|
-
log10: (a: number) => Math.log(a) / Math.log(10),
|
|
45
|
-
sin: (a: number) => Math.sin(a),
|
|
46
|
-
cos: (a: number) => Math.cos(a),
|
|
47
|
-
tan: (a: number) => Math.tan(a),
|
|
48
|
-
floor: (a: number) => Math.floor(a),
|
|
49
|
-
ceil: (a: number) => Math.ceil(a),
|
|
50
|
-
sqrt: (a: number) => Math.ceil(a),
|
|
51
|
-
rand: (range: number) => Math.random() * range,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
declare function draw(
|
|
55
|
-
kind:
|
|
56
|
-
| "clear"
|
|
57
|
-
| "color"
|
|
58
|
-
| "stroke"
|
|
59
|
-
| "line"
|
|
60
|
-
| "rect"
|
|
61
|
-
| "lineRect"
|
|
62
|
-
| "poly"
|
|
63
|
-
| "linePoly"
|
|
64
|
-
| "triangle"
|
|
65
|
-
| "image",
|
|
66
|
-
...args: any
|
|
67
|
-
): void;
|
|
68
|
-
|
|
69
|
-
declare function print(...values: any): void;
|
|
70
|
-
declare function concat(...values: string[]): string;
|
|
71
|
-
|
|
72
|
-
declare class Entity extends Block {}
|
package/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"target": "es6",
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"outDir": "build",
|
|
11
|
-
"baseUrl": ".",
|
|
12
|
-
"paths": {
|
|
13
|
-
"*": [
|
|
14
|
-
"node_modules/*",
|
|
15
|
-
"src/types/*"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"include": [
|
|
20
|
-
"src/**/*"
|
|
21
|
-
]
|
|
22
|
-
}
|
package/webpack.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
entry: './src/index.ts',
|
|
5
|
-
module: {
|
|
6
|
-
rules: [
|
|
7
|
-
{
|
|
8
|
-
test: /\.tsx?$/,
|
|
9
|
-
use: 'ts-loader',
|
|
10
|
-
exclude: /node_modules/,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
},
|
|
14
|
-
output: {
|
|
15
|
-
path: path.resolve(__dirname, 'dist'),
|
|
16
|
-
filename: 'bundle.js',
|
|
17
|
-
library: "mlogcc"
|
|
18
|
-
},
|
|
19
|
-
resolve: {
|
|
20
|
-
extensions: ['.ts', '.js'],
|
|
21
|
-
},
|
|
22
|
-
};
|