mevento 1.4.0 → 1.9.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/esm2020/lib/mevento.mjs +173 -57
- package/fesm2015/mevento.mjs +181 -59
- package/fesm2015/mevento.mjs.map +1 -1
- package/fesm2020/mevento.mjs +173 -57
- package/fesm2020/mevento.mjs.map +1 -1
- package/lib/mevento.d.ts +31 -6
- package/package.json +1 -1
package/lib/mevento.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare class TokenType {
|
|
|
43
43
|
static in: number;
|
|
44
44
|
static TILL: number;
|
|
45
45
|
static BREAK: number;
|
|
46
|
+
static CONTINUE: number;
|
|
46
47
|
}
|
|
47
48
|
export declare class Token {
|
|
48
49
|
type: number;
|
|
@@ -190,7 +191,14 @@ export declare class TupleExpression extends AST {
|
|
|
190
191
|
export declare class BreakAST extends AST {
|
|
191
192
|
constructor(line?: number, col?: number);
|
|
192
193
|
}
|
|
193
|
-
export declare class
|
|
194
|
+
export declare class ContinueAST extends AST {
|
|
195
|
+
constructor(line?: number, col?: number);
|
|
196
|
+
}
|
|
197
|
+
export declare class LoopControl {
|
|
198
|
+
}
|
|
199
|
+
export declare class BreakBranch extends LoopControl {
|
|
200
|
+
}
|
|
201
|
+
export declare class ContinueBranch extends LoopControl {
|
|
194
202
|
}
|
|
195
203
|
declare type Func = (node: any) => any;
|
|
196
204
|
declare abstract class ANodeVisitor {
|
|
@@ -203,7 +211,7 @@ declare abstract class ANodeVisitor {
|
|
|
203
211
|
export declare abstract class NodeVisitor extends ANodeVisitor {
|
|
204
212
|
constructor();
|
|
205
213
|
visit(node: AST): any;
|
|
206
|
-
assignProperty(owner: any, property: any, value: any): any;
|
|
214
|
+
protected assignProperty(owner: any, property: any, value: any): any;
|
|
207
215
|
protected abstract visitRootAST(node: RootAST): any;
|
|
208
216
|
protected abstract visitBlockStatementAST(node: BlockStatementAST): any;
|
|
209
217
|
protected abstract visitIdentifierAST(node: IdentifierAST): any;
|
|
@@ -223,12 +231,24 @@ export declare abstract class NodeVisitor extends ANodeVisitor {
|
|
|
223
231
|
protected abstract visitWhileLoopStatement(node: WhileLoopStatement): any;
|
|
224
232
|
protected abstract visitForLoopStatement(node: ForLoopStatement): any;
|
|
225
233
|
protected abstract visitForOfStatement(node: ForOfStatement): any;
|
|
234
|
+
protected abstract visitContinueAST(node: ContinueAST): any;
|
|
226
235
|
}
|
|
227
|
-
export declare
|
|
228
|
-
|
|
229
|
-
|
|
236
|
+
export declare class MEventScope {
|
|
237
|
+
name: string;
|
|
238
|
+
parent?: MEventScope;
|
|
239
|
+
memory: {
|
|
230
240
|
[k: string]: any;
|
|
231
241
|
};
|
|
242
|
+
constructor(name: string, memory: {
|
|
243
|
+
[k: string]: any;
|
|
244
|
+
}, parent?: MEventScope);
|
|
245
|
+
resolve(key: string): any;
|
|
246
|
+
change(key: string, value: any, declare?: boolean): boolean;
|
|
247
|
+
}
|
|
248
|
+
export declare type MEventoFBinding = (args: any[], vm: MEvento) => any;
|
|
249
|
+
export declare class MEvento extends NodeVisitor {
|
|
250
|
+
rootScope: MEventScope;
|
|
251
|
+
protected currentScrope?: MEventScope;
|
|
232
252
|
debug: boolean;
|
|
233
253
|
private static _globalFunctionsRegistry;
|
|
234
254
|
private static _cache;
|
|
@@ -236,6 +256,10 @@ export declare class MEvento extends NodeVisitor {
|
|
|
236
256
|
[k: string]: MEventoFBinding;
|
|
237
257
|
};
|
|
238
258
|
constructor();
|
|
259
|
+
protected resolve(name: string): any;
|
|
260
|
+
protected changeVariable(name: string, value: any): any;
|
|
261
|
+
protected pushScope(name: string): void;
|
|
262
|
+
protected popScope(): void;
|
|
239
263
|
protected log(message: any): void;
|
|
240
264
|
protected visitRootAST(node: RootAST): any;
|
|
241
265
|
protected visitBlockStatementAST(node: BlockStatementAST): any;
|
|
@@ -256,6 +280,7 @@ export declare class MEvento extends NodeVisitor {
|
|
|
256
280
|
protected visitWhileLoopStatement(node: WhileLoopStatement): any;
|
|
257
281
|
protected visitForLoopStatement(node: ForLoopStatement): any;
|
|
258
282
|
protected visitForOfStatement(node: ForOfStatement): any;
|
|
283
|
+
protected visitContinueAST(node: ContinueAST): ContinueBranch;
|
|
259
284
|
protected _declareForIdentifier(node: AST, value: any): any;
|
|
260
285
|
resolveArguments(args: AST[]): any;
|
|
261
286
|
registerFunction(id: string, fn: MEventoFBinding): void;
|
|
@@ -287,7 +312,7 @@ export declare class MEventoAsync extends MEvento {
|
|
|
287
312
|
protected visitObjectExpression(ast: AST): Promise<any>;
|
|
288
313
|
protected visitArrayExpression(ast: AST): Promise<any[]>;
|
|
289
314
|
protected visitWhileLoopStatement(node: WhileLoopStatement): Promise<any[] | undefined>;
|
|
290
|
-
protected visitForLoopStatement(node: ForLoopStatement): Promise<any[] |
|
|
315
|
+
protected visitForLoopStatement(node: ForLoopStatement): Promise<any[] | null>;
|
|
291
316
|
protected visitForOfStatement(node: ForOfStatement): Promise<any[] | undefined>;
|
|
292
317
|
resolveArgumentsAsync(args: AST[]): Promise<any[]>;
|
|
293
318
|
registerFunction(id: string, fn: MEventoFBinding): void;
|