@bablr/cli 0.11.0 → 0.11.1
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 +17 -17
- package/package.json +1 -1
package/lib/syntax.js
CHANGED
|
@@ -32,7 +32,7 @@ let gapNodeFlags = getFlagsWithGap(nodeFlags);
|
|
|
32
32
|
function* __higlightStrategy(tags) {
|
|
33
33
|
const co = new Coroutine(getStreamIterator(tags));
|
|
34
34
|
|
|
35
|
-
let
|
|
35
|
+
let names = emptyStack;
|
|
36
36
|
|
|
37
37
|
let currentRef;
|
|
38
38
|
|
|
@@ -49,17 +49,17 @@ function* __higlightStrategy(tags) {
|
|
|
49
49
|
|
|
50
50
|
if (tag.type === OpenNodeTag) {
|
|
51
51
|
const tagName = tag.value.name;
|
|
52
|
-
const
|
|
52
|
+
const currentName = names.value;
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
names = names.push(tagName);
|
|
55
55
|
|
|
56
56
|
if (
|
|
57
57
|
tagName === Symbol.for('LiteralTag') ||
|
|
58
58
|
(tagName === Symbol.for('String') && currentRef.name === 'literalValue')
|
|
59
59
|
) {
|
|
60
|
-
if (tagName === Symbol.for('LiteralTag') ||
|
|
60
|
+
if (tagName === Symbol.for('LiteralTag') || currentName === Symbol.for('OpenNodeTag')) {
|
|
61
61
|
yield buildAnsiPushEffect('bold green');
|
|
62
|
-
} else if (
|
|
62
|
+
} else if (currentName === Symbol.for('TreeNodeMatcherOpen')) {
|
|
63
63
|
yield buildAnsiPushEffect('bold orange');
|
|
64
64
|
} else {
|
|
65
65
|
yield buildAnsiPushEffect();
|
|
@@ -68,16 +68,10 @@ function* __higlightStrategy(tags) {
|
|
|
68
68
|
yield buildAnsiPushEffect('bold orange');
|
|
69
69
|
} else if (tagName === Symbol.for('EscapeSequence')) {
|
|
70
70
|
yield buildAnsiPushEffect('bold cyan');
|
|
71
|
-
} else if (tagName === null && tag.value.flags.token) {
|
|
72
|
-
if (currentType === Symbol.for('ReferenceTag')) {
|
|
73
|
-
yield buildAnsiPushEffect('bold gray');
|
|
74
|
-
} else {
|
|
75
|
-
yield buildAnsiPushEffect();
|
|
76
|
-
}
|
|
77
71
|
} else if (tagName === Symbol.for('Identifier')) {
|
|
78
|
-
if (
|
|
72
|
+
if (currentName === Symbol.for('ReferenceTag')) {
|
|
79
73
|
yield buildAnsiPushEffect('bold gray');
|
|
80
|
-
} else if (
|
|
74
|
+
} else if (currentName === Symbol.for('Call')) {
|
|
81
75
|
yield buildAnsiPushEffect('magenta bold');
|
|
82
76
|
} else {
|
|
83
77
|
yield buildAnsiPushEffect();
|
|
@@ -89,12 +83,18 @@ function* __higlightStrategy(tags) {
|
|
|
89
83
|
yield buildAnsiPushEffect('blue bold');
|
|
90
84
|
} else if (
|
|
91
85
|
(currentRef?.name === 'sigilToken' &&
|
|
92
|
-
(
|
|
93
|
-
|
|
94
|
-
(
|
|
86
|
+
(currentName === Symbol.for('ExecSpamexInstructionLine') ||
|
|
87
|
+
currentName === Symbol.for('ExecCSTMLInstructionLine'))) ||
|
|
88
|
+
(currentName === Symbol.for('Call') &&
|
|
95
89
|
(currentRef.name === 'openToken' || currentRef.name === 'closeToken'))
|
|
96
90
|
) {
|
|
97
91
|
yield buildAnsiPushEffect('magenta bold');
|
|
92
|
+
} else if (tagName === null && tag.value.flags.token) {
|
|
93
|
+
if (currentName === Symbol.for('ReferenceTag')) {
|
|
94
|
+
yield buildAnsiPushEffect('bold gray');
|
|
95
|
+
} else {
|
|
96
|
+
yield buildAnsiPushEffect();
|
|
97
|
+
}
|
|
98
98
|
} else {
|
|
99
99
|
yield buildAnsiPushEffect();
|
|
100
100
|
}
|
|
@@ -113,7 +113,7 @@ function* __higlightStrategy(tags) {
|
|
|
113
113
|
yield tag;
|
|
114
114
|
|
|
115
115
|
if (tag.type === CloseNodeTag || (tag.type === OpenNodeTag && tag.value.selfClosing)) {
|
|
116
|
-
|
|
116
|
+
names = names.pop();
|
|
117
117
|
yield buildAnsiPopEffect();
|
|
118
118
|
}
|
|
119
119
|
|