@bablr/bablr-vm 0.23.8 → 0.23.9
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/utils/pattern.js +8 -4
- package/package.json +1 -1
package/lib/utils/pattern.js
CHANGED
|
@@ -131,11 +131,13 @@ function* __stringEqual(str, iterable) {
|
|
|
131
131
|
let strStep = strIter.next();
|
|
132
132
|
step = iter.next();
|
|
133
133
|
|
|
134
|
-
while (
|
|
134
|
+
while (true) {
|
|
135
135
|
if (step instanceof Promise) {
|
|
136
136
|
step = yield wait(step);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
if (strStep.done) break;
|
|
140
|
+
|
|
139
141
|
if (step.value !== strStep.value) {
|
|
140
142
|
step = iter.return();
|
|
141
143
|
if (step instanceof Promise) {
|
|
@@ -166,9 +168,11 @@ export const match = (pattern, source) => {
|
|
|
166
168
|
? [buildOpenNodeTag(tokenFlags), buildLiteralTag(pattern), buildCloseNodeTag()]
|
|
167
169
|
: null;
|
|
168
170
|
} else if (typeof pattern === 'string') {
|
|
169
|
-
return stringEqual(pattern, source)
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
return maybeWait(stringEqual(pattern, source), (equal) => {
|
|
172
|
+
return equal
|
|
173
|
+
? [buildOpenNodeTag(tokenFlags), buildLiteralTag(pattern), buildCloseNodeTag()]
|
|
174
|
+
: null;
|
|
175
|
+
});
|
|
172
176
|
}
|
|
173
177
|
|
|
174
178
|
const pattern_ =
|