greybel-interpreter 3.5.0 → 4.0.0
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/byte-compiler/instruction.d.ts +129 -0
- package/dist/byte-compiler/instruction.js +60 -0
- package/dist/bytecode-generator.d.ts +61 -0
- package/dist/bytecode-generator.js +1165 -0
- package/dist/context.d.ts +20 -88
- package/dist/context.js +44 -273
- package/dist/index.d.ts +5 -29
- package/dist/index.js +14 -87
- package/dist/interpreter.d.ts +9 -11
- package/dist/interpreter.js +75 -87
- package/dist/types/function.d.ts +11 -25
- package/dist/types/function.js +41 -105
- package/dist/types/list.d.ts +4 -5
- package/dist/types/list.js +10 -52
- package/dist/types/map.d.ts +5 -6
- package/dist/types/map.js +15 -74
- package/dist/types/number.d.ts +4 -5
- package/dist/types/number.js +5 -12
- package/dist/types/string.d.ts +4 -5
- package/dist/types/string.js +6 -18
- package/dist/types/with-intrinsics.d.ts +4 -5
- package/dist/utils/error.d.ts +5 -5
- package/dist/utils/error.js +4 -5
- package/dist/utils/stack.d.ts +10 -0
- package/dist/utils/stack.js +30 -0
- package/dist/vm/evaluation.d.ts +26 -0
- package/dist/vm/evaluation.js +341 -0
- package/dist/vm.d.ts +66 -0
- package/dist/vm.js +662 -0
- package/package.json +1 -1
- package/dist/cps.d.ts +0 -16
- package/dist/cps.js +0 -202
- package/dist/operations/assign-globals.d.ts +0 -11
- package/dist/operations/assign-globals.js +0 -31
- package/dist/operations/assign-locals.d.ts +0 -11
- package/dist/operations/assign-locals.js +0 -31
- package/dist/operations/assign-outer.d.ts +0 -11
- package/dist/operations/assign-outer.js +0 -31
- package/dist/operations/assign-self.d.ts +0 -11
- package/dist/operations/assign-self.js +0 -41
- package/dist/operations/assign.d.ts +0 -13
- package/dist/operations/assign.js +0 -60
- package/dist/operations/block.d.ts +0 -13
- package/dist/operations/block.js +0 -48
- package/dist/operations/break.d.ts +0 -10
- package/dist/operations/break.js +0 -21
- package/dist/operations/call.d.ts +0 -13
- package/dist/operations/call.js +0 -64
- package/dist/operations/chunk.d.ts +0 -12
- package/dist/operations/chunk.js +0 -31
- package/dist/operations/continue.d.ts +0 -10
- package/dist/operations/continue.js +0 -21
- package/dist/operations/debugger-statement.d.ts +0 -10
- package/dist/operations/debugger-statement.js +0 -19
- package/dist/operations/envar.d.ts +0 -10
- package/dist/operations/envar.js +0 -21
- package/dist/operations/evaluate.d.ts +0 -45
- package/dist/operations/evaluate.js +0 -369
- package/dist/operations/for.d.ts +0 -14
- package/dist/operations/for.js +0 -87
- package/dist/operations/function-reference.d.ts +0 -12
- package/dist/operations/function-reference.js +0 -48
- package/dist/operations/function.d.ts +0 -19
- package/dist/operations/function.js +0 -84
- package/dist/operations/if-statement.d.ts +0 -19
- package/dist/operations/if-statement.js +0 -87
- package/dist/operations/import.d.ts +0 -20
- package/dist/operations/import.js +0 -56
- package/dist/operations/include.d.ts +0 -14
- package/dist/operations/include.js +0 -40
- package/dist/operations/list.d.ts +0 -11
- package/dist/operations/list.js +0 -40
- package/dist/operations/literal.d.ts +0 -11
- package/dist/operations/literal.js +0 -38
- package/dist/operations/map.d.ts +0 -11
- package/dist/operations/map.js +0 -42
- package/dist/operations/negated-binary.d.ts +0 -11
- package/dist/operations/negated-binary.js +0 -40
- package/dist/operations/new-instance.d.ts +0 -11
- package/dist/operations/new-instance.js +0 -37
- package/dist/operations/noop.d.ts +0 -7
- package/dist/operations/noop.js +0 -14
- package/dist/operations/not.d.ts +0 -11
- package/dist/operations/not.js +0 -33
- package/dist/operations/operation.d.ts +0 -15
- package/dist/operations/operation.js +0 -13
- package/dist/operations/reference-globals.d.ts +0 -7
- package/dist/operations/reference-globals.js +0 -13
- package/dist/operations/reference-locals.d.ts +0 -7
- package/dist/operations/reference-locals.js +0 -13
- package/dist/operations/reference-outer.d.ts +0 -7
- package/dist/operations/reference-outer.js +0 -13
- package/dist/operations/reference-self.d.ts +0 -7
- package/dist/operations/reference-self.js +0 -13
- package/dist/operations/reference.d.ts +0 -9
- package/dist/operations/reference.js +0 -17
- package/dist/operations/resolve-globals.d.ts +0 -5
- package/dist/operations/resolve-globals.js +0 -24
- package/dist/operations/resolve-locals.d.ts +0 -5
- package/dist/operations/resolve-locals.js +0 -24
- package/dist/operations/resolve-outer.d.ts +0 -5
- package/dist/operations/resolve-outer.js +0 -24
- package/dist/operations/resolve-self.d.ts +0 -5
- package/dist/operations/resolve-self.js +0 -24
- package/dist/operations/resolve.d.ts +0 -55
- package/dist/operations/resolve.js +0 -269
- package/dist/operations/return.d.ts +0 -11
- package/dist/operations/return.js +0 -43
- package/dist/operations/while.d.ts +0 -13
- package/dist/operations/while.js +0 -70
- package/dist/utils/create-assign.d.ts +0 -3
- package/dist/utils/create-assign.js +0 -25
- package/dist/utils/create-resolve.d.ts +0 -5
- package/dist/utils/create-resolve.js +0 -51
- package/dist/utils/path.d.ts +0 -10
- package/dist/utils/path.js +0 -33
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
import { CustomValue } from '../types/base';
|
|
3
|
-
import { CPSVisit, Operation } from './operation';
|
|
4
|
-
export declare class Noop extends Operation {
|
|
5
|
-
build(_visit: CPSVisit): Promise<Operation>;
|
|
6
|
-
handle(_ctx: OperationContext): Promise<CustomValue>;
|
|
7
|
-
}
|
package/dist/operations/noop.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Noop = void 0;
|
|
4
|
-
const default_1 = require("../types/default");
|
|
5
|
-
const operation_1 = require("./operation");
|
|
6
|
-
class Noop extends operation_1.Operation {
|
|
7
|
-
build(_visit) {
|
|
8
|
-
return Promise.resolve(this);
|
|
9
|
-
}
|
|
10
|
-
handle(_ctx) {
|
|
11
|
-
return Promise.resolve(default_1.DefaultType.Void);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.Noop = Noop;
|
package/dist/operations/not.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ASTUnaryExpression } from 'miniscript-core';
|
|
2
|
-
import { OperationContext } from '../context';
|
|
3
|
-
import { CustomValue } from '../types/base';
|
|
4
|
-
import { CPSVisit, Operation } from './operation';
|
|
5
|
-
export declare class Not extends Operation {
|
|
6
|
-
readonly item: ASTUnaryExpression;
|
|
7
|
-
arg: Operation;
|
|
8
|
-
constructor(item: ASTUnaryExpression, target?: string);
|
|
9
|
-
build(visit: CPSVisit): Promise<Operation>;
|
|
10
|
-
handle(ctx: OperationContext): Promise<CustomValue>;
|
|
11
|
-
}
|
package/dist/operations/not.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Not = void 0;
|
|
13
|
-
const boolean_1 = require("../types/boolean");
|
|
14
|
-
const operation_1 = require("./operation");
|
|
15
|
-
class Not extends operation_1.Operation {
|
|
16
|
-
constructor(item, target) {
|
|
17
|
-
super(null, target);
|
|
18
|
-
this.item = item;
|
|
19
|
-
}
|
|
20
|
-
build(visit) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
this.arg = yield visit(this.item.argument);
|
|
23
|
-
return this;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
handle(ctx) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const result = yield this.arg.handle(ctx);
|
|
29
|
-
return new boolean_1.CustomBoolean(!result.toTruthy());
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.Not = Not;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ASTBase } from 'miniscript-core';
|
|
2
|
-
import { OperationContext } from '../context';
|
|
3
|
-
import { CustomValue } from '../types/base';
|
|
4
|
-
export interface CPSVisit {
|
|
5
|
-
(item: ASTBase): Promise<Operation>;
|
|
6
|
-
}
|
|
7
|
-
export declare abstract class Operation {
|
|
8
|
-
readonly item: ASTBase;
|
|
9
|
-
readonly target: string;
|
|
10
|
-
constructor(item: ASTBase, target?: string);
|
|
11
|
-
abstract build(visit: CPSVisit): Promise<Operation>;
|
|
12
|
-
abstract handle(ctx: OperationContext): Promise<CustomValue>;
|
|
13
|
-
}
|
|
14
|
-
export declare abstract class OperationBlock extends Operation {
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OperationBlock = exports.Operation = void 0;
|
|
4
|
-
class Operation {
|
|
5
|
-
constructor(item, target = null) {
|
|
6
|
-
this.item = item;
|
|
7
|
-
this.target = target;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Operation = Operation;
|
|
11
|
-
class OperationBlock extends Operation {
|
|
12
|
-
}
|
|
13
|
-
exports.OperationBlock = OperationBlock;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
import { CustomValue } from '../types/base';
|
|
3
|
-
import { CPSVisit, Operation } from './operation';
|
|
4
|
-
export declare class ReferenceGlobals extends Operation {
|
|
5
|
-
build(_visit: CPSVisit): Promise<ReferenceGlobals>;
|
|
6
|
-
handle(ctx: OperationContext): Promise<CustomValue>;
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReferenceGlobals = void 0;
|
|
4
|
-
const operation_1 = require("./operation");
|
|
5
|
-
class ReferenceGlobals extends operation_1.Operation {
|
|
6
|
-
build(_visit) {
|
|
7
|
-
return Promise.resolve(this);
|
|
8
|
-
}
|
|
9
|
-
handle(ctx) {
|
|
10
|
-
return Promise.resolve(ctx.globals.scope);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ReferenceGlobals = ReferenceGlobals;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
import { CustomValue } from '../types/base';
|
|
3
|
-
import { CPSVisit, Operation } from './operation';
|
|
4
|
-
export declare class ReferenceLocals extends Operation {
|
|
5
|
-
build(_visit: CPSVisit): Promise<ReferenceLocals>;
|
|
6
|
-
handle(ctx: OperationContext): Promise<CustomValue>;
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReferenceLocals = void 0;
|
|
4
|
-
const operation_1 = require("./operation");
|
|
5
|
-
class ReferenceLocals extends operation_1.Operation {
|
|
6
|
-
build(_visit) {
|
|
7
|
-
return Promise.resolve(this);
|
|
8
|
-
}
|
|
9
|
-
handle(ctx) {
|
|
10
|
-
return Promise.resolve(ctx.locals.scope);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ReferenceLocals = ReferenceLocals;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
import { CustomValue } from '../types/base';
|
|
3
|
-
import { CPSVisit, Operation } from './operation';
|
|
4
|
-
export declare class ReferenceOuter extends Operation {
|
|
5
|
-
build(_visit: CPSVisit): Promise<ReferenceOuter>;
|
|
6
|
-
handle(ctx: OperationContext): Promise<CustomValue>;
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReferenceOuter = void 0;
|
|
4
|
-
const operation_1 = require("./operation");
|
|
5
|
-
class ReferenceOuter extends operation_1.Operation {
|
|
6
|
-
build(_visit) {
|
|
7
|
-
return Promise.resolve(this);
|
|
8
|
-
}
|
|
9
|
-
handle(ctx) {
|
|
10
|
-
return Promise.resolve(ctx.outer.scope);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ReferenceOuter = ReferenceOuter;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
import { CustomValue } from '../types/base';
|
|
3
|
-
import { CPSVisit, Operation } from './operation';
|
|
4
|
-
export declare class ReferenceSelf extends Operation {
|
|
5
|
-
build(_visit: CPSVisit): Promise<ReferenceSelf>;
|
|
6
|
-
handle(ctx: OperationContext): Promise<CustomValue>;
|
|
7
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReferenceSelf = void 0;
|
|
4
|
-
const operation_1 = require("./operation");
|
|
5
|
-
class ReferenceSelf extends operation_1.Operation {
|
|
6
|
-
build(_visit) {
|
|
7
|
-
return Promise.resolve(this);
|
|
8
|
-
}
|
|
9
|
-
handle(ctx) {
|
|
10
|
-
return Promise.resolve(ctx.functionState.context);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ReferenceSelf = ReferenceSelf;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OperationContext } from '../context';
|
|
2
|
-
import { CustomValue } from '../types/base';
|
|
3
|
-
import { CPSVisit, Operation } from './operation';
|
|
4
|
-
export declare class Reference extends Operation {
|
|
5
|
-
readonly value: CustomValue;
|
|
6
|
-
constructor(value: CustomValue);
|
|
7
|
-
build(_visit: CPSVisit): Promise<Reference>;
|
|
8
|
-
handle(_ctx: OperationContext): Promise<CustomValue>;
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Reference = void 0;
|
|
4
|
-
const operation_1 = require("./operation");
|
|
5
|
-
class Reference extends operation_1.Operation {
|
|
6
|
-
constructor(value) {
|
|
7
|
-
super(null, 'native');
|
|
8
|
-
this.value = value;
|
|
9
|
-
}
|
|
10
|
-
build(_visit) {
|
|
11
|
-
return Promise.resolve(this);
|
|
12
|
-
}
|
|
13
|
-
handle(_ctx) {
|
|
14
|
-
return Promise.resolve(this.value);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.Reference = Reference;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ResolveGlobals = void 0;
|
|
13
|
-
const resolve_1 = require("./resolve");
|
|
14
|
-
class ResolveGlobals extends resolve_1.Resolve {
|
|
15
|
-
getResult(ctx) {
|
|
16
|
-
const _super = Object.create(null, {
|
|
17
|
-
getResult: { get: () => super.getResult }
|
|
18
|
-
});
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
return _super.getResult.call(this, ctx, ctx.globals.scope);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.ResolveGlobals = ResolveGlobals;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ResolveLocals = void 0;
|
|
13
|
-
const resolve_1 = require("./resolve");
|
|
14
|
-
class ResolveLocals extends resolve_1.Resolve {
|
|
15
|
-
getResult(ctx) {
|
|
16
|
-
const _super = Object.create(null, {
|
|
17
|
-
getResult: { get: () => super.getResult }
|
|
18
|
-
});
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
return _super.getResult.call(this, ctx, ctx.locals.scope);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.ResolveLocals = ResolveLocals;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ResolveOuter = void 0;
|
|
13
|
-
const resolve_1 = require("./resolve");
|
|
14
|
-
class ResolveOuter extends resolve_1.Resolve {
|
|
15
|
-
getResult(ctx) {
|
|
16
|
-
const _super = Object.create(null, {
|
|
17
|
-
getResult: { get: () => super.getResult }
|
|
18
|
-
});
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
return _super.getResult.call(this, ctx, ctx.outer.scope);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.ResolveOuter = ResolveOuter;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ResolveSelf = void 0;
|
|
13
|
-
const resolve_1 = require("./resolve");
|
|
14
|
-
class ResolveSelf extends resolve_1.Resolve {
|
|
15
|
-
getResult(ctx) {
|
|
16
|
-
const _super = Object.create(null, {
|
|
17
|
-
getResult: { get: () => super.getResult }
|
|
18
|
-
});
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
return _super.getResult.call(this, ctx, ctx.functionState.context);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.ResolveSelf = ResolveSelf;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ASTBase } from 'miniscript-core';
|
|
2
|
-
import { OperationContext } from '../context';
|
|
3
|
-
import { CustomValue } from '../types/base';
|
|
4
|
-
import { CustomNil } from '../types/nil';
|
|
5
|
-
import { Path } from '../utils/path';
|
|
6
|
-
import { CPSVisit, Operation } from './operation';
|
|
7
|
-
export declare class SliceSegment {
|
|
8
|
-
readonly left: Operation;
|
|
9
|
-
readonly right: Operation;
|
|
10
|
-
constructor(left: Operation, right: Operation);
|
|
11
|
-
}
|
|
12
|
-
export declare class PathSegment {
|
|
13
|
-
toPath(_ctx: OperationContext): Promise<CustomValue>;
|
|
14
|
-
}
|
|
15
|
-
export declare class IdentifierSegment extends PathSegment {
|
|
16
|
-
readonly value: string;
|
|
17
|
-
constructor(value: string);
|
|
18
|
-
toPath(_ctx: OperationContext): Promise<CustomValue>;
|
|
19
|
-
}
|
|
20
|
-
export declare class IndexSegment extends PathSegment {
|
|
21
|
-
readonly op: Operation;
|
|
22
|
-
constructor(op: Operation);
|
|
23
|
-
toPath(ctx: OperationContext): Promise<CustomValue>;
|
|
24
|
-
}
|
|
25
|
-
export declare class OperationSegment {
|
|
26
|
-
readonly op: Operation;
|
|
27
|
-
constructor(op: Operation);
|
|
28
|
-
}
|
|
29
|
-
export type Segment = SliceSegment | IdentifierSegment | IndexSegment | OperationSegment;
|
|
30
|
-
export declare class SegmentContainer {
|
|
31
|
-
path: Array<Segment>;
|
|
32
|
-
constructor();
|
|
33
|
-
push(item: Segment): SegmentContainer;
|
|
34
|
-
count(): number;
|
|
35
|
-
at(index: number): Segment;
|
|
36
|
-
isSuper(): boolean;
|
|
37
|
-
getLast(): Segment;
|
|
38
|
-
}
|
|
39
|
-
export declare class ResolveNil extends CustomNil {
|
|
40
|
-
}
|
|
41
|
-
export declare class ResolveResult {
|
|
42
|
-
readonly path: Path<CustomValue>;
|
|
43
|
-
readonly handle: CustomValue;
|
|
44
|
-
constructor(path: Path<CustomValue>, handle: CustomValue);
|
|
45
|
-
}
|
|
46
|
-
export declare class Resolve extends Operation {
|
|
47
|
-
readonly item: ASTBase;
|
|
48
|
-
path: SegmentContainer;
|
|
49
|
-
last: Segment;
|
|
50
|
-
constructor(item: ASTBase, target?: string);
|
|
51
|
-
buildProcessor(node: ASTBase, visit: CPSVisit): Promise<void>;
|
|
52
|
-
build(visit: CPSVisit): Promise<Resolve>;
|
|
53
|
-
getResult(ctx: OperationContext, handle?: CustomValue): Promise<ResolveResult | null>;
|
|
54
|
-
handle(ctx: OperationContext, result?: ResolveResult, autoCall?: boolean): Promise<CustomValue>;
|
|
55
|
-
}
|