mevento 1.2.0 → 1.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/esm2020/lib/mevento.mjs +32 -42
- package/fesm2015/mevento.mjs +6 -18
- package/fesm2015/mevento.mjs.map +1 -1
- package/fesm2020/mevento.mjs +6 -16
- package/fesm2020/mevento.mjs.map +1 -1
- package/lib/mevento.d.ts +95 -21
- package/package.json +1 -1
package/lib/mevento.d.ts
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
import { Type } from "@angular/core";
|
|
2
|
-
declare class
|
|
2
|
+
export declare class TokenType {
|
|
3
|
+
static id: number;
|
|
4
|
+
static comma: number;
|
|
5
|
+
static semi: number;
|
|
6
|
+
static numberConst: number;
|
|
7
|
+
static stringConst: number;
|
|
8
|
+
static equal: number;
|
|
9
|
+
static lparen: number;
|
|
10
|
+
static rparen: number;
|
|
11
|
+
static eol: number;
|
|
12
|
+
static eof: number;
|
|
13
|
+
static lbrace: number;
|
|
14
|
+
static rbrace: number;
|
|
15
|
+
static lbracket: number;
|
|
16
|
+
static rbracket: number;
|
|
17
|
+
static great: number;
|
|
18
|
+
static greatEq: number;
|
|
19
|
+
static less: number;
|
|
20
|
+
static lessEq: number;
|
|
21
|
+
static eqeq: number;
|
|
22
|
+
static IF: number;
|
|
23
|
+
static ELSE: number;
|
|
24
|
+
static TRUE: number;
|
|
25
|
+
static FALSE: number;
|
|
26
|
+
static NULL: number;
|
|
27
|
+
static not: number;
|
|
28
|
+
static notEq: number;
|
|
29
|
+
static and: number;
|
|
30
|
+
static or: number;
|
|
31
|
+
static plus: number;
|
|
32
|
+
static minus: number;
|
|
33
|
+
static div: number;
|
|
34
|
+
static mult: number;
|
|
35
|
+
static mod: number;
|
|
36
|
+
static invalid: number;
|
|
37
|
+
static colon: number;
|
|
38
|
+
static WHILE_TILL: number;
|
|
39
|
+
static FOR_LOOP: number;
|
|
40
|
+
static up: number;
|
|
41
|
+
static down: number;
|
|
42
|
+
static with: number;
|
|
43
|
+
static in: number;
|
|
44
|
+
static TILL: number;
|
|
45
|
+
static BREAK: number;
|
|
46
|
+
}
|
|
47
|
+
export declare class Token {
|
|
3
48
|
type: number;
|
|
4
49
|
value: any;
|
|
5
50
|
line?: number;
|
|
@@ -8,96 +53,120 @@ declare class Token {
|
|
|
8
53
|
static from(type: number, value: any): Token;
|
|
9
54
|
toString(): string;
|
|
10
55
|
}
|
|
56
|
+
export declare class LexerDictionary {
|
|
57
|
+
lang: string;
|
|
58
|
+
keywords: {
|
|
59
|
+
[key: string]: string;
|
|
60
|
+
};
|
|
61
|
+
constructor(lang: string, keywords: {
|
|
62
|
+
[key: string]: string;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
11
65
|
/**
|
|
12
66
|
* Parser
|
|
13
67
|
*/
|
|
14
|
-
declare abstract class AST {
|
|
68
|
+
export declare abstract class AST {
|
|
15
69
|
line?: number;
|
|
16
70
|
col?: number;
|
|
17
71
|
constructor(line?: number, col?: number);
|
|
18
72
|
dump(): string;
|
|
19
73
|
}
|
|
20
|
-
declare class RootAST extends AST {
|
|
74
|
+
export declare class RootAST extends AST {
|
|
21
75
|
body: AST[];
|
|
22
76
|
source: string;
|
|
23
77
|
name: string;
|
|
24
78
|
constructor(body: AST[], name: string, source: string);
|
|
25
79
|
dump(): string;
|
|
26
80
|
}
|
|
27
|
-
declare class BlockStatementAST extends AST {
|
|
81
|
+
export declare class BlockStatementAST extends AST {
|
|
28
82
|
body: AST[];
|
|
29
83
|
constructor(body: AST[], token: Token);
|
|
30
84
|
toString(): string;
|
|
31
85
|
}
|
|
32
|
-
declare class IdentifierAST extends AST {
|
|
86
|
+
export declare class IdentifierAST extends AST {
|
|
33
87
|
value: string;
|
|
34
88
|
constructor(token: Token);
|
|
35
89
|
toString(): string;
|
|
36
90
|
}
|
|
37
|
-
declare class LiteralAST extends AST {
|
|
91
|
+
export declare class LiteralAST extends AST {
|
|
38
92
|
value: any;
|
|
39
93
|
raw: string;
|
|
40
94
|
constructor(token: Token, raw: string);
|
|
41
95
|
toString(): string;
|
|
42
96
|
}
|
|
43
|
-
declare class AssignmentExpressionAST extends AST {
|
|
97
|
+
export declare class AssignmentExpressionAST extends AST {
|
|
44
98
|
identifier: AST;
|
|
45
99
|
init: AST;
|
|
46
100
|
constructor(identifier: AST, init: AST);
|
|
47
101
|
toString(): string;
|
|
48
102
|
}
|
|
49
|
-
declare class ExpressionStatementAST extends AST {
|
|
103
|
+
export declare class ExpressionStatementAST extends AST {
|
|
50
104
|
expression: AST;
|
|
51
105
|
constructor(expression: AST);
|
|
52
106
|
toString(): string;
|
|
53
107
|
}
|
|
54
|
-
declare class CallExpressionAST extends AST {
|
|
108
|
+
export declare class CallExpressionAST extends AST {
|
|
55
109
|
callee: IdentifierAST;
|
|
56
110
|
arguments: AST[];
|
|
57
111
|
constructor(callee: IdentifierAST, ags: AST[]);
|
|
58
112
|
toString(): string;
|
|
59
113
|
}
|
|
60
|
-
declare class BinaryExpressionAST extends AST {
|
|
114
|
+
export declare class BinaryExpressionAST extends AST {
|
|
61
115
|
left: AST;
|
|
62
116
|
operation: Token;
|
|
63
117
|
right: AST;
|
|
64
118
|
constructor(left: AST, operation: Token, right: AST);
|
|
65
119
|
toString(): string;
|
|
66
120
|
}
|
|
67
|
-
declare class UnaryExpressionAST extends AST {
|
|
121
|
+
export declare class UnaryExpressionAST extends AST {
|
|
68
122
|
operation: Token;
|
|
69
123
|
argument: AST;
|
|
70
124
|
constructor(operation: Token, argument: AST);
|
|
71
125
|
toString(): string;
|
|
72
126
|
}
|
|
73
|
-
declare class IfStatementAST extends AST {
|
|
127
|
+
export declare class IfStatementAST extends AST {
|
|
74
128
|
test: AST;
|
|
75
129
|
consequent: AST;
|
|
76
130
|
alternate?: AST;
|
|
77
131
|
constructor(test: AST, consequent: AST, alternate?: AST);
|
|
78
132
|
toString(): string;
|
|
79
133
|
}
|
|
80
|
-
declare class LogicalExpressionAST extends AST {
|
|
134
|
+
export declare class LogicalExpressionAST extends AST {
|
|
81
135
|
left: AST;
|
|
82
136
|
operator: Token;
|
|
83
137
|
right: AST;
|
|
84
138
|
constructor(left: AST, operator: Token, right: AST);
|
|
85
139
|
toString(): string;
|
|
86
140
|
}
|
|
87
|
-
declare class IndexAccessorAST extends AST {
|
|
141
|
+
export declare class IndexAccessorAST extends AST {
|
|
88
142
|
owner: AST;
|
|
89
143
|
key: AST;
|
|
90
144
|
computed: boolean;
|
|
91
145
|
constructor(owner: AST, key: AST, computed?: boolean);
|
|
92
146
|
toString(): string;
|
|
93
147
|
}
|
|
94
|
-
declare class
|
|
148
|
+
export declare class ObjectExpression extends AST {
|
|
149
|
+
properties: AST[];
|
|
150
|
+
constructor(props: AST[], startToken?: Token, endToken?: Token);
|
|
151
|
+
toString(): string;
|
|
152
|
+
}
|
|
153
|
+
export declare class ArrayExpression extends AST {
|
|
154
|
+
elements: AST[];
|
|
155
|
+
constructor(props: AST[], start?: AST, end?: AST);
|
|
156
|
+
toString(): string;
|
|
157
|
+
}
|
|
158
|
+
export declare class ObjectProperty extends AST {
|
|
159
|
+
key: AST;
|
|
160
|
+
value: AST;
|
|
161
|
+
constructor(key: AST, value: AST);
|
|
162
|
+
}
|
|
163
|
+
export declare class WhileLoopStatement extends AST {
|
|
95
164
|
test: AST;
|
|
96
165
|
body: AST;
|
|
97
166
|
retain: boolean;
|
|
98
167
|
constructor(test: AST, body: AST, startToken?: Token, endToken?: Token, retain?: boolean);
|
|
99
168
|
}
|
|
100
|
-
declare class ForLoopStatement extends AST {
|
|
169
|
+
export declare class ForLoopStatement extends AST {
|
|
101
170
|
init: AssignmentExpressionAST;
|
|
102
171
|
test: AST;
|
|
103
172
|
update: AST;
|
|
@@ -106,17 +175,22 @@ declare class ForLoopStatement extends AST {
|
|
|
106
175
|
retain: boolean;
|
|
107
176
|
constructor(init: AssignmentExpressionAST, test: AST, update: AST, direction: Token, body: AST, startToken?: Token, endToken?: Token, retain?: boolean);
|
|
108
177
|
}
|
|
109
|
-
declare class ForOfStatement extends AST {
|
|
178
|
+
export declare class ForOfStatement extends AST {
|
|
110
179
|
identifier: AST;
|
|
111
180
|
collection: AST;
|
|
112
181
|
body: AST;
|
|
113
182
|
retain: boolean;
|
|
114
183
|
constructor(identifier: AST, collection: AST, body: AST, startToken?: Token, endToken?: Token, retain?: boolean);
|
|
115
184
|
}
|
|
116
|
-
declare class
|
|
185
|
+
export declare class TupleExpression extends AST {
|
|
186
|
+
first: AST;
|
|
187
|
+
second: AST;
|
|
188
|
+
constructor(first: AST, second: AST);
|
|
189
|
+
}
|
|
190
|
+
export declare class BreakAST extends AST {
|
|
117
191
|
constructor(line?: number, col?: number);
|
|
118
192
|
}
|
|
119
|
-
declare class BreakBranch {
|
|
193
|
+
export declare class BreakBranch {
|
|
120
194
|
}
|
|
121
195
|
declare type Func = (node: any) => any;
|
|
122
196
|
declare abstract class ANodeVisitor {
|
|
@@ -126,10 +200,10 @@ declare abstract class ANodeVisitor {
|
|
|
126
200
|
protected registerVisitor(type: Type<AST>, visitor: Func): void;
|
|
127
201
|
abstract visit(node: AST): any;
|
|
128
202
|
}
|
|
129
|
-
declare abstract class NodeVisitor extends ANodeVisitor {
|
|
203
|
+
export declare abstract class NodeVisitor extends ANodeVisitor {
|
|
130
204
|
visit(node: AST): any;
|
|
131
205
|
}
|
|
132
|
-
declare type MEventoFBinding = (args: any[], vm: MEvento) => any;
|
|
206
|
+
export declare type MEventoFBinding = (args: any[], vm: MEvento) => any;
|
|
133
207
|
export declare class MEvento extends NodeVisitor {
|
|
134
208
|
_memory: {
|
|
135
209
|
[k: string]: any;
|