clarity-pattern-parser 10.1.20 → 10.1.21
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 +20 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +20 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/intellisense/AutoComplete.test.ts +85 -0
- package/src/patterns/ExpressionPattern.ts +36 -1
- package/src/patterns/Options.ts +8 -2
- package/src/patterns/RightAssociatedPattern.ts +71 -0
- package/src/patterns/Sequence.ts +14 -6
package/dist/index.esm.js
CHANGED
|
@@ -1044,8 +1044,11 @@ class Options {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
getTokens() {
|
|
1046
1046
|
const tokens = [];
|
|
1047
|
-
for (const
|
|
1048
|
-
|
|
1047
|
+
for (const pattern of this._children) {
|
|
1048
|
+
if (pattern.type === "reference" && pattern.name === this.name) {
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
tokens.push(...pattern.getTokens());
|
|
1049
1052
|
}
|
|
1050
1053
|
return tokens;
|
|
1051
1054
|
}
|
|
@@ -1064,6 +1067,9 @@ class Options {
|
|
|
1064
1067
|
getPatterns() {
|
|
1065
1068
|
const patterns = [];
|
|
1066
1069
|
for (const pattern of this._children) {
|
|
1070
|
+
if (pattern.type === "reference" && pattern.name === this.name) {
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1067
1073
|
patterns.push(...pattern.getPatterns());
|
|
1068
1074
|
}
|
|
1069
1075
|
return patterns;
|
|
@@ -1791,9 +1797,12 @@ class Sequence {
|
|
|
1791
1797
|
}
|
|
1792
1798
|
getTokens() {
|
|
1793
1799
|
const tokens = [];
|
|
1794
|
-
for (const
|
|
1795
|
-
|
|
1796
|
-
|
|
1800
|
+
for (const pattern of this._children) {
|
|
1801
|
+
if (pattern.type === "reference" && pattern.name === this.name && pattern === this.children[0]) {
|
|
1802
|
+
return tokens;
|
|
1803
|
+
}
|
|
1804
|
+
tokens.push(...pattern.getTokens());
|
|
1805
|
+
if (pattern.type !== "optional" && pattern.type !== "not") {
|
|
1797
1806
|
break;
|
|
1798
1807
|
}
|
|
1799
1808
|
}
|
|
@@ -1813,9 +1822,12 @@ class Sequence {
|
|
|
1813
1822
|
}
|
|
1814
1823
|
getPatterns() {
|
|
1815
1824
|
const patterns = [];
|
|
1816
|
-
for (const
|
|
1817
|
-
|
|
1818
|
-
|
|
1825
|
+
for (const pattern of this._children) {
|
|
1826
|
+
if (pattern.type === "reference" && pattern.name === this.name && pattern === this.children[0]) {
|
|
1827
|
+
return patterns;
|
|
1828
|
+
}
|
|
1829
|
+
patterns.push(...pattern.getPatterns());
|
|
1830
|
+
if (pattern.type !== "optional" && pattern.type !== "not") {
|
|
1819
1831
|
break;
|
|
1820
1832
|
}
|
|
1821
1833
|
}
|