greybel-interpreter 1.7.8 → 1.8.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/context.js +7 -2
- package/dist/operations/chunk.d.ts +2 -2
- package/dist/operations/chunk.js +1 -1
- package/dist/operations/for.d.ts +2 -2
- package/dist/operations/for.js +1 -1
- package/dist/operations/if-statement.d.ts +2 -2
- package/dist/operations/if-statement.js +1 -1
- package/dist/operations/operation.d.ts +2 -0
- package/dist/operations/operation.js +4 -1
- package/dist/operations/while.d.ts +2 -2
- package/dist/operations/while.js +1 -1
- package/package.json +1 -1
package/dist/context.js
CHANGED
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.OperationContext = exports.FunctionState = exports.LoopState = exports.ProcessState = exports.Debugger = exports.Scope = exports.ContextState = exports.ContextType = void 0;
|
|
13
13
|
const handler_container_1 = require("./handler-container");
|
|
14
|
+
const operation_1 = require("./operations/operation");
|
|
14
15
|
const base_1 = require("./types/base");
|
|
15
16
|
const default_1 = require("./types/default");
|
|
16
17
|
const map_1 = require("./types/map");
|
|
@@ -159,6 +160,9 @@ class OperationContext {
|
|
|
159
160
|
}
|
|
160
161
|
step(op) {
|
|
161
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
if (!(op instanceof operation_1.OperationBlock)) {
|
|
164
|
+
this.stackTrace.unshift(op);
|
|
165
|
+
}
|
|
162
166
|
if (!this.injected) {
|
|
163
167
|
this.target = op.target || this.target;
|
|
164
168
|
this.setLastActive(this);
|
|
@@ -167,9 +171,10 @@ class OperationContext {
|
|
|
167
171
|
yield this.debugger.resume();
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
|
-
this.stackTrace.unshift(op);
|
|
171
174
|
const result = yield op.handle(this);
|
|
172
|
-
|
|
175
|
+
if (!(op instanceof operation_1.OperationBlock)) {
|
|
176
|
+
this.stackTrace.shift();
|
|
177
|
+
}
|
|
173
178
|
return result;
|
|
174
179
|
});
|
|
175
180
|
}
|
|
@@ -2,8 +2,8 @@ import { ASTChunk } from 'greyscript-core';
|
|
|
2
2
|
import { OperationContext } from '../context';
|
|
3
3
|
import { CustomValue } from '../types/base';
|
|
4
4
|
import { Block } from './block';
|
|
5
|
-
import { CPSVisit, Operation } from './operation';
|
|
6
|
-
export declare class Chunk extends
|
|
5
|
+
import { CPSVisit, Operation, OperationBlock } from './operation';
|
|
6
|
+
export declare class Chunk extends OperationBlock {
|
|
7
7
|
readonly item: ASTChunk;
|
|
8
8
|
block: Block;
|
|
9
9
|
constructor(item: ASTChunk, target?: string);
|
package/dist/operations/chunk.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.Chunk = void 0;
|
|
|
13
13
|
const string_1 = require("../types/string");
|
|
14
14
|
const block_1 = require("./block");
|
|
15
15
|
const operation_1 = require("./operation");
|
|
16
|
-
class Chunk extends operation_1.
|
|
16
|
+
class Chunk extends operation_1.OperationBlock {
|
|
17
17
|
constructor(item, target) {
|
|
18
18
|
super(null, target);
|
|
19
19
|
this.item = item;
|
package/dist/operations/for.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { ASTForGenericStatement, ASTIdentifier } from 'greyscript-core';
|
|
|
2
2
|
import { OperationContext } from '../context';
|
|
3
3
|
import { CustomValue } from '../types/base';
|
|
4
4
|
import { Block } from './block';
|
|
5
|
-
import { CPSVisit, Operation } from './operation';
|
|
6
|
-
export declare class For extends
|
|
5
|
+
import { CPSVisit, Operation, OperationBlock } from './operation';
|
|
6
|
+
export declare class For extends OperationBlock {
|
|
7
7
|
readonly item: ASTForGenericStatement;
|
|
8
8
|
block: Block;
|
|
9
9
|
variable: ASTIdentifier;
|
package/dist/operations/for.js
CHANGED
|
@@ -16,7 +16,7 @@ const number_1 = require("../types/number");
|
|
|
16
16
|
const string_1 = require("../types/string");
|
|
17
17
|
const block_1 = require("./block");
|
|
18
18
|
const operation_1 = require("./operation");
|
|
19
|
-
class For extends operation_1.
|
|
19
|
+
class For extends operation_1.OperationBlock {
|
|
20
20
|
constructor(item, target) {
|
|
21
21
|
super(null, target);
|
|
22
22
|
this.item = item;
|
|
@@ -2,13 +2,13 @@ import { ASTElseClause, ASTIfClause, ASTIfStatement } from 'greyscript-core';
|
|
|
2
2
|
import { OperationContext } from '../context';
|
|
3
3
|
import { CustomValue } from '../types/base';
|
|
4
4
|
import { Block } from './block';
|
|
5
|
-
import { CPSVisit, Operation } from './operation';
|
|
5
|
+
import { CPSVisit, Operation, OperationBlock } from './operation';
|
|
6
6
|
export declare class Clause {
|
|
7
7
|
readonly condition: Operation;
|
|
8
8
|
readonly block: Block;
|
|
9
9
|
constructor(condition: Operation, block: Block);
|
|
10
10
|
}
|
|
11
|
-
export declare class IfStatement extends
|
|
11
|
+
export declare class IfStatement extends OperationBlock {
|
|
12
12
|
readonly item: ASTIfStatement;
|
|
13
13
|
clauses: Array<Clause>;
|
|
14
14
|
constructor(item: ASTIfStatement, target?: string);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Operation = void 0;
|
|
3
|
+
exports.OperationBlock = exports.Operation = void 0;
|
|
4
4
|
class Operation {
|
|
5
5
|
constructor(item, target = null) {
|
|
6
6
|
this.item = item;
|
|
@@ -8,3 +8,6 @@ class Operation {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.Operation = Operation;
|
|
11
|
+
class OperationBlock extends Operation {
|
|
12
|
+
}
|
|
13
|
+
exports.OperationBlock = OperationBlock;
|
|
@@ -2,8 +2,8 @@ import { ASTWhileStatement } from 'greyscript-core';
|
|
|
2
2
|
import { OperationContext } from '../context';
|
|
3
3
|
import { CustomValue } from '../types/base';
|
|
4
4
|
import { Block } from './block';
|
|
5
|
-
import { CPSVisit, Operation } from './operation';
|
|
6
|
-
export declare class While extends
|
|
5
|
+
import { CPSVisit, Operation, OperationBlock } from './operation';
|
|
6
|
+
export declare class While extends OperationBlock {
|
|
7
7
|
readonly item: ASTWhileStatement;
|
|
8
8
|
block: Block;
|
|
9
9
|
condition: Operation;
|
package/dist/operations/while.js
CHANGED
|
@@ -14,7 +14,7 @@ const context_1 = require("../context");
|
|
|
14
14
|
const default_1 = require("../types/default");
|
|
15
15
|
const block_1 = require("./block");
|
|
16
16
|
const operation_1 = require("./operation");
|
|
17
|
-
class While extends operation_1.
|
|
17
|
+
class While extends operation_1.OperationBlock {
|
|
18
18
|
constructor(item, target) {
|
|
19
19
|
super(null, target);
|
|
20
20
|
this.item = item;
|