@bablr/cli 0.11.7 → 0.11.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/bin/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { spam as m } from '@bablr/boot';
6
6
  import { program } from 'commander';
7
- import { streamParse } from 'bablr';
7
+ import { buildModule } from 'bablr/enhanceable';
8
8
  import { embeddedSourceFrom, readFromStream, stripTrailingNewline } from '@bablr/helpers/source';
9
9
  import { debugEnhancers } from '@bablr/helpers/enhancers';
10
10
  import colorSupport from 'color-support';
@@ -57,6 +57,8 @@ const logStderr = (...args) => {
57
57
 
58
58
  const enhancers = options.verbose ? { ...debugEnhancers, agast: null } : {};
59
59
 
60
+ let { streamParse } = buildModule(enhancers);
61
+
60
62
  const rawStream = process.stdin.setEncoding('utf-8');
61
63
 
62
64
  Error.stackTraceLimit = 20;
@@ -74,7 +76,8 @@ const output = evaluateIO(() =>
74
76
  enhancers,
75
77
  emitEffects: true,
76
78
  holdShiftedNodes: !options.gaps,
77
- holdUndefinedAttributes: !options.gaps,
79
+ // holdUndefinedAttributes: !options.gaps,
80
+ tree: false,
78
81
  },
79
82
  ),
80
83
  {
package/lib/syntax.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import emptyStack from '@iter-tools/imm-stack';
4
4
  import cstml from '@bablr/language-en-cstml';
5
5
  import verboseOutput from '@bablr/language-en-bablr-cli-verbose-output';
6
- import { streamParse } from 'bablr/enhanceable';
6
+ import { streamParse } from 'bablr';
7
7
  import { Coroutine } from '@bablr/coroutine';
8
8
  import { StreamIterable, getStreamIterator, hoistTrivia, wait } from '@bablr/agast-helpers/stream';
9
9
  import {
@@ -26,6 +26,7 @@ import {
26
26
  buildBoundNodeMatcher,
27
27
  } from '@bablr/helpers/builders';
28
28
  import { getFlagsWithGap, nodeFlags } from '@bablr/agast-helpers/builders';
29
+ import { o } from '@bablr/helpers/grammar';
29
30
 
30
31
  let gapNodeFlags = getFlagsWithGap(nodeFlags);
31
32
 
@@ -53,8 +54,12 @@ function* __higlightStrategy(tags) {
53
54
 
54
55
  names = names.push(tagName);
55
56
 
56
- if (
57
- tagName === Symbol.for('Pattern') ||
57
+ if (tagName === Symbol.for('Alternative')) {
58
+ yield buildAnsiPushEffect('reset');
59
+ } else if (
60
+ tagName === Symbol.for('Character') ||
61
+ (currentName === Symbol.for('Pattern') &&
62
+ ['openToken', 'closeToken', 'flags'].includes(currentRef?.name)) ||
58
63
  (tagName === Symbol.for('String') && currentName === Symbol.for('TreeNodeMatcherOpen'))
59
64
  ) {
60
65
  yield buildAnsiPushEffect('bold orange');
@@ -155,6 +160,8 @@ export const generateCSTML = (tags, options = {}) => {
155
160
  ),
156
161
  ),
157
162
  input,
163
+ o({}),
164
+ { tree: false },
158
165
  );
159
166
 
160
167
  return higlightStrategy(hoistTrivia(tags));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bablr/cli",
3
3
  "description": "CLI for running BABLR parsers",
4
- "version": "0.11.7",
4
+ "version": "0.11.8",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [
@@ -17,16 +17,16 @@
17
17
  },
18
18
  "sideEffects": false,
19
19
  "dependencies": {
20
- "@bablr/agast-helpers": "0.10.1",
21
- "@bablr/agast-vm-helpers": "0.10.0",
22
- "@bablr/io-vm-node": "0.9.0",
23
- "@bablr/boot": "0.11.0",
20
+ "@bablr/agast-helpers": "0.10.2",
21
+ "@bablr/agast-vm-helpers": "0.10.2",
22
+ "@bablr/io-vm-node": "0.9.1",
23
+ "@bablr/boot": "0.11.1",
24
24
  "@bablr/coroutine": "0.1.0",
25
- "@bablr/helpers": "0.25.0",
26
- "@bablr/language-en-cstml": "0.12.0",
27
- "@bablr/language-en-bablr-cli-verbose-output": "0.10.1",
25
+ "@bablr/helpers": "0.25.1",
26
+ "@bablr/language-en-cstml": "0.12.1",
27
+ "@bablr/language-en-bablr-cli-verbose-output": "0.10.2",
28
28
  "@iter-tools/imm-stack": "1.2.0",
29
- "bablr": "0.11.1",
29
+ "bablr": "0.11.2",
30
30
  "color-support": "1.1.3",
31
31
  "commander": "^12.0.0"
32
32
  },