@bablr/cli 0.11.3 → 0.11.5
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 +8 -9
- 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')) {
|
|
@@ -85,9 +86,7 @@ function* __higlightStrategy(tags) {
|
|
|
85
86
|
) {
|
|
86
87
|
yield buildAnsiPushEffect('blue bold');
|
|
87
88
|
} else if (
|
|
88
|
-
(currentRef?.name === 'sigilToken' &&
|
|
89
|
-
(currentName === Symbol.for('ExecSpamexInstructionLine') ||
|
|
90
|
-
currentName === Symbol.for('ExecCSTMLInstructionLine'))) ||
|
|
89
|
+
(currentRef?.name === 'sigilToken' && currentName === Symbol.for('ExecInstructionLine')) ||
|
|
91
90
|
(currentName === Symbol.for('Call') &&
|
|
92
91
|
(currentRef.name === 'openToken' || currentRef.name === 'closeToken'))
|
|
93
92
|
) {
|
|
@@ -158,7 +157,7 @@ export const generateCSTML = (tags, options = {}) => {
|
|
|
158
157
|
input,
|
|
159
158
|
);
|
|
160
159
|
|
|
161
|
-
return higlightStrategy(tags);
|
|
160
|
+
return higlightStrategy(hoistTrivia(tags));
|
|
162
161
|
} else {
|
|
163
162
|
return outputInstructions;
|
|
164
163
|
}
|