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.js
CHANGED
|
@@ -1048,8 +1048,11 @@ class Options {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
getTokens() {
|
|
1050
1050
|
const tokens = [];
|
|
1051
|
-
for (const
|
|
1052
|
-
|
|
1051
|
+
for (const pattern of this._children) {
|
|
1052
|
+
if (pattern.type === "reference" && pattern.name === this.name) {
|
|
1053
|
+
continue;
|
|
1054
|
+
}
|
|
1055
|
+
tokens.push(...pattern.getTokens());
|
|
1053
1056
|
}
|
|
1054
1057
|
return tokens;
|
|
1055
1058
|
}
|
|
@@ -1068,6 +1071,9 @@ class Options {
|
|
|
1068
1071
|
getPatterns() {
|
|
1069
1072
|
const patterns = [];
|
|
1070
1073
|
for (const pattern of this._children) {
|
|
1074
|
+
if (pattern.type === "reference" && pattern.name === this.name) {
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1071
1077
|
patterns.push(...pattern.getPatterns());
|
|
1072
1078
|
}
|
|
1073
1079
|
return patterns;
|
|
@@ -1795,9 +1801,12 @@ class Sequence {
|
|
|
1795
1801
|
}
|
|
1796
1802
|
getTokens() {
|
|
1797
1803
|
const tokens = [];
|
|
1798
|
-
for (const
|
|
1799
|
-
|
|
1800
|
-
|
|
1804
|
+
for (const pattern of this._children) {
|
|
1805
|
+
if (pattern.type === "reference" && pattern.name === this.name && pattern === this.children[0]) {
|
|
1806
|
+
return tokens;
|
|
1807
|
+
}
|
|
1808
|
+
tokens.push(...pattern.getTokens());
|
|
1809
|
+
if (pattern.type !== "optional" && pattern.type !== "not") {
|
|
1801
1810
|
break;
|
|
1802
1811
|
}
|
|
1803
1812
|
}
|
|
@@ -1817,9 +1826,12 @@ class Sequence {
|
|
|
1817
1826
|
}
|
|
1818
1827
|
getPatterns() {
|
|
1819
1828
|
const patterns = [];
|
|
1820
|
-
for (const
|
|
1821
|
-
|
|
1822
|
-
|
|
1829
|
+
for (const pattern of this._children) {
|
|
1830
|
+
if (pattern.type === "reference" && pattern.name === this.name && pattern === this.children[0]) {
|
|
1831
|
+
return patterns;
|
|
1832
|
+
}
|
|
1833
|
+
patterns.push(...pattern.getPatterns());
|
|
1834
|
+
if (pattern.type !== "optional" && pattern.type !== "not") {
|
|
1823
1835
|
break;
|
|
1824
1836
|
}
|
|
1825
1837
|
}
|