@bablr/agast-vm 0.11.0 → 0.11.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 +3 -15
- package/package.json +3 -4
package/lib/evaluate.js
CHANGED
|
@@ -16,14 +16,7 @@ import {
|
|
|
16
16
|
GapNode,
|
|
17
17
|
} from '@bablr/agast-helpers/symbols';
|
|
18
18
|
import { State } from './state.js';
|
|
19
|
-
import {
|
|
20
|
-
getAttributes,
|
|
21
|
-
getFirstNode,
|
|
22
|
-
isGapNode,
|
|
23
|
-
isNodeTag,
|
|
24
|
-
TagPath,
|
|
25
|
-
} from '@bablr/agast-helpers/path';
|
|
26
|
-
import * as BTree from '@bablr/agast-helpers/btree';
|
|
19
|
+
import { getAttributes, isGapNode, TagPath } from '@bablr/agast-helpers/path';
|
|
27
20
|
import * as Tags from '@bablr/agast-helpers/tags';
|
|
28
21
|
import { isObject } from '@bablr/agast-helpers/object';
|
|
29
22
|
|
|
@@ -43,9 +36,9 @@ export const agast = (options = {}) => {
|
|
|
43
36
|
Object.freeze(options);
|
|
44
37
|
|
|
45
38
|
let getState = () => ({
|
|
46
|
-
path: state.path,
|
|
39
|
+
path: state.path.asPrimitive(),
|
|
47
40
|
node: state.path.node,
|
|
48
|
-
resultPath: state.resultPath,
|
|
41
|
+
resultPath: state.resultPath.asPrimitive(),
|
|
49
42
|
held: state.held,
|
|
50
43
|
});
|
|
51
44
|
|
|
@@ -184,11 +177,6 @@ function* __agast(s) {
|
|
|
184
177
|
case TreeNode: {
|
|
185
178
|
let node = tag;
|
|
186
179
|
|
|
187
|
-
// let clearedHeld =
|
|
188
|
-
// s.held &&
|
|
189
|
-
// (node.type === GapNode ||
|
|
190
|
-
// BTree.getAt(-BTree.getSize(s.held.value.bounds[0]), node.value.bounds[0]));
|
|
191
|
-
|
|
192
180
|
// if (s.held && !s.path.held) throw new Error();
|
|
193
181
|
|
|
194
182
|
s.path = s.path.advance(s.held && isGapNode(node) ? s.held : tag);
|
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.11.
|
|
4
|
+
"version": "0.11.2",
|
|
5
5
|
"author": "Conrad Buck<conartist6@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -15,9 +15,8 @@
|
|
|
15
15
|
"test": "mocha test/*.test.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@bablr/agast-helpers": "0.10.
|
|
20
|
-
"@bablr/agast-vm-helpers": "0.10.0"
|
|
18
|
+
"@bablr/agast-helpers": "0.10.4",
|
|
19
|
+
"@bablr/agast-vm-helpers": "0.10.4"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|