@bablr/agast-vm 0.1.0 → 0.1.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/lib/evaluate.js +5 -19
- package/package.json +4 -4
package/lib/evaluate.js
CHANGED
|
@@ -59,26 +59,8 @@ const __evaluate = function* agastStrategy(ctx, strategy) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
case 'reject': {
|
|
62
|
-
const rejectedState = s;
|
|
63
|
-
|
|
64
62
|
s = s.reject();
|
|
65
63
|
|
|
66
|
-
if (rejectedState.path.depth > s.path.depth) {
|
|
67
|
-
const lowPath = rejectedState.path.at(
|
|
68
|
-
Math.min(s.path.depth + 1, rejectedState.path.depth),
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const { name, isArray } = lowPath.reference?.value || {};
|
|
72
|
-
|
|
73
|
-
if (!s.node.resolver.counters.has(name) && !lowPath.openTag?.value.flags.trivia) {
|
|
74
|
-
yield* s.emit(buildReference(name, isArray));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (s.result.type === 'Reference') {
|
|
78
|
-
yield* s.emit(buildNull());
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
64
|
returnValue = facades.get(s);
|
|
83
65
|
break;
|
|
84
66
|
}
|
|
@@ -217,6 +199,10 @@ const __evaluate = function* agastStrategy(ctx, strategy) {
|
|
|
217
199
|
}
|
|
218
200
|
}
|
|
219
201
|
|
|
202
|
+
if (intrinsicValue && !flags.token) {
|
|
203
|
+
throw new Error('intrinsic nodes must occur inside tokens');
|
|
204
|
+
}
|
|
205
|
+
|
|
220
206
|
if (!flags.expression) {
|
|
221
207
|
const { flags } = openTag.value;
|
|
222
208
|
|
|
@@ -225,7 +211,7 @@ const __evaluate = function* agastStrategy(ctx, strategy) {
|
|
|
225
211
|
s.path = s.path.push(ctx, tag);
|
|
226
212
|
s.node.resolver.consume(tag);
|
|
227
213
|
}
|
|
228
|
-
} else {
|
|
214
|
+
} else if (!intrinsicValue) {
|
|
229
215
|
s.expressionDepth++;
|
|
230
216
|
}
|
|
231
217
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/agast-vm",
|
|
3
3
|
"description": "A VM providing DOM-like guarantees about agAST trees",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"author": "Conrad Buck<conartist6@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"test": "node ./test/runner.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@bablr/agast-helpers": "0.1.
|
|
19
|
-
"@bablr/agast-vm-helpers": "0.1.
|
|
18
|
+
"@bablr/agast-helpers": "0.1.1",
|
|
19
|
+
"@bablr/agast-vm-helpers": "0.1.1",
|
|
20
20
|
"@bablr/coroutine": "0.1.0",
|
|
21
21
|
"@bablr/weak-stack": "0.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@bablr/agast-vm-strategy-passthrough": "github:bablr-lang/agast-vm-strategy-passthrough#2bd3a0c7311037af92c5b81941c79161499f6c9e",
|
|
25
25
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|
|
26
|
-
"@bablr/strategy_enhancer-debug-log": "0.1.
|
|
26
|
+
"@bablr/strategy_enhancer-debug-log": "0.1.1",
|
|
27
27
|
"enhanced-resolve": "^5.12.0",
|
|
28
28
|
"eslint": "^8.32.0",
|
|
29
29
|
"eslint-import-resolver-enhanced-resolve": "^1.0.5",
|