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.cjs
CHANGED
|
@@ -2795,7 +2795,11 @@ function scanTo(sentinel, { skip: skip2 = [], orEOF = false } = {}) {
|
|
|
2795
2795
|
};
|
|
2796
2796
|
}
|
|
2797
2797
|
function balanced(open, close, options = {}) {
|
|
2798
|
-
const
|
|
2798
|
+
const self = ref();
|
|
2799
|
+
const inner = scanTo(literal(close), {
|
|
2800
|
+
...options,
|
|
2801
|
+
skip: [self, ...options.skip ?? []]
|
|
2802
|
+
});
|
|
2799
2803
|
const combi = transform(
|
|
2800
2804
|
sequence(literal(open), inner, literal(close)),
|
|
2801
2805
|
([o, content, c]) => o + content + c
|
|
@@ -2803,6 +2807,7 @@ function balanced(open, close, options = {}) {
|
|
|
2803
2807
|
if (combi._def.tag === "transform") {
|
|
2804
2808
|
combi._def.fnSrc = "([o, content, c]) => o + content + c";
|
|
2805
2809
|
}
|
|
2810
|
+
self.define(combi);
|
|
2806
2811
|
return combi;
|
|
2807
2812
|
}
|
|
2808
2813
|
|