diff --git a/package-lock.json b/package-lock.json index 90a6fb250e..9d18994894 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6005,20 +6005,12 @@ } }, "refa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/refa/-/refa-0.7.0.tgz", - "integrity": "sha512-1QvdsiF7+bHLTiSlsl9CVP3K2+SpiG1dzJGf757sETf8PDLcV+D+hzAT7Nux8Qh1/lF+eE3AZqupBaWeshDx0g==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.8.0.tgz", + "integrity": "sha512-qOf9zk1McAuGPtQ16nzuWCUg9zx3Quc48i6oD6nxWJdrFeh3Do0vCpIGYLij/1ysAbh5rxdUNg+YzSVBRycX5g==", "dev": true, "requires": { "regexpp": "^3.1.0" - }, - "dependencies": { - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - } } }, "regenerator-runtime": { @@ -6037,10 +6029,20 @@ "safe-regex": "^1.1.0" } }, + "regexp-ast-analysis": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.2.0.tgz", + "integrity": "sha512-ZVNwBF65Gn4CbRdPNYle8NAPFSDbbJ83svYUk4Mpqmr1QTUx2M06my9x7o8Hw/oFXDwXrJo/7W+ijLfFM5oG2Q==", + "dev": true, + "requires": { + "refa": "^0.8.0", + "regexpp": "^3.1.0" + } + }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "regextras": { @@ -6341,30 +6343,14 @@ } }, "scslre": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.1.1.tgz", - "integrity": "sha512-wsv9uvkNtTMIgNCRDY/Ys4ho//ltm/Fm+KgNMdn0de2TyBtU3O3OOw7E10Kxv4Acd2Gs6cQfODl0jvYvvK0dDA==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.1.3.tgz", + "integrity": "sha512-bJLnVqL3J3j+IwQGcOD81Ze2qdNH8IrjKz07MsxGV0EUE/OmlrFqfKHFUSUUkwefMwzZrGbuNlfQEDN9U9+a3A==", "dev": true, "requires": { - "refa": "^0.6.0", + "refa": "^0.8.0", + "regexp-ast-analysis": "^0.2.0", "regexpp": "^3.1.0" - }, - "dependencies": { - "refa": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/refa/-/refa-0.6.0.tgz", - "integrity": "sha512-jLBM8hbYs04CfiCG9ysn2XhANnRQWBtnv/1v0Qn3uixgW0vUe9Zr++xwyFsejaQkEgPg30K1X76yz46r5AZQSQ==", - "dev": true, - "requires": { - "regexpp": "^3.1.0" - } - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - } } }, "secure-compare": { diff --git a/package.json b/package.json index a86c549048..b58d947e05 100755 --- a/package.json +++ b/package.json @@ -52,9 +52,9 @@ "jsdom": "^13.0.0", "mocha": "^6.2.0", "pump": "^3.0.0", - "refa": "^0.7.0", - "regexpp": "^2.0.1", - "scslre": "^0.1.1", + "refa": "^0.8.0", + "regexpp": "^3.1.0", + "scslre": "^0.1.3", "simple-git": "^1.107.0", "webfont": "^9.0.0", "yargs": "^13.2.2" diff --git a/tests/pattern-tests.js b/tests/pattern-tests.js index 90535e4489..242c98dfdf 100644 --- a/tests/pattern-tests.js +++ b/tests/pattern-tests.js @@ -8,7 +8,7 @@ const TestCase = require('./helper/test-case'); const { BFS, parseRegex } = require('./helper/util'); const { languages } = require('../components.json'); const { visitRegExpAST } = require('regexpp'); -const { transform, combineTransformers, JS, Words, NFA, Transformers } = require('refa'); +const { transform, combineTransformers, getIntersectionWordSets, JS, Words, NFA, Transformers } = require('refa'); const scslre = require('scslre'); const path = require('path'); @@ -613,7 +613,7 @@ function checkExponentialBacktracking(path, pattern, ast) { twoStar.quantify(2, Infinity); if (!nfa.isDisjointWith(twoStar)) { - const word = Words.pickMostReadableWord(firstOf(nfa.intersectionWordSets(twoStar))); + const word = Words.pickMostReadableWord(firstOf(getIntersectionWordSets(nfa, twoStar))); const example = Words.fromUnicodeToString(word); assert.fail(`${path}: The quantifier \`${node.raw}\` ambiguous for all words ${JSON.stringify(example)}.repeat(n) for any n>1.` + ` This will cause exponential backtracking.`