@bablr/helpers 0.25.2 → 0.25.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.
Files changed (2) hide show
  1. package/lib/trivia.js +11 -3
  2. package/package.json +1 -1
package/lib/trivia.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { Coroutine } from '@bablr/coroutine';
3
3
  import { eat, eatMatch, mapProductions, o, r } from './grammar.js';
4
4
  import { Matcher, Regex } from './symbols.js';
5
- import { get, getCooked, getFlagsWithGap, nodeFlags } from '@bablr/agast-helpers/tree';
5
+ import { get, getCooked, getFlagsWithGap, getRoot, nodeFlags } from '@bablr/agast-helpers/tree';
6
6
  import {
7
7
  buildTreeNodeMatcher,
8
8
  buildIdentifier,
@@ -95,12 +95,20 @@ export const triviaEnhancer = (
95
95
  o({
96
96
  matcher: wrappedMatcher,
97
97
  props,
98
- options: o({ ...(options?.value ?? {}), allowEmpty: true }),
98
+ options: o({
99
+ ...(options?.value ?? {}),
100
+ allowEmpty: true,
101
+ suppressGap: true,
102
+ literal: true,
103
+ }),
99
104
  matchTrailing: false,
100
105
  }),
106
+ o({
107
+ suppressGap: true,
108
+ }),
101
109
  );
102
110
 
103
- returnValue = result?.value;
111
+ returnValue = result?.value || getRoot(result?.node);
104
112
  break;
105
113
  }
106
114
  }
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.25.2",
4
+ "version": "0.25.3",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [