clarity-pattern-parser 10.3.3 → 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 +10 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +10 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10 -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 +11 -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,8 +2850,9 @@
|
|
|
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);
|
|
2855
|
+
unaryPrefix.parent = this;
|
|
2852
2856
|
finalPatterns.push(unaryPrefix);
|
|
2853
2857
|
}
|
|
2854
2858
|
else if (this._isBinary(pattern)) {
|
|
@@ -3215,10 +3219,10 @@
|
|
|
3215
3219
|
};
|
|
3216
3220
|
}
|
|
3217
3221
|
getTokens() {
|
|
3218
|
-
return this.
|
|
3222
|
+
return this.atomPatterns.map(p => p.getTokens()).flat();
|
|
3219
3223
|
}
|
|
3220
3224
|
getTokensAfter(childReference) {
|
|
3221
|
-
if (this.
|
|
3225
|
+
if (this.atomPatterns.indexOf(childReference)) {
|
|
3222
3226
|
const recursiveTokens = this._recursivePatterns.map(p => p.getTokens()).flat();
|
|
3223
3227
|
const binaryTokens = this._binaryPatterns.map(p => p.getTokens()).flat();
|
|
3224
3228
|
return [...recursiveTokens, ...binaryTokens];
|
|
@@ -3243,10 +3247,10 @@
|
|
|
3243
3247
|
return this._parent.getTokensAfter(this);
|
|
3244
3248
|
}
|
|
3245
3249
|
getPatterns() {
|
|
3246
|
-
return this.
|
|
3250
|
+
return this.atomPatterns.map(p => p.getPatterns()).flat();
|
|
3247
3251
|
}
|
|
3248
3252
|
getPatternsAfter(childReference) {
|
|
3249
|
-
if (this.
|
|
3253
|
+
if (this.atomPatterns.indexOf(childReference)) {
|
|
3250
3254
|
const recursivePatterns = this._recursivePatterns.map(p => p.getPatterns()).flat();
|
|
3251
3255
|
const binaryPatterns = this._binaryPatterns.map(p => p.getPatterns()).flat();
|
|
3252
3256
|
return [...recursivePatterns, ...binaryPatterns];
|