@bablr/bablr-vm 0.23.7 → 0.23.8

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 CHANGED
@@ -59,7 +59,7 @@ function* __bablr(ctx, rootSource, rootLanguage, strategy, options, registerNode
59
59
 
60
60
  let getState = () => s.getPublic();
61
61
 
62
- s = State.from(rootSource, ctx, rootLanguage, options.expressions, options.spans);
62
+ s = State.from(rootSource, ctx, rootLanguage, options.spans);
63
63
 
64
64
  s.source.advance();
65
65
 
@@ -292,16 +292,6 @@ function* __bablr(ctx, rootSource, rootLanguage, strategy, options, registerNode
292
292
  break;
293
293
  }
294
294
 
295
- if (s.expressions.size) {
296
- let expression = s.expressions.value;
297
- let node = getRoot(expression);
298
-
299
- m.advance(node);
300
-
301
- s.expressions = s.expressions.pop();
302
- break;
303
- }
304
-
305
295
  if (Tags.getSize(getTags(s.node))) {
306
296
  m.advance(tag, s);
307
297
  } else {
package/lib/state.js CHANGED
@@ -10,15 +10,8 @@ import { getOpenTag } from '@bablr/agast-helpers/path';
10
10
  export const nodeStates = new WeakMap();
11
11
 
12
12
  export const State = class BABLRState {
13
- static from(source, context, language, expressions = [], spans = Spans.fromValues([])) {
14
- return new State(
15
- null,
16
- source,
17
- context,
18
- BTree.fromValues([language]),
19
- emptyStack.push(...emptyStack.push(...expressions).valuesReverse()),
20
- spans,
21
- );
13
+ static from(source, context, language, spans = Spans.fromValues([])) {
14
+ return new State(null, source, context, BTree.fromValues([language]), spans);
22
15
  }
23
16
 
24
17
  constructor(
@@ -26,7 +19,6 @@ export const State = class BABLRState {
26
19
  source,
27
20
  context,
28
21
  languages,
29
- expressions = emptyStack,
30
22
  spans = Spans.fromValues([]),
31
23
  balanced = emptyStack,
32
24
  resultPath = null,
@@ -40,7 +32,6 @@ export const State = class BABLRState {
40
32
  this.source = source;
41
33
  this.context = context;
42
34
  this.languages = languages;
43
- this.expressions = expressions;
44
35
  this.balanced = balanced;
45
36
  this.spans = spans;
46
37
  this.resultPath = resultPath;
@@ -79,13 +70,12 @@ export const State = class BABLRState {
79
70
  return !!this.parent;
80
71
  }
81
72
 
82
- push(source, context, languages, expressions, spans, balanced, resultPath, depths, held, node) {
73
+ push(source, context, languages, spans, balanced, resultPath, depths, held, node) {
83
74
  return new State(
84
75
  this,
85
76
  source,
86
77
  context,
87
78
  languages,
88
- expressions,
89
79
  spans,
90
80
  balanced,
91
81
  resultPath,
@@ -161,24 +151,12 @@ export const State = class BABLRState {
161
151
 
162
152
  branch() {
163
153
  let baseState = this;
164
- let {
165
- source,
166
- context,
167
- spans,
168
- balanced,
169
- resultPath,
170
- depths,
171
- held,
172
- node,
173
- languages,
174
- expressions,
175
- } = baseState;
154
+ let { source, context, spans, balanced, resultPath, depths, held, node, languages } = baseState;
176
155
 
177
156
  let child = this.push(
178
157
  source.branch(),
179
158
  context,
180
159
  languages,
181
- expressions,
182
160
  spans,
183
161
  balanced,
184
162
  resultPath,
@@ -206,7 +184,6 @@ export const State = class BABLRState {
206
184
  parent.held = accepted.held;
207
185
  parent.depths = accepted.depths;
208
186
  parent.languages = accepted.languages;
209
- parent.expressions = accepted.expressions;
210
187
 
211
188
  if (parent.depths.result + 1 === accepted.depths.result) {
212
189
  parent.resultPath = parent.resultPath.siblingAt(accepted.resultPath.tagsIndex);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bablr/bablr-vm",
3
3
  "description": "A VM for parsing using BABLR languages",
4
- "version": "0.23.7",
4
+ "version": "0.23.8",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [