parseman 0.7.0 → 0.7.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/dist/combinators/scanTo.d.ts.map +1 -1
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +2 -2
- package/dist/plugin/index.cjs +6 -1
- package/dist/plugin/index.cjs.map +2 -2
- package/dist/plugin/index.js +6 -1
- package/dist/plugin/index.js.map +2 -2
- package/package.json +1 -1
package/dist/plugin/index.js
CHANGED
|
@@ -2760,7 +2760,11 @@ function scanTo(sentinel, { skip: skip2 = [], orEOF = false } = {}) {
|
|
|
2760
2760
|
};
|
|
2761
2761
|
}
|
|
2762
2762
|
function balanced(open, close, options = {}) {
|
|
2763
|
-
const
|
|
2763
|
+
const self = ref();
|
|
2764
|
+
const inner = scanTo(literal(close), {
|
|
2765
|
+
...options,
|
|
2766
|
+
skip: [self, ...options.skip ?? []]
|
|
2767
|
+
});
|
|
2764
2768
|
const combi = transform(
|
|
2765
2769
|
sequence(literal(open), inner, literal(close)),
|
|
2766
2770
|
([o, content, c]) => o + content + c
|
|
@@ -2768,6 +2772,7 @@ function balanced(open, close, options = {}) {
|
|
|
2768
2772
|
if (combi._def.tag === "transform") {
|
|
2769
2773
|
combi._def.fnSrc = "([o, content, c]) => o + content + c";
|
|
2770
2774
|
}
|
|
2775
|
+
self.define(combi);
|
|
2771
2776
|
return combi;
|
|
2772
2777
|
}
|
|
2773
2778
|
|