mlogjs 0.4.0 → 0.4.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/dist/index.cjs +359 -313
- package/dist/index.mjs +359 -313
- package/dist/macros/Asm.d.ts +1 -2
- package/dist/macros/Function.d.ts +2 -2
- package/dist/macros/GetGlobal.d.ts +2 -2
- package/dist/macros/Math.d.ts +1 -2
- package/dist/macros/Memory.d.ts +1 -2
- package/dist/macros/Namespace.d.ts +1 -1
- package/dist/macros/Other.d.ts +1 -2
- package/dist/macros/commands/ApplyStatus.d.ts +1 -2
- package/dist/macros/commands/Control.d.ts +1 -2
- package/dist/macros/commands/Cutscene.d.ts +1 -2
- package/dist/macros/commands/Draw.d.ts +1 -2
- package/dist/macros/commands/DrawFlush.d.ts +1 -2
- package/dist/macros/commands/End.d.ts +1 -2
- package/dist/macros/commands/Explosion.d.ts +1 -2
- package/dist/macros/commands/Fetch.d.ts +1 -2
- package/dist/macros/commands/FlushMessage.d.ts +1 -2
- package/dist/macros/commands/GetBlock.d.ts +1 -2
- package/dist/macros/commands/GetFlag.d.ts +1 -2
- package/dist/macros/commands/GetLink.d.ts +1 -2
- package/dist/macros/commands/Lookup.d.ts +1 -2
- package/dist/macros/commands/PackColor.d.ts +1 -2
- package/dist/macros/commands/Print.d.ts +1 -2
- package/dist/macros/commands/PrintFlush.d.ts +1 -2
- package/dist/macros/commands/Radar.d.ts +1 -2
- package/dist/macros/commands/Sensor.d.ts +1 -2
- package/dist/macros/commands/SetBlock.d.ts +1 -2
- package/dist/macros/commands/SetFlag.d.ts +1 -2
- package/dist/macros/commands/SetRate.d.ts +1 -2
- package/dist/macros/commands/SetRule.d.ts +1 -2
- package/dist/macros/commands/SpawnUnit.d.ts +1 -2
- package/dist/macros/commands/SpawnWave.d.ts +1 -2
- package/dist/macros/commands/Stop.d.ts +1 -2
- package/dist/macros/commands/UnitBind.d.ts +1 -2
- package/dist/macros/commands/UnitControl.d.ts +1 -2
- package/dist/macros/commands/UnitLocate.d.ts +1 -2
- package/dist/macros/commands/UnitRadar.d.ts +1 -2
- package/dist/macros/commands/Wait.d.ts +1 -2
- package/dist/macros/util.d.ts +2 -3
- package/dist/types.d.ts +0 -1
- package/dist/values/BaseValue.d.ts +1 -2
- package/dist/values/DestructuringValue.d.ts +1 -1
- package/dist/values/FunctionValue.d.ts +3 -4
- package/dist/values/LiteralValue.d.ts +3 -2
- package/dist/values/ObjectValue.d.ts +3 -3
- package/dist/values/StoreValue.d.ts +4 -2
- package/dist/values/VoidValue.d.ts +0 -2
- package/lib/commands.d.ts +6 -10
- package/package.json +2 -2
- package/dist/bin.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/types/Compiler.d.ts +0 -39
- package/dist/types/CompilerError.d.ts +0 -33
- package/dist/types/Scope.d.ts +0 -24
- package/dist/types/assertions.d.ts +0 -28
- package/dist/types/bin.d.ts +0 -1
- package/dist/types/handlers/BlockStatement.d.ts +0 -2
- package/dist/types/handlers/CallExpression.d.ts +0 -4
- package/dist/types/handlers/File.d.ts +0 -2
- package/dist/types/handlers/ForStatement.d.ts +0 -2
- package/dist/types/handlers/Function.d.ts +0 -5
- package/dist/types/handlers/Identifier.d.ts +0 -2
- package/dist/types/handlers/IfStatement.d.ts +0 -2
- package/dist/types/handlers/Literal.d.ts +0 -5
- package/dist/types/handlers/Object.d.ts +0 -6
- package/dist/types/handlers/OperationExpressions.d.ts +0 -8
- package/dist/types/handlers/Program.d.ts +0 -2
- package/dist/types/handlers/Statements.d.ts +0 -5
- package/dist/types/handlers/SwitchStatement.d.ts +0 -2
- package/dist/types/handlers/TemplateExpression.d.ts +0 -2
- package/dist/types/handlers/Typescript.d.ts +0 -7
- package/dist/types/handlers/VariableDeclaration.d.ts +0 -3
- package/dist/types/handlers/WhileStatement.d.ts +0 -3
- package/dist/types/handlers/index.d.ts +0 -17
- package/dist/types/index.d.ts +0 -3
- package/dist/types/initScope.d.ts +0 -5
- package/dist/types/instructions/AddressResolver.d.ts +0 -12
- package/dist/types/instructions/ControlInstructions.d.ts +0 -10
- package/dist/types/instructions/EndInstruction.d.ts +0 -4
- package/dist/types/instructions/InstructionBase.d.ts +0 -14
- package/dist/types/instructions/JumpInstruction.d.ts +0 -16
- package/dist/types/instructions/OperationInstruction.d.ts +0 -5
- package/dist/types/instructions/SetCounterInstruction.d.ts +0 -5
- package/dist/types/instructions/SetInstruction.d.ts +0 -6
- package/dist/types/instructions/ZeroSpaceInstruction.d.ts +0 -4
- package/dist/types/instructions/index.d.ts +0 -9
- package/dist/types/macros/Asm.d.ts +0 -5
- package/dist/types/macros/Function.d.ts +0 -13
- package/dist/types/macros/GetGlobal.d.ts +0 -5
- package/dist/types/macros/Math.d.ts +0 -5
- package/dist/types/macros/Memory.d.ts +0 -5
- package/dist/types/macros/Namespace.d.ts +0 -13
- package/dist/types/macros/Other.d.ts +0 -5
- package/dist/types/macros/commands/ApplyStatus.d.ts +0 -5
- package/dist/types/macros/commands/Control.d.ts +0 -5
- package/dist/types/macros/commands/Cutscene.d.ts +0 -5
- package/dist/types/macros/commands/Draw.d.ts +0 -5
- package/dist/types/macros/commands/DrawFlush.d.ts +0 -5
- package/dist/types/macros/commands/End.d.ts +0 -5
- package/dist/types/macros/commands/Explosion.d.ts +0 -5
- package/dist/types/macros/commands/Fetch.d.ts +0 -5
- package/dist/types/macros/commands/FlushMessage.d.ts +0 -5
- package/dist/types/macros/commands/GetBlock.d.ts +0 -5
- package/dist/types/macros/commands/GetFlag.d.ts +0 -5
- package/dist/types/macros/commands/GetLink.d.ts +0 -5
- package/dist/types/macros/commands/Lookup.d.ts +0 -5
- package/dist/types/macros/commands/PackColor.d.ts +0 -5
- package/dist/types/macros/commands/Print.d.ts +0 -5
- package/dist/types/macros/commands/PrintFlush.d.ts +0 -5
- package/dist/types/macros/commands/Radar.d.ts +0 -7
- package/dist/types/macros/commands/Sensor.d.ts +0 -5
- package/dist/types/macros/commands/SetBlock.d.ts +0 -5
- package/dist/types/macros/commands/SetFlag.d.ts +0 -5
- package/dist/types/macros/commands/SetRate.d.ts +0 -5
- package/dist/types/macros/commands/SetRule.d.ts +0 -5
- package/dist/types/macros/commands/SpawnUnit.d.ts +0 -5
- package/dist/types/macros/commands/SpawnWave.d.ts +0 -5
- package/dist/types/macros/commands/Stop.d.ts +0 -5
- package/dist/types/macros/commands/UnitBind.d.ts +0 -5
- package/dist/types/macros/commands/UnitControl.d.ts +0 -5
- package/dist/types/macros/commands/UnitLocate.d.ts +0 -5
- package/dist/types/macros/commands/UnitRadar.d.ts +0 -5
- package/dist/types/macros/commands/Wait.d.ts +0 -5
- package/dist/types/macros/commands/index.d.ts +0 -30
- package/dist/types/macros/index.d.ts +0 -6
- package/dist/types/macros/util.d.ts +0 -18
- package/dist/types/operators.d.ts +0 -25
- package/dist/types/types.d.ts +0 -238
- package/dist/types/utils.d.ts +0 -47
- package/dist/types/values/BaseValue.d.ts +0 -9
- package/dist/types/values/DestructuringValue.d.ts +0 -17
- package/dist/types/values/FunctionValue.d.ts +0 -47
- package/dist/types/values/LiteralValue.d.ts +0 -13
- package/dist/types/values/ObjectValue.d.ts +0 -23
- package/dist/types/values/SenseableValue.d.ts +0 -23
- package/dist/types/values/StoreValue.d.ts +0 -15
- package/dist/types/values/ValueOwner.d.ts +0 -27
- package/dist/types/values/VoidValue.d.ts +0 -16
- package/dist/types/values/index.d.ts +0 -7
package/dist/types/Scope.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SenseableValue } from "./values";
|
|
2
|
-
import { AddressResolver } from "./instructions";
|
|
3
|
-
import { IFunctionValue, IInstruction, IOwnedValue, IScope, IValue, IValueOwner } 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, IValueOwner | null>;
|
|
11
|
-
break: AddressResolver;
|
|
12
|
-
continue: AddressResolver;
|
|
13
|
-
function: IFunctionValue;
|
|
14
|
-
constructor(values: Record<string, IValueOwner | 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(identifier: string): boolean;
|
|
19
|
-
get(identifier: string): IOwnedValue;
|
|
20
|
-
set<T extends IValue>(...args: [name: string, value: T] | [owner: IValueOwner<T>]): T;
|
|
21
|
-
hardSet<T extends IValue>(...args: [name: string, value: T] | [owner: IValueOwner<T>]): T;
|
|
22
|
-
make(identifier: string, name: string): SenseableValue;
|
|
23
|
-
makeTempName(): string;
|
|
24
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IValue } from "./types";
|
|
2
|
-
import { LiteralValue, ObjectValue, StoreValue } from "./values";
|
|
3
|
-
/** Asserts that `value` is a `LiteralValue` that contains a string */
|
|
4
|
-
export declare function assertStringLiteral(value: IValue | undefined, name: string): asserts value is LiteralValue & {
|
|
5
|
-
data: string;
|
|
6
|
-
};
|
|
7
|
-
/** Asserts that `value` is a string literal that is part of a given set of `members`*/
|
|
8
|
-
export declare function assertLiteralOneOf<T extends readonly string[]>(value: IValue | undefined, members: T, name: string): asserts value is LiteralValue & {
|
|
9
|
-
data: T[number];
|
|
10
|
-
};
|
|
11
|
-
/** Asserts that `value` is either a store or a literal */
|
|
12
|
-
export declare function assertIsRuntimeValue(value: IValue | undefined, name: string): asserts value is LiteralValue | StoreValue;
|
|
13
|
-
/** Asserts that `value` is an `ObjectValue` */
|
|
14
|
-
export declare function assertIsObjectMacro(value: IValue | undefined, name: string): asserts value is ObjectValue;
|
|
15
|
-
/** Asserts that `value` is an `ObjectValue` that has a length property */
|
|
16
|
-
export declare function assertIsArrayMacro(value: IValue | undefined, name: string): asserts value is ObjectValue;
|
|
17
|
-
/** Helper type used to describe the overloads of a macro function. See {@link assertObjectFields} */
|
|
18
|
-
export declare type TOverloadDescriptor<K extends string> = Record<K, (string | IParameterDescriptor)[]>;
|
|
19
|
-
/** Describes an object destructuring paremeter. Generally used with `assertObjectFields` */
|
|
20
|
-
export interface IParameterDescriptor {
|
|
21
|
-
key: string;
|
|
22
|
-
name?: string;
|
|
23
|
-
default?: string;
|
|
24
|
-
/** Throw an error on invalid values */
|
|
25
|
-
validate?(value: IValue): void;
|
|
26
|
-
}
|
|
27
|
-
/** Asserts that all of the fields described are present on `value`*/
|
|
28
|
-
export declare function assertObjectFields(value: ObjectValue, fields: (string | IParameterDescriptor)[]): (IValue | string)[];
|
package/dist/types/bin.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const NumericLiteral: THandler<import("../types").IValue>;
|
|
3
|
-
export declare const StringLiteral: THandler<import("../types").IValue>;
|
|
4
|
-
export declare const NullLiteral: THandler;
|
|
5
|
-
export declare const BooleanLiteral: THandler;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const ObjectExpression: THandler;
|
|
3
|
-
export declare const ArrayExpression: THandler;
|
|
4
|
-
export declare const MemberExpression: THandler;
|
|
5
|
-
export declare const ArrayPattern: THandler;
|
|
6
|
-
export declare const ObjectPattern: THandler;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
8
|
-
export declare const ConditionalExpression: THandler;
|
|
@@ -1,5 +0,0 @@
|
|
|
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>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { THandler } from "../types";
|
|
2
|
-
export declare const TSAsExpression: THandler<import("../types").IValue>;
|
|
3
|
-
export declare const TSTypeAssertion: THandler<import("../types").IValue>;
|
|
4
|
-
export declare const TSInterfaceDeclaration: THandler<null>;
|
|
5
|
-
export declare const TSTypeAliasDeclaration: THandler<null>;
|
|
6
|
-
export declare const TSEnumDeclaration: THandler<null>;
|
|
7
|
-
export declare const TSNonNullExpression: THandler;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 "./SwitchStatement";
|
|
9
|
-
export * from "./WhileStatement";
|
|
10
|
-
export * from "./ForStatement";
|
|
11
|
-
export * from "./Function";
|
|
12
|
-
export * from "./CallExpression";
|
|
13
|
-
export * from "./Object";
|
|
14
|
-
export * from "./TemplateExpression";
|
|
15
|
-
export * from "./BlockStatement";
|
|
16
|
-
export * from "./File";
|
|
17
|
-
export * from "./Typescript";
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
1
|
-
import { EInstIntent, IBindableValue } from "../types";
|
|
2
|
-
import { JumpInstruction } from "./JumpInstruction";
|
|
3
|
-
export declare class BreakInstruction extends JumpInstruction {
|
|
4
|
-
intent: EInstIntent;
|
|
5
|
-
constructor(address: IBindableValue);
|
|
6
|
-
}
|
|
7
|
-
export declare class ContinueInstruction extends JumpInstruction {
|
|
8
|
-
intent: EInstIntent;
|
|
9
|
-
constructor(address: IBindableValue);
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SourceLocation } from "@babel/types";
|
|
2
|
-
import { EInstIntent, IInstruction, IValue } from "../types";
|
|
3
|
-
export declare class InstructionBase implements IInstruction {
|
|
4
|
-
intent: EInstIntent;
|
|
5
|
-
alwaysRuns: boolean;
|
|
6
|
-
protected _hidden: boolean;
|
|
7
|
-
get hidden(): boolean;
|
|
8
|
-
set hidden(value: boolean);
|
|
9
|
-
args: (string | IValue | null)[];
|
|
10
|
-
source?: SourceLocation;
|
|
11
|
-
constructor(...args: (string | IValue | null)[]);
|
|
12
|
-
resolve(_i: number): void;
|
|
13
|
-
toString(): string;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
address: IBindableValue;
|
|
15
|
-
constructor(address: IBindableValue, kind: EJumpKind, left?: IValue | null, right?: IValue | null);
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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,13 +0,0 @@
|
|
|
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
|
-
consume(_scope: IScope): TValueInstructions;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MacroFunction } from "..";
|
|
2
|
-
import { IScope } from "../../types";
|
|
3
|
-
export declare const validRadarFilters: readonly ["any", "enemy", "ally", "player", "attacker", "flying", "boss", "ground"];
|
|
4
|
-
export declare const validRadarSorts: readonly ["distance", "health", "shield", "armor", "maxHealth"];
|
|
5
|
-
export declare class Radar extends MacroFunction {
|
|
6
|
-
constructor(scope: IScope);
|
|
7
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export * from "./Draw";
|
|
2
|
-
export * from "./Print";
|
|
3
|
-
export * from "./PrintFlush";
|
|
4
|
-
export * from "./DrawFlush";
|
|
5
|
-
export * from "./GetBlock";
|
|
6
|
-
export * from "./GetLink";
|
|
7
|
-
export * from "./Control";
|
|
8
|
-
export { Radar } from "./Radar";
|
|
9
|
-
export * from "./Sensor";
|
|
10
|
-
export * from "./Wait";
|
|
11
|
-
export * from "./Lookup";
|
|
12
|
-
export * from "./PackColor";
|
|
13
|
-
export * from "./End";
|
|
14
|
-
export * from "./SetBlock";
|
|
15
|
-
export * from "./SpawnUnit";
|
|
16
|
-
export * from "./Stop";
|
|
17
|
-
export * from "./UnitBind";
|
|
18
|
-
export * from "./UnitControl";
|
|
19
|
-
export * from "./UnitRadar";
|
|
20
|
-
export * from "./UnitLocate";
|
|
21
|
-
export * from "./ApplyStatus";
|
|
22
|
-
export * from "./SpawnWave";
|
|
23
|
-
export * from "./SetRule";
|
|
24
|
-
export * from "./FlushMessage";
|
|
25
|
-
export * from "./Cutscene";
|
|
26
|
-
export * from "./Explosion";
|
|
27
|
-
export * from "./SetRate";
|
|
28
|
-
export * from "./Fetch";
|
|
29
|
-
export * from "./GetFlag";
|
|
30
|
-
export * from "./SetFlag";
|