bit2 0.0.2 → 0.0.3
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/package.json +4 -2
- package/dist/src/bx/biEval.js +0 -59
- package/dist/src/bx/biEval.js.map +0 -1
- package/dist/src/common/Exp.js +0 -44
- package/dist/src/common/Exp.js.map +0 -1
- package/dist/src/common/PrettyPrint.js +0 -32
- package/dist/src/common/PrettyPrint.js.map +0 -1
- package/dist/src/common/Print.js +0 -73
- package/dist/src/common/Print.js.map +0 -1
- package/dist/src/core/AST.js +0 -47
- package/dist/src/core/AST.js.map +0 -1
- package/dist/src/core/PrettyPrint.js +0 -64
- package/dist/src/core/PrettyPrint.js.map +0 -1
- package/dist/src/core/Print.js +0 -77
- package/dist/src/core/Print.js.map +0 -1
- package/dist/src/fuse/Fuse.js +0 -1436
- package/dist/src/fuse/Fuse.js.map +0 -1
- package/dist/src/fuse/Print.js +0 -22
- package/dist/src/fuse/Print.js.map +0 -1
- package/dist/src/fuse/Update.js +0 -3
- package/dist/src/fuse/Update.js.map +0 -1
- package/dist/src/lambda/AST.js +0 -3
- package/dist/src/lambda/AST.js.map +0 -1
- package/dist/src/lambda/Evaluation.js +0 -98
- package/dist/src/lambda/Evaluation.js.map +0 -1
- package/dist/src/lambda/Print.js +0 -31
- package/dist/src/lambda/Print.js.map +0 -1
- package/dist/src/lambdalize/lambdalize.js +0 -94
- package/dist/src/lambdalize/lambdalize.js.map +0 -1
- package/dist/src/lambdalize/unLambdalize.js +0 -59
- package/dist/src/lambdalize/unLambdalize.js.map +0 -1
- package/dist/src/partial/AST.js +0 -3
- package/dist/src/partial/AST.js.map +0 -1
- package/dist/src/partial/Print.js +0 -93
- package/dist/src/partial/Print.js.map +0 -1
- package/dist/src/partialEval/peval.js +0 -322
- package/dist/src/partialEval/peval.js.map +0 -1
- package/dist/src/partialEval/unpeval.js +0 -360
- package/dist/src/partialEval/unpeval.js.map +0 -1
- package/dist/src/surface/AST.js +0 -3
- package/dist/src/surface/AST.js.map +0 -1
- package/dist/src/surface/Parser.js +0 -314
- package/dist/src/surface/Parser.js.map +0 -1
- package/dist/src/translate/Translate.js +0 -91
- package/dist/src/translate/Translate.js.map +0 -1
- package/dist/src/utils/Utils.js +0 -7
- package/dist/src/utils/Utils.js.map +0 -1
- package/dist/test/bx/biEval.test.d.ts +0 -1
- package/dist/test/bx/biEval.test.js +0 -41
- package/dist/test/bx/biEval.test.js.map +0 -1
- package/dist/test/bx/test.d.ts +0 -1
- package/dist/test/bx/test.js +0 -29
- package/dist/test/bx/test.js.map +0 -1
- package/dist/test/core/0.simple.test.d.ts +0 -4
- package/dist/test/core/0.simple.test.js +0 -68
- package/dist/test/core/0.simple.test.js.map +0 -1
- package/dist/test/core/1.core.test.d.ts +0 -2
- package/dist/test/core/1.core.test.js +0 -30
- package/dist/test/core/1.core.test.js.map +0 -1
- package/dist/test/core/core.test.d.ts +0 -1
- package/dist/test/core/core.test.js +0 -28
- package/dist/test/core/core.test.js.map +0 -1
- package/dist/test/fuse/branchnop.test.d.ts +0 -1
- package/dist/test/fuse/branchnop.test.js +0 -47
- package/dist/test/fuse/branchnop.test.js.map +0 -1
- package/dist/test/fuse/bulk.test.d.ts +0 -1
- package/dist/test/fuse/bulk.test.js +0 -111
- package/dist/test/fuse/bulk.test.js.map +0 -1
- package/dist/test/fuse/const.test.d.ts +0 -1
- package/dist/test/fuse/const.test.js +0 -118
- package/dist/test/fuse/const.test.js.map +0 -1
- package/dist/test/fuse/exp.test.d.ts +0 -1
- package/dist/test/fuse/exp.test.js +0 -225
- package/dist/test/fuse/exp.test.js.map +0 -1
- package/dist/test/fuse/lambda.test.d.ts +0 -1
- package/dist/test/fuse/lambda.test.js +0 -139
- package/dist/test/fuse/lambda.test.js.map +0 -1
- package/dist/test/fuse/loop.test.d.ts +0 -1
- package/dist/test/fuse/loop.test.js +0 -39
- package/dist/test/fuse/loop.test.js.map +0 -1
- package/dist/test/fuse/seq.test.d.ts +0 -1
- package/dist/test/fuse/seq.test.js +0 -64
- package/dist/test/fuse/seq.test.js.map +0 -1
- package/dist/test/fuse/space.test.d.ts +0 -1
- package/dist/test/fuse/space.test.js +0 -136
- package/dist/test/fuse/space.test.js.map +0 -1
- package/dist/test/lambda/evaluation.test.d.ts +0 -1
- package/dist/test/lambda/evaluation.test.js +0 -24
- package/dist/test/lambda/evaluation.test.js.map +0 -1
- package/dist/test/lambda/lambda.test.d.ts +0 -1
- package/dist/test/lambda/lambda.test.js +0 -45
- package/dist/test/lambda/lambda.test.js.map +0 -1
- package/dist/test/lambdalize/lambdalize.test.d.ts +0 -1
- package/dist/test/lambdalize/lambdalize.test.js +0 -23
- package/dist/test/lambdalize/lambdalize.test.js.map +0 -1
- package/dist/test/lambdalize/unLambdalize.test.d.ts +0 -1
- package/dist/test/lambdalize/unLambdalize.test.js +0 -35
- package/dist/test/lambdalize/unLambdalize.test.js.map +0 -1
- package/dist/test/partial/partial.test.d.ts +0 -1
- package/dist/test/partial/partial.test.js +0 -35
- package/dist/test/partial/partial.test.js.map +0 -1
- package/dist/test/partialEval/peval.test.d.ts +0 -1
- package/dist/test/partialEval/peval.test.js +0 -29
- package/dist/test/partialEval/peval.test.js.map +0 -1
- package/dist/test/partialEval/unPeval.test.d.ts +0 -1
- package/dist/test/partialEval/unPeval.test.js +0 -40
- package/dist/test/partialEval/unPeval.test.js.map +0 -1
- package/dist/test/surface/AST.test.d.ts +0 -1
- package/dist/test/surface/AST.test.js +0 -41
- package/dist/test/surface/AST.test.js.map +0 -1
- package/dist/test/translate/translate.test.d.ts +0 -1
- package/dist/test/translate/translate.test.js +0 -45
- package/dist/test/translate/translate.test.js.map +0 -1
@@ -1,314 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
function parse(input) {
|
4
|
-
return parseTokens(tokenize(input));
|
5
|
-
}
|
6
|
-
exports.parse = parse;
|
7
|
-
function tokenize(input) {
|
8
|
-
const regex = /«[^»]*»/g;
|
9
|
-
let match;
|
10
|
-
const tokens = [];
|
11
|
-
let lastIndex = 0;
|
12
|
-
while ((match = regex.exec(input)) !== null) {
|
13
|
-
if (lastIndex < match.index) {
|
14
|
-
tokens.push(input.slice(lastIndex, match.index)); // Literal
|
15
|
-
}
|
16
|
-
tokens.push(match[0]); // Directive
|
17
|
-
lastIndex = regex.lastIndex;
|
18
|
-
}
|
19
|
-
if (lastIndex < input.length) {
|
20
|
-
tokens.push(input.slice(lastIndex)); // Remaining literal
|
21
|
-
}
|
22
|
-
return tokens;
|
23
|
-
}
|
24
|
-
exports.tokenize = tokenize;
|
25
|
-
function parseTokens(tokens) {
|
26
|
-
var _a, _b, _c;
|
27
|
-
const fragments = [];
|
28
|
-
let i = 0;
|
29
|
-
while (i < tokens.length) {
|
30
|
-
const token = tokens[i];
|
31
|
-
if (typeof token === "string" &&
|
32
|
-
token.startsWith("«") &&
|
33
|
-
token.endsWith("»")) {
|
34
|
-
const directiveContent = token.slice(1, -1).trim();
|
35
|
-
const [directiveType] = directiveContent.split(" ");
|
36
|
-
switch (directiveType.toUpperCase()) {
|
37
|
-
case "VAR":
|
38
|
-
const declareParts = directiveContent.split("=");
|
39
|
-
fragments.push({
|
40
|
-
type: "Directive",
|
41
|
-
content: {
|
42
|
-
type: "declare",
|
43
|
-
name: declareParts[0].split(" ")[1].trim(),
|
44
|
-
expr: parseExpr(declareParts[1].trim()),
|
45
|
-
},
|
46
|
-
});
|
47
|
-
break;
|
48
|
-
case "IF":
|
49
|
-
const ifParts = directiveContent.match(/IF\s+(.*?)\s*»/);
|
50
|
-
if (ifParts) {
|
51
|
-
const thenBranchTokens = [];
|
52
|
-
const elseBranchTokens = [];
|
53
|
-
let nestingLevel = 1;
|
54
|
-
let j = i + 1;
|
55
|
-
while (j < tokens.length && nestingLevel > 0) {
|
56
|
-
const nextToken = tokens[j];
|
57
|
-
if (typeof nextToken === "string" && nextToken.startsWith("«")) {
|
58
|
-
if (nextToken.includes("ENDIF")) {
|
59
|
-
nestingLevel--;
|
60
|
-
if (nestingLevel === 0)
|
61
|
-
break;
|
62
|
-
}
|
63
|
-
else if (nextToken.includes("IF")) {
|
64
|
-
nestingLevel++;
|
65
|
-
}
|
66
|
-
else if (nextToken.includes("ELSE") && nestingLevel === 1) {
|
67
|
-
nestingLevel = 0; // Mark end of thenBranch
|
68
|
-
j++;
|
69
|
-
continue;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
if (nestingLevel > 0)
|
73
|
-
thenBranchTokens.push(nextToken);
|
74
|
-
else
|
75
|
-
elseBranchTokens.push(nextToken);
|
76
|
-
j++;
|
77
|
-
}
|
78
|
-
const thenBranch = parseTokens(thenBranchTokens);
|
79
|
-
const elseBranch = parseTokens(elseBranchTokens);
|
80
|
-
i = j; // Move index to end of if statement
|
81
|
-
fragments.push({
|
82
|
-
type: "Directive",
|
83
|
-
content: {
|
84
|
-
type: "if",
|
85
|
-
expr: parseExpr(ifParts[1].trim()),
|
86
|
-
thenBranch,
|
87
|
-
elseBranch,
|
88
|
-
},
|
89
|
-
});
|
90
|
-
}
|
91
|
-
break;
|
92
|
-
case "FOR":
|
93
|
-
// 定义正则表达式来匹配各个部分
|
94
|
-
const regex = /(\bfor\b|\bin\b|\bseparator\b|\bfront\b|\brear\b|[\[\],])|(\w+)|"([^"]*)"|\[([^\]]*)\]/gi;
|
95
|
-
const forMatch = [];
|
96
|
-
let match;
|
97
|
-
while ((match = regex.exec(directiveContent)) !== null) {
|
98
|
-
// for
|
99
|
-
if (match[1]) {
|
100
|
-
forMatch.push(match[1]);
|
101
|
-
}
|
102
|
-
// p
|
103
|
-
if (match[2]) {
|
104
|
-
forMatch.push(match[2]);
|
105
|
-
}
|
106
|
-
// in
|
107
|
-
if (match[3]) {
|
108
|
-
forMatch.push(match[3]);
|
109
|
-
}
|
110
|
-
// paragraphs
|
111
|
-
if (match[4]) {
|
112
|
-
forMatch.push(match[4]);
|
113
|
-
}
|
114
|
-
}
|
115
|
-
// 处理可选的 separator 部分
|
116
|
-
const separatorMatch = directiveContent.match(/separator\s*"([^"]*)"/i);
|
117
|
-
if (separatorMatch && separatorMatch[1]) {
|
118
|
-
forMatch.push('separator', separatorMatch[1]);
|
119
|
-
}
|
120
|
-
// 处理可选的 front 部分
|
121
|
-
const frontMatch = directiveContent.match(/front\s*(?:\[([^\]]*)\])?/i);
|
122
|
-
if (frontMatch && frontMatch[1]) {
|
123
|
-
forMatch.push('front', frontMatch[1]);
|
124
|
-
}
|
125
|
-
// 处理可选的 rear 部分
|
126
|
-
const rearMatch = directiveContent.match(/rear\s*(?:\[([^\]]*)\])?/i);
|
127
|
-
if (rearMatch && rearMatch[1]) {
|
128
|
-
forMatch.push('rear', rearMatch[1]);
|
129
|
-
}
|
130
|
-
if (forMatch) {
|
131
|
-
const loopTokens = [];
|
132
|
-
let nestingLevel = 1;
|
133
|
-
let j = i + 1;
|
134
|
-
// Iterate to collect tokens within the FOR directive
|
135
|
-
while (j < tokens.length && nestingLevel > 0) {
|
136
|
-
const nextToken = tokens[j];
|
137
|
-
// Handle nested FOR and ENDFOR
|
138
|
-
if (typeof nextToken === "string" && nextToken.startsWith("«")) {
|
139
|
-
if (nextToken.includes("ENDFOR")) {
|
140
|
-
nestingLevel--;
|
141
|
-
if (nestingLevel === 0)
|
142
|
-
break; // End of current FOR block
|
143
|
-
}
|
144
|
-
else if (nextToken.includes("FOR")) {
|
145
|
-
nestingLevel++;
|
146
|
-
}
|
147
|
-
}
|
148
|
-
// Add token if inside the loop
|
149
|
-
if (nestingLevel > 0)
|
150
|
-
loopTokens.push(nextToken);
|
151
|
-
j++;
|
152
|
-
}
|
153
|
-
// Parse the tokens collected within the loop
|
154
|
-
const fragment = parseTokens(loopTokens);
|
155
|
-
i = j; // Move index to the end of the FOR statement
|
156
|
-
// Build the fragment content
|
157
|
-
fragments.push({
|
158
|
-
type: "Directive",
|
159
|
-
content: {
|
160
|
-
type: "for",
|
161
|
-
name: forMatch[1].trim(),
|
162
|
-
expr: parseExpr(forMatch[3].trim()),
|
163
|
-
separator: { type: "separator", value: ((_a = forMatch[5]) === null || _a === void 0 ? void 0 : _a.trim()) || "" },
|
164
|
-
front: { type: "front", value: ((_b = forMatch[7]) === null || _b === void 0 ? void 0 : _b.trim()) || "" },
|
165
|
-
rear: { type: "rear", value: ((_c = forMatch[9]) === null || _c === void 0 ? void 0 : _c.trim()) || "" },
|
166
|
-
fragment,
|
167
|
-
},
|
168
|
-
});
|
169
|
-
}
|
170
|
-
break;
|
171
|
-
default:
|
172
|
-
if (directiveContent.includes("=")) {
|
173
|
-
const assignParts = directiveContent.split("=");
|
174
|
-
fragments.push({
|
175
|
-
type: "Directive",
|
176
|
-
content: {
|
177
|
-
type: "assign",
|
178
|
-
name: assignParts[0].split(" ")[0].trim(),
|
179
|
-
expr: parseExpr(assignParts[1].trim()),
|
180
|
-
},
|
181
|
-
});
|
182
|
-
}
|
183
|
-
else {
|
184
|
-
fragments.push({
|
185
|
-
type: "Directive",
|
186
|
-
content: {
|
187
|
-
type: "exp",
|
188
|
-
expr: parseExpr(directiveContent),
|
189
|
-
},
|
190
|
-
});
|
191
|
-
}
|
192
|
-
break;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
else {
|
196
|
-
fragments.push(token); // Treat as a literal
|
197
|
-
}
|
198
|
-
i++;
|
199
|
-
}
|
200
|
-
if (fragments.length === 1) {
|
201
|
-
return fragments[0];
|
202
|
-
}
|
203
|
-
return {
|
204
|
-
type: "fragmentList",
|
205
|
-
fragments,
|
206
|
-
};
|
207
|
-
}
|
208
|
-
exports.parseTokens = parseTokens;
|
209
|
-
// Utility function to parse expressions
|
210
|
-
function parseExpr(input) {
|
211
|
-
const tokens = tokenizeExpression(input);
|
212
|
-
// console.log("parseExpr, tokens:", tokens);
|
213
|
-
let pos = 0;
|
214
|
-
function tokenizeExpression(input) {
|
215
|
-
const regex = /"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|(&&|\|\||[<>!=]=|[{}[\](),.:;!+\-*/<>])|(\s+)|([^\s{}[\](),.:;!+\-*/<>!=&|]+)/g;
|
216
|
-
// const regex = /"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([{}[\](),.:;!+\-*/<>=])|(\s+)|([^\s{}[\](),.:;!+\-*/<>=]+)/g;
|
217
|
-
// const regex = /"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'|([{}[\](),.:;!])|(\s+)|([^\s{}[\](),.:;!]+)/g;
|
218
|
-
const tokens = [];
|
219
|
-
let match;
|
220
|
-
while ((match = regex.exec(input)) !== null) {
|
221
|
-
if (match[1] !== undefined) {
|
222
|
-
// Double-quoted string
|
223
|
-
tokens.push(`"${match[1]}"`);
|
224
|
-
}
|
225
|
-
else if (match[2] !== undefined) {
|
226
|
-
// Single-quoted string
|
227
|
-
tokens.push(`'${match[2]}'`);
|
228
|
-
}
|
229
|
-
else if (match[3] !== undefined) {
|
230
|
-
// Delimiters
|
231
|
-
tokens.push(match[3]);
|
232
|
-
}
|
233
|
-
else if (match[5] !== undefined) {
|
234
|
-
// Other tokens (identifiers, numbers, etc.)
|
235
|
-
tokens.push(match[5]);
|
236
|
-
}
|
237
|
-
}
|
238
|
-
return tokens;
|
239
|
-
}
|
240
|
-
function parsePrimary() {
|
241
|
-
if (tokens[pos] === "(") {
|
242
|
-
pos++; // Consume '('
|
243
|
-
const expr = parseExpression();
|
244
|
-
if (tokens[pos] === ")") {
|
245
|
-
pos++; // Consume ')'
|
246
|
-
return expr;
|
247
|
-
}
|
248
|
-
throw new Error("Mismatched parentheses");
|
249
|
-
}
|
250
|
-
if (tokens[pos] === "[") {
|
251
|
-
pos++; // Consume '['
|
252
|
-
const elements = [];
|
253
|
-
while (tokens[pos] !== "]") {
|
254
|
-
if (tokens[pos] === ",") {
|
255
|
-
pos++; // Consume ','
|
256
|
-
}
|
257
|
-
else {
|
258
|
-
elements.push(parseExpression());
|
259
|
-
}
|
260
|
-
}
|
261
|
-
pos++; // Consume ']'
|
262
|
-
return { type: "array", elements };
|
263
|
-
}
|
264
|
-
if (tokens[pos] === "{") {
|
265
|
-
pos++; // Consume '{'
|
266
|
-
const fields = {};
|
267
|
-
while (tokens[pos] !== "}") {
|
268
|
-
if (tokens[pos] === ",") {
|
269
|
-
pos++; // Consume ','
|
270
|
-
}
|
271
|
-
else {
|
272
|
-
const key = tokens[pos++];
|
273
|
-
if (tokens[pos] === ":") {
|
274
|
-
pos++; // Consume ':'
|
275
|
-
const value = parseExpression();
|
276
|
-
fields[key] = value;
|
277
|
-
}
|
278
|
-
else {
|
279
|
-
throw new Error("Expected colon in object literal");
|
280
|
-
}
|
281
|
-
}
|
282
|
-
}
|
283
|
-
pos++; // Consume '}'
|
284
|
-
return { type: "object", fields };
|
285
|
-
}
|
286
|
-
if (!isNaN(Number(tokens[pos]))) {
|
287
|
-
return { type: "constant", value: Number(tokens[pos++]) };
|
288
|
-
}
|
289
|
-
if (/^['"].*['"]$/.test(tokens[pos])) {
|
290
|
-
return { type: "constant", value: tokens[pos++].slice(1, -1) };
|
291
|
-
}
|
292
|
-
if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(tokens[pos])) {
|
293
|
-
return { type: "variable", name: tokens[pos++] };
|
294
|
-
}
|
295
|
-
if (tokens[pos] === "!") {
|
296
|
-
pos++; // Consume '!'
|
297
|
-
const expression = parsePrimary();
|
298
|
-
return { type: "freeze", expression };
|
299
|
-
}
|
300
|
-
throw new Error(`Unexpected token: ${tokens[pos]}`);
|
301
|
-
}
|
302
|
-
function parseExpression() {
|
303
|
-
let left = parsePrimary();
|
304
|
-
while (["+", "-", "*", "/", "&&", "||", ">", "<", ">=", "<=", "!="].includes(tokens[pos])) {
|
305
|
-
const operator = tokens[pos++];
|
306
|
-
const right = parsePrimary();
|
307
|
-
left = { type: "binary", operator, left, right };
|
308
|
-
}
|
309
|
-
return left;
|
310
|
-
}
|
311
|
-
// Start parsing with the expression function
|
312
|
-
return parseExpression();
|
313
|
-
}
|
314
|
-
//# sourceMappingURL=Parser.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../../src/surface/Parser.ts"],"names":[],"mappings":";;AAkBA,SAAgB,KAAK,CAAC,KAAa;IACjC,OAAO,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACtC,CAAC;AAFD,sBAEC;AAED,SAAgB,QAAQ,CAAC,KAAa;IACpC,MAAM,KAAK,GAAG,UAAU,CAAC;IACzB,IAAI,KAAK,CAAC;IACV,MAAM,MAAM,GAAiC,EAAE,CAAC;IAChD,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE;QAC3C,IAAI,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE;YAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU;SAC7D;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY;QACnC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;KAC7B;IAED,IAAI,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE;QAC5B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,oBAAoB;KAC1D;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAnBD,4BAmBC;AAED,SAAgB,WAAW,CACzB,MAAoC;;IAEpC,MAAM,SAAS,GAAuB,EAAE,CAAC;IACzC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;QACxB,MAAM,KAAK,GAAG,MAAM,CAAC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AE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CACnE,MAAM,CAAC,GAAG,CAAC,CACZ,EACD;YACA,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,EAAE,CAAmB,CAAC;YACjD,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;YAC7B,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAqB,CAAC;SACrE;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,6CAA6C;IAC7C,OAAO,eAAe,EAAE,CAAC;AAC3B,CAAC"}
|
@@ -1,91 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
3
|
-
if (mod && mod.__esModule) return mod;
|
4
|
-
var result = {};
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
6
|
-
result["default"] = mod;
|
7
|
-
return result;
|
8
|
-
};
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const Core = __importStar(require("../core/AST"));
|
11
|
-
// Main translation function
|
12
|
-
function translate(surfaceAST) {
|
13
|
-
const coreNodes = translateFragment(surfaceAST);
|
14
|
-
return Core.seq(...coreNodes);
|
15
|
-
}
|
16
|
-
exports.translate = translate;
|
17
|
-
// Translate a surface AST fragment to a core AST term node
|
18
|
-
function translateFragment(fragment) {
|
19
|
-
if (typeof fragment === 'string') {
|
20
|
-
return convertStringToNodes(fragment);
|
21
|
-
}
|
22
|
-
switch (fragment.type) {
|
23
|
-
case 'Directive':
|
24
|
-
switch (fragment.content.type) {
|
25
|
-
case 'declare':
|
26
|
-
return [Core.declare({ type: 'variable', name: fragment.content.name }, fragment.content.expr)];
|
27
|
-
case 'assign':
|
28
|
-
return [Core.assign({ type: 'variable', name: fragment.content.name }, fragment.content.expr)];
|
29
|
-
case 'exp':
|
30
|
-
return [Core.exp(fragment.content.expr)];
|
31
|
-
case 'if':
|
32
|
-
return [Core.ite(fragment.content.expr, { type: 'seq', nodes: translateFragment(fragment.content.thenBranch) }, translateElseBranch(fragment.content.elseBranch) // Use the new function here
|
33
|
-
)];
|
34
|
-
case 'for':
|
35
|
-
return [Core.loop(fragment.content.expr, { type: 'sep', value: fragment.content.separator.value }, { type: 'front', value: fragment.content.front.value }, { type: 'rear', value: fragment.content.rear.value }, { type: 'lambda', variable: { type: 'variable', name: fragment.content.name }, body: { type: 'seq', nodes: translateFragment(fragment.content.fragment) } })];
|
36
|
-
default:
|
37
|
-
throw new Error(`Unknown directive: ${fragment}`);
|
38
|
-
}
|
39
|
-
case 'fragmentList':
|
40
|
-
return fragment.fragments.flatMap(translateFragment);
|
41
|
-
default:
|
42
|
-
throw new Error(`Unknown fragment: ${fragment}`);
|
43
|
-
}
|
44
|
-
}
|
45
|
-
// Helper function to convert string to Core nodes, including SpaceNode for spaces
|
46
|
-
function convertStringToNodes(str) {
|
47
|
-
const nodes = [];
|
48
|
-
let buffer = '';
|
49
|
-
for (let char of str) {
|
50
|
-
if (char === ' ') {
|
51
|
-
if (buffer.length > 0) {
|
52
|
-
nodes.push(Core.constNode(buffer));
|
53
|
-
buffer = '';
|
54
|
-
}
|
55
|
-
nodes.push(Core.space(1)); // Add SpaceNode for each space
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
buffer += char;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
if (buffer.length > 0) {
|
62
|
-
nodes.push(Core.constNode(buffer));
|
63
|
-
}
|
64
|
-
return nodes;
|
65
|
-
}
|
66
|
-
// Type guard for IfDirective
|
67
|
-
function isIfDirective(obj) {
|
68
|
-
return obj && obj.type === 'if';
|
69
|
-
}
|
70
|
-
// Type guard for Bot
|
71
|
-
function isBot(obj) {
|
72
|
-
return obj && obj.type === 'bot';
|
73
|
-
}
|
74
|
-
// Helper function to handle ElseBranch specifically
|
75
|
-
function translateElseBranch(elseBranch) {
|
76
|
-
if (isIfDirective(elseBranch)) {
|
77
|
-
// If it's an IfDirective
|
78
|
-
const ifDirective = elseBranch;
|
79
|
-
return Core.ite(ifDirective.expr, { type: 'seq', nodes: translateFragment(ifDirective.thenBranch) }, translateElseBranch(ifDirective.elseBranch) // Recursive call for nested if
|
80
|
-
);
|
81
|
-
}
|
82
|
-
else if (isBot(elseBranch)) {
|
83
|
-
// If it's a Bot
|
84
|
-
return Core.bot();
|
85
|
-
}
|
86
|
-
else {
|
87
|
-
// If it has a 'fragments' field, it's a Fragment
|
88
|
-
return { type: 'seq', nodes: translateFragment(elseBranch) };
|
89
|
-
}
|
90
|
-
}
|
91
|
-
//# sourceMappingURL=Translate.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Translate.js","sourceRoot":"","sources":["../../../src/translate/Translate.ts"],"names":[],"mappings":";;;;;;;;;AACA,kDAAoC;AAEpC,4BAA4B;AAC5B,SAAgB,SAAS,CAAC,UAA4B;IACpD,MAAM,SAAS,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC;AAChC,CAAC;AAHD,8BAGC;AAED,2DAA2D;AAC3D,SAAS,iBAAiB,CAAC,QAA0B;IACnD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;KACvC;IAED,QAAQ,QAAQ,CAAC,IAAI,EAAE;QACrB,KAAK,WAAW;YACd,QAAQ,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;gBAC7B,KAAK,SAAS;oBACZ,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;gBAChG,KAAK,QAAQ;oBACX,OAAO,CAAC,IAAI,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yBAAyB;QACzB,MAAM,WAAW,GAAG,UAAiC,CAAC;QACtD,OAAO,IAAI,CAAC,GAAG,CACb,WAAW,CAAC,IAAI,EAChB,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,EACjE,mBAAmB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,+BAA+B;SAC5E,CAAC;KACH;SAAM,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE;QAC5B,gBAAgB;QAChB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;KACnB;SAAM;QACL,iDAAiD;QACjD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAAE,CAAC;KAC9D;AACH,CAAC"}
|
package/dist/src/utils/Utils.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/utils/Utils.ts"],"names":[],"mappings":";;AAAA,SAAgB,YAAY,CAAC,GAAW;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAFD,oCAEC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
3
|
-
if (mod && mod.__esModule) return mod;
|
4
|
-
var result = {};
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
6
|
-
result["default"] = mod;
|
7
|
-
return result;
|
8
|
-
};
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const BiEval = __importStar(require("../../src/bx/biEval"));
|
11
|
-
console.log("-------- 1. Assignment ----------");
|
12
|
-
console.log("== Forward Evaluation ==");
|
13
|
-
const exampleInput = `«VAR no = 0»
|
14
|
-
Before: «no»
|
15
|
-
«no = no + 1»
|
16
|
-
After: «no»`;
|
17
|
-
console.log(BiEval.forward(exampleInput));
|
18
|
-
console.log("== Backward Evaluation ==");
|
19
|
-
// console.log('Operation:\n replace "0" with "1" at 9');
|
20
|
-
console.log('Operation:\n replace "1" with "0" at 19');
|
21
|
-
console.log("Original:");
|
22
|
-
// CorePrint.printAST(SimpleCoreExample.assignmentExample);
|
23
|
-
// console.log(CorePrettyPrint.prettyPrint(SimpleCoreExample.assignmentExample));
|
24
|
-
console.log("Updated:");
|
25
|
-
BiEval.backward(exampleInput, { type: 'replace', str1: "1", str2: "0", position: 19 }).forEach(updatedCoreAST => {
|
26
|
-
// CorePrint.printAST(updatedCoreAST);
|
27
|
-
console.log(updatedCoreAST);
|
28
|
-
console.log("~~~~~~~~~~~~~~~~~~~~~~~~");
|
29
|
-
});
|
30
|
-
// console.log('Operation:\n bulk(replace "0" with "1" at 0, replace "1" with "2" at 3)');
|
31
|
-
// console.log("Updated:");
|
32
|
-
// BiEval.backward(SimpleCoreExample.assignmentExample, {type:'bulk',operations:[{type:'replace', str1:"0", str2:"1", position:0},{type:'replace', str1:"1", str2:"2", position:3}]}).forEach(updatedCoreAST => {
|
33
|
-
// // CorePrint.printAST(updatedCoreAST);
|
34
|
-
// console.log(CorePrettyPrint.prettyPrint(updatedCoreAST));
|
35
|
-
// console.log("~~~~~~~~~~~~~~~~~~~~~~~~");
|
36
|
-
// });
|
37
|
-
// console.log("-------- 2. Branch ----------");
|
38
|
-
// console.log(BiEval.forward(SimpleCoreExample.branchExample));
|
39
|
-
// console.log("-------- 3. Loop ----------");
|
40
|
-
// console.log(BiEval.forward(SimpleCoreExample.loopExample));
|
41
|
-
//# sourceMappingURL=biEval.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"biEval.test.js","sourceRoot":"","sources":["../../../test/bx/biEval.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,4DAA8C;AAI9C,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACjD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AACxC,MAAM,YAAY,GAClB;;;YAGY,CAAC;AACb,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1C,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACzC,yDAAyD;AACzD,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AACvD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACzB,2DAA2D;AAC3D,iFAAiF;AACjF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACxB,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,IAAI,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;IACxG,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,0FAA0F;AAC1F,2BAA2B;AAC3B,iNAAiN;AACjN,2CAA2C;AAC3C,8DAA8D;AAC9D,6CAA6C;AAC7C,MAAM;AAKN,gDAAgD;AAChD,gEAAgE;AAEhE,8CAA8C;AAC9C,8DAA8D"}
|
package/dist/test/bx/test.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/test/bx/test.js
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
3
|
-
if (mod && mod.__esModule) return mod;
|
4
|
-
var result = {};
|
5
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
6
|
-
result["default"] = mod;
|
7
|
-
return result;
|
8
|
-
};
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
10
|
-
const BiEval = __importStar(require("../../dist/bit2"));
|
11
|
-
console.log("-------- 1. Assignment ----------");
|
12
|
-
console.log("== Forward Evaluation ==");
|
13
|
-
const exampleInput = `«VAR no = 0»
|
14
|
-
Before: «no»
|
15
|
-
«no = no + 1»
|
16
|
-
After: «no»`;
|
17
|
-
console.log(BiEval.forward(exampleInput));
|
18
|
-
console.log("== Backward Evaluation ==");
|
19
|
-
console.log('Operation:\n replace "0" with "1" at 9');
|
20
|
-
console.log("Original:");
|
21
|
-
// CorePrint.printAST(SimpleCoreExample.assignmentExample);
|
22
|
-
// console.log(CorePrettyPrint.prettyPrint(SimpleCoreExample.assignmentExample));
|
23
|
-
console.log("Updated:");
|
24
|
-
BiEval.backward(exampleInput, { type: 'replace', str1: "0", str2: "1", position: 9 }).forEach(updatedCoreAST => {
|
25
|
-
// CorePrint.printAST(updatedCoreAST);
|
26
|
-
console.log(updatedCoreAST);
|
27
|
-
console.log("~~~~~~~~~~~~~~~~~~~~~~~~");
|
28
|
-
});
|
29
|
-
//# sourceMappingURL=test.js.map
|
package/dist/test/bx/test.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test/bx/test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wDAA0C;AAE1C,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACjD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AACxC,MAAM,YAAY,GAClB;;;YAGY,CAAC;AACb,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1C,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AACzC,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AACtD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACzB,2DAA2D;AAC3D,iFAAiF;AACjF,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACxB,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,IAAI,EAAC,GAAG,EAAE,QAAQ,EAAC,CAAC,EAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;IACvG,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC"}
|
@@ -1,68 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.assignmentExample = {
|
4
|
-
type: 'seq',
|
5
|
-
nodes: [
|
6
|
-
{ type: 'declare', name: { type: 'variable', name: 'v' }, value: { type: 'constant', value: 0 } },
|
7
|
-
{ type: 'exp', expression: { type: 'variable', name: 'v' } },
|
8
|
-
{ type: 'space', width: 1 },
|
9
|
-
{ type: 'assign', name: { type: 'variable', name: 'v' }, value: { type: 'binary', operator: '+', left: { type: 'variable', name: 'v' }, right: { type: 'constant', value: 1 } } },
|
10
|
-
{ type: 'space', width: 1 },
|
11
|
-
{ type: 'exp', expression: { type: 'variable', name: 'v' } },
|
12
|
-
{ type: 'end' }
|
13
|
-
]
|
14
|
-
};
|
15
|
-
exports.branchExample = {
|
16
|
-
type: 'seq',
|
17
|
-
nodes: [
|
18
|
-
{ type: 'declare', name: { type: 'variable', name: 'v' }, value: { type: 'constant', value: "stefanzantao" } },
|
19
|
-
{
|
20
|
-
type: 'ite',
|
21
|
-
condition: { type: 'binary', operator: ">", left: { type: 'field', object: { type: 'variable', name: 'v' }, field: 'length' }, right: { type: 'constant', value: 10 } },
|
22
|
-
trueBranch: { type: 'seq', nodes: [
|
23
|
-
// {type:'exp', expression:{type:'field', object:{type:'variable', name:'v'}, field:'substring(0,10)'}},
|
24
|
-
{ type: 'exp', expression: { type: 'variable', name: 'v' } },
|
25
|
-
{ type: 'const', value: '...' },
|
26
|
-
] },
|
27
|
-
falseBranch: { type: 'exp', expression: { type: 'variable', name: 'v' } }
|
28
|
-
},
|
29
|
-
{ type: 'end' }
|
30
|
-
]
|
31
|
-
};
|
32
|
-
exports.loopExample = {
|
33
|
-
type: 'seq',
|
34
|
-
nodes: [
|
35
|
-
{
|
36
|
-
type: 'declare', name: { type: 'variable', name: 'lst' },
|
37
|
-
value: { type: 'array', elements: [
|
38
|
-
{ type: 'object', fields: { head: { type: "constant", value: "Hello" }, text: { type: "constant", value: "Hello!" } } },
|
39
|
-
{ type: 'object', fields: { head: { type: "constant", value: "Farewell" }, text: { type: "constant", value: "Good Bye!" } } }
|
40
|
-
] }
|
41
|
-
},
|
42
|
-
{
|
43
|
-
type: 'loop',
|
44
|
-
lst: { type: 'variable', name: 'lst' },
|
45
|
-
separator: { type: 'sep', value: ',' },
|
46
|
-
front: { type: 'front', value: '[' },
|
47
|
-
rear: { type: 'rear', value: ']' },
|
48
|
-
body: { type: 'lambda', variable: { type: 'variable', name: 'item' },
|
49
|
-
body: {
|
50
|
-
type: 'seq',
|
51
|
-
nodes: [
|
52
|
-
{ type: 'exp', expression: { type: 'field', object: { type: 'variable', name: 'item' }, field: 'head' } },
|
53
|
-
{ type: 'const', value: ":" },
|
54
|
-
{ type: 'exp', expression: { type: 'field', object: { type: 'variable', name: 'item' }, field: 'text' } },
|
55
|
-
]
|
56
|
-
}
|
57
|
-
}
|
58
|
-
},
|
59
|
-
{ type: 'end' }
|
60
|
-
]
|
61
|
-
};
|
62
|
-
// console.log("--------assignment-----------");
|
63
|
-
// Print.printAST(assignmentExample);
|
64
|
-
// console.log("--------branch-----------");
|
65
|
-
// Print.printAST(branchExample);
|
66
|
-
// console.log("--------forloop-----------");
|
67
|
-
// Print.printAST(loopExample);
|
68
|
-
//# sourceMappingURL=0.simple.test.js.map
|
@@ -1 +0,0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