Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unicode flag where missing #181

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions moo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
Expand Down
11 changes: 1 addition & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "moo",
"name": "moo-patched",
"version": "0.5.2",
"description": "Optimised tokenizer/lexer generator! 🐄 Much performance. Moo!",
"main": "moo.js",
Expand All @@ -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"
}
}