From 7b2f1f501a1dc05ca7c5b61726fd61dda6feb609 Mon Sep 17 00:00:00 2001 From: loveencounterflow Date: Sun, 30 Oct 2022 18:29:42 +0100 Subject: [PATCH 1/2] add `u`nicode flag where missing --- moo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moo.js b/moo.js index 5b7fdef..585affc 100644 --- a/moo.js +++ b/moo.js @@ -22,7 +22,7 @@ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') } function reGroups(s) { - var re = new RegExp('|' + s) + var re = new RegExp('|' + s,'u') return re.exec('').length - 1 } function reCapture(s) { @@ -260,7 +260,7 @@ var pat = reUnion(match.map(regexpOrLiteral)) // validate - var regexp = new RegExp(pat) + var regexp = new RegExp(pat,'u') if (regexp.test("")) { throw new Error("RegExp matches empty string: " + regexp) } From cbbcac98fe6829e625671052d52fdb4b3bb674d6 Mon Sep 17 00:00:00 2001 From: loveencounterflow Date: Sun, 30 Oct 2022 18:41:17 +0100 Subject: [PATCH 2/2] update dependencies --- package.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/package.json b/package.json index cd03032..196f1a4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "moo", + "name": "moo-patched", "version": "0.5.2", "description": "Optimised tokenizer/lexer generator! 🐄 Much performance. Moo!", "main": "moo.js", @@ -16,14 +16,5 @@ "test": "jest .", "benchmark": "benchr test/benchmark.js", "moo": "echo 'Mooooo!'" - }, - "devDependencies": { - "benchr": "^3.2.0", - "chevrotain": "4.2.0", - "jest": "24.7.1", - "lex": "^1.7.9", - "lexing": "^0.8.0", - "remix": "^0.1.4", - "tokenizer2": "^2.0.0" } }