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/index.js
CHANGED
|
@@ -2902,7 +2902,11 @@ function scanTo(sentinel, { skip: skip2 = [], orEOF = false } = {}) {
|
|
|
2902
2902
|
};
|
|
2903
2903
|
}
|
|
2904
2904
|
function balanced(open, close, options = {}) {
|
|
2905
|
-
const
|
|
2905
|
+
const self = ref();
|
|
2906
|
+
const inner = scanTo(literal(close), {
|
|
2907
|
+
...options,
|
|
2908
|
+
skip: [self, ...options.skip ?? []]
|
|
2909
|
+
});
|
|
2906
2910
|
const combi = transform(
|
|
2907
2911
|
sequence(literal(open), inner, literal(close)),
|
|
2908
2912
|
([o, content, c]) => o + content + c
|
|
@@ -2910,6 +2914,7 @@ function balanced(open, close, options = {}) {
|
|
|
2910
2914
|
if (combi._def.tag === "transform") {
|
|
2911
2915
|
combi._def.fnSrc = "([o, content, c]) => o + content + c";
|
|
2912
2916
|
}
|
|
2917
|
+
self.define(combi);
|
|
2913
2918
|
return combi;
|
|
2914
2919
|
}
|
|
2915
2920
|
|