clarity-pattern-parser 9.1.0 → 9.2.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/grammar/patterns/body.d.ts +2 -2
- package/dist/index.browser.js +7 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +7 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/patterns/Repeat.d.ts +2 -0
- package/package.json +1 -1
- package/src/grammar/patterns/body.ts +1 -1
- package/src/patterns/Repeat.ts +8 -0
|
@@ -21,6 +21,8 @@ export declare class Repeat implements Pattern {
|
|
|
21
21
|
get parent(): Pattern | null;
|
|
22
22
|
set parent(value: Pattern | null);
|
|
23
23
|
get children(): Pattern[];
|
|
24
|
+
get min(): any;
|
|
25
|
+
get max(): any;
|
|
24
26
|
constructor(name: string, pattern: Pattern, options?: RepeatOptions);
|
|
25
27
|
parse(cursor: Cursor): Node | null;
|
|
26
28
|
exec(text: string): ParseResult;
|
package/package.json
CHANGED
package/src/patterns/Repeat.ts
CHANGED
|
@@ -52,6 +52,14 @@ export class Repeat implements Pattern {
|
|
|
52
52
|
return this._children;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
get min() {
|
|
56
|
+
return (this.children[0] as any).min;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get max() {
|
|
60
|
+
return (this.children[0] as any).max || Infinity;
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
constructor(name: string, pattern: Pattern, options: RepeatOptions = {}) {
|
|
56
64
|
this._id = `repeat-${idIndex++}`;
|
|
57
65
|
this._pattern = pattern;
|