@bablr/helpers 0.1.3 → 0.1.4

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/grammar.js CHANGED
@@ -101,7 +101,7 @@ export class Coroutine {
101
101
  finalize() {
102
102
  // ensures failures can be logged!
103
103
  if (!this.done) {
104
- this.throw('failure');
104
+ this.return();
105
105
  }
106
106
  }
107
107
  }
package/lib/trivia.js CHANGED
@@ -15,7 +15,7 @@ const lookbehind = (context, s) => {
15
15
  // eslint-disable-next-line no-undef
16
16
  const matchedResults = new WeakSet();
17
17
 
18
- export const triviaEnhancer = ({ spaceIsAllowed, eatMatchTrivia }, grammar) => {
18
+ export const triviaEnhancer = ({ triviaIsAllowed, eatMatchTrivia }, grammar) => {
19
19
  return mapProductions((production) => {
20
20
  return function* (props, s, ctx, ...args) {
21
21
  const co = new Coroutine(production(props, s, ctx, ...args));
@@ -48,7 +48,7 @@ export const triviaEnhancer = ({ spaceIsAllowed, eatMatchTrivia }, grammar) => {
48
48
  verbSuffix !== '#'
49
49
  ) {
50
50
  const previous = lookbehind(ctx, s);
51
- if (spaceIsAllowed(s) && !matchedResults.has(previous)) {
51
+ if (triviaIsAllowed(s) && !matchedResults.has(previous)) {
52
52
  matchedResults.add(previous);
53
53
  yield eatMatchTrivia;
54
54
  matchedResults.add(s.result);
@@ -69,7 +69,7 @@ export const triviaEnhancer = ({ spaceIsAllowed, eatMatchTrivia }, grammar) => {
69
69
 
70
70
  if (!s.isTerminal) {
71
71
  const previous = lookbehind(ctx, s);
72
- if (spaceIsAllowed(s) && !matchedResults.has(previous)) {
72
+ if (triviaIsAllowed(s) && !matchedResults.has(previous)) {
73
73
  matchedResults.add(previous);
74
74
  yield eatMatchTrivia;
75
75
  matchedResults.add(s.result);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bablr/helpers",
3
3
  "description": "Command helpers for use in writing BABLR grammars",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [
@@ -25,7 +25,7 @@
25
25
  "clean": "rm lib/productions.generated.js"
26
26
  },
27
27
  "dependencies": {
28
- "@bablr/boot": "0.1.6",
28
+ "@bablr/boot": "0.1.8",
29
29
  "@bablr/boot-helpers": "0.1.3",
30
30
  "iter-tools-es": "^7.5.3"
31
31
  },