clarity-pattern-parser 10.3.4 → 10.3.5
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/index.browser.js +9 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +9 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/patterns/ExpressionPattern.d.ts +2 -1
- package/package.json +1 -1
- package/src/patterns/ExpressionPattern.ts +10 -6
package/dist/index.browser.js
CHANGED
|
@@ -2802,7 +2802,10 @@
|
|
|
2802
2802
|
get children() {
|
|
2803
2803
|
return this._patterns;
|
|
2804
2804
|
}
|
|
2805
|
-
get
|
|
2805
|
+
get unaryPrefixPatterns() {
|
|
2806
|
+
return this._unaryPrefixPatterns;
|
|
2807
|
+
}
|
|
2808
|
+
get atomPatterns() {
|
|
2806
2809
|
return this._atomPatterns;
|
|
2807
2810
|
}
|
|
2808
2811
|
get binaryPatterns() {
|
|
@@ -2847,7 +2850,7 @@
|
|
|
2847
2850
|
this._shouldCompactPatternsMap[pattern.name] = pattern.shouldCompactAst;
|
|
2848
2851
|
if (this._isUnary(pattern)) {
|
|
2849
2852
|
const unaryPrefix = this._extractUnaryPrefixPattern(pattern).clone();
|
|
2850
|
-
this._unaryPrefixPatterns.push(
|
|
2853
|
+
this._unaryPrefixPatterns.push(unaryPrefix);
|
|
2851
2854
|
this._unaryPrefixNames.push(pattern.name);
|
|
2852
2855
|
unaryPrefix.parent = this;
|
|
2853
2856
|
finalPatterns.push(unaryPrefix);
|
|
@@ -3216,10 +3219,10 @@
|
|
|
3216
3219
|
};
|
|
3217
3220
|
}
|
|
3218
3221
|
getTokens() {
|
|
3219
|
-
return this.
|
|
3222
|
+
return this.atomPatterns.map(p => p.getTokens()).flat();
|
|
3220
3223
|
}
|
|
3221
3224
|
getTokensAfter(childReference) {
|
|
3222
|
-
if (this.
|
|
3225
|
+
if (this.atomPatterns.indexOf(childReference)) {
|
|
3223
3226
|
const recursiveTokens = this._recursivePatterns.map(p => p.getTokens()).flat();
|
|
3224
3227
|
const binaryTokens = this._binaryPatterns.map(p => p.getTokens()).flat();
|
|
3225
3228
|
return [...recursiveTokens, ...binaryTokens];
|
|
@@ -3244,10 +3247,10 @@
|
|
|
3244
3247
|
return this._parent.getTokensAfter(this);
|
|
3245
3248
|
}
|
|
3246
3249
|
getPatterns() {
|
|
3247
|
-
return this.
|
|
3250
|
+
return this.atomPatterns.map(p => p.getPatterns()).flat();
|
|
3248
3251
|
}
|
|
3249
3252
|
getPatternsAfter(childReference) {
|
|
3250
|
-
if (this.
|
|
3253
|
+
if (this.atomPatterns.indexOf(childReference)) {
|
|
3251
3254
|
const recursivePatterns = this._recursivePatterns.map(p => p.getPatterns()).flat();
|
|
3252
3255
|
const binaryPatterns = this._binaryPatterns.map(p => p.getPatterns()).flat();
|
|
3253
3256
|
return [...recursivePatterns, ...binaryPatterns];
|