@bablr/helpers 0.25.1 → 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.
package/lib/grammar.js CHANGED
@@ -364,8 +364,8 @@ export const write = (value) => {
364
364
  return __buildCall('write', value);
365
365
  };
366
366
 
367
- export const startSpan = (name, guard) => {
368
- return __buildCall('startSpan', name, guard);
367
+ export const startSpan = (name, guard, props = {}) => {
368
+ return __buildCall('startSpan', name, guard, o(props));
369
369
  };
370
370
 
371
371
  export const endSpan = () => {
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.1",
4
+ "version": "0.25.3",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [
@@ -24,14 +24,13 @@
24
24
  },
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
- "@bablr/language_enhancer-debug-log": "0.12.2",
28
- "@bablr/strategy_enhancer-debug-log": "0.11.1",
27
+ "@bablr/language_enhancer-debug-log": "0.12.3",
28
+ "@bablr/strategy_enhancer-debug-log": "0.11.2",
29
29
  "@bablr/stream-iterator": "2.0.0",
30
- "@bablr/agast-helpers": "0.10.2",
31
- "@bablr/agast-vm-helpers": "0.10.2",
32
- "@bablr/boot": "0.11.0",
30
+ "@bablr/agast-helpers": "0.10.4",
31
+ "@bablr/agast-vm-helpers": "0.10.4",
32
+ "@bablr/boot": "0.11.3",
33
33
  "@bablr/coroutine": "0.1.0",
34
- "@iter-tools/imm-stack": "1.2.0",
35
34
  "iter-tools-es": "^7.5.3"
36
35
  },
37
36
  "devDependencies": {