@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.
- package/lib/syntax.js +7 -6
- 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
|
}
|