clarity-pattern-parser 11.0.9 → 11.0.11
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 +2 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/grammar/Grammar.ts +1 -1
- package/src/patterns/Regex.ts +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -737,7 +737,7 @@
|
|
|
737
737
|
}
|
|
738
738
|
tryToParse(cursor) {
|
|
739
739
|
const result = this._regex.exec(this._substring);
|
|
740
|
-
if (result != null && result.index === 0) {
|
|
740
|
+
if (result != null && result.length > 0 && result.index === 0) {
|
|
741
741
|
this.processResult(cursor, result);
|
|
742
742
|
}
|
|
743
743
|
else {
|
|
@@ -3673,7 +3673,7 @@
|
|
|
3673
3673
|
const name = nameNode.value;
|
|
3674
3674
|
const anonymousNode = node.find(n => n.name === "configurable-anonymous-pattern");
|
|
3675
3675
|
const isOptional = node.children[1] != null;
|
|
3676
|
-
const anonymous = isOptional ? new Optional(name, this._buildPattern(anonymousNode)) : this._buildPattern(anonymousNode);
|
|
3676
|
+
const anonymous = isOptional ? new Optional(name, this._buildPattern(anonymousNode.children[0])) : this._buildPattern(anonymousNode.children[0]);
|
|
3677
3677
|
this._parseContext.patternsByName.set(name, anonymous);
|
|
3678
3678
|
}
|
|
3679
3679
|
_buildComplexAnonymousPattern(node) {
|