clarity-pattern-parser
Advanced tools
Comparing version 11.0.12 to 11.0.14
{ | ||
"name": "clarity-pattern-parser", | ||
"version": "11.0.12", | ||
"version": "11.0.14", | ||
"description": "Parsing Library for Typescript and Javascript.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -175,6 +175,6 @@ import { Sequence } from "../patterns/Sequence"; | ||
const digit = new Regex("digit", "\\d"); | ||
const digits = new Optional("digits", new Repeat("digits", digit, { min: 0 })); | ||
const digits = new Optional("optional-digits", new Repeat("digits", digit, { min: 0 })); | ||
const expected = new Context("digits", digits, [digit]); | ||
const expected = new Context("optional-digits", digits, [digit]); | ||
debugger; | ||
expect(pattern.isEqual(expected)).toBeTruthy(); | ||
@@ -181,0 +181,0 @@ }); |
@@ -343,3 +343,3 @@ import { Node } from "../ast/Node"; | ||
const pattern = this._buildPattern(patternNode); | ||
const finalPattern = isOptional ? new Optional(pattern.name, pattern) : pattern; | ||
const finalPattern = isOptional ? new Optional(`optional-${pattern.name}`, pattern) : pattern; | ||
@@ -414,3 +414,3 @@ if (isNot) { | ||
return isOptional ? new Optional(name, new Repeat(name, pattern, options)) : new Repeat(name, pattern, options); | ||
return isOptional ? new Optional(name, new Repeat(`inner-optional-${name}`, pattern, options)) : new Repeat(name, pattern, options); | ||
} | ||
@@ -417,0 +417,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1306880
22509