@bablr/cli 0.11.3 → 0.11.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.
Files changed (2) hide show
  1. package/lib/syntax.js +7 -6
  2. package/package.json +1 -1
package/lib/syntax.js CHANGED
@@ -5,7 +5,7 @@ import cstml from '@bablr/language-en-cstml';
5
5
  import verboseOutput from '@bablr/language-en-bablr-cli-verbose-output';
6
6
  import { streamParse } from 'bablr/enhanceable';
7
7
  import { Coroutine } from '@bablr/coroutine';
8
- import { StreamIterable, getStreamIterator, wait } from '@bablr/agast-helpers/stream';
8
+ import { StreamIterable, getStreamIterator, hoistTrivia, wait } from '@bablr/agast-helpers/stream';
9
9
  import {
10
10
  generateAllOutput,
11
11
  writeCSTMLStrategy,
@@ -54,18 +54,19 @@ function* __higlightStrategy(tags) {
54
54
  names = names.push(tagName);
55
55
 
56
56
  if (
57
+ tagName === Symbol.for('Pattern') ||
58
+ (tagName === Symbol.for('String') && currentName === Symbol.for('TreeNodeMatcherOpen'))
59
+ ) {
60
+ yield buildAnsiPushEffect('bold orange');
61
+ } else if (
57
62
  tagName === Symbol.for('LiteralTag') ||
58
63
  (tagName === Symbol.for('String') && currentRef.name === 'literalValue')
59
64
  ) {
60
65
  if (tagName === Symbol.for('LiteralTag') || currentName === Symbol.for('OpenNodeTag')) {
61
66
  yield buildAnsiPushEffect('bold green');
62
- } else if (currentName === Symbol.for('TreeNodeMatcherOpen')) {
63
- yield buildAnsiPushEffect('bold orange');
64
67
  } else {
65
68
  yield buildAnsiPushEffect();
66
69
  }
67
- } else if (tagName === Symbol.for('Pattern')) {
68
- yield buildAnsiPushEffect('bold orange');
69
70
  } else if (tagName === Symbol.for('EscapeSequence')) {
70
71
  yield buildAnsiPushEffect('bold cyan');
71
72
  } else if (tagName === Symbol.for('Identifier')) {
@@ -158,7 +159,7 @@ export const generateCSTML = (tags, options = {}) => {
158
159
  input,
159
160
  );
160
161
 
161
- return higlightStrategy(tags);
162
+ return higlightStrategy(hoistTrivia(tags));
162
163
  } else {
163
164
  return outputInstructions;
164
165
  }
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.3",
4
+ "version": "0.11.4",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [