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

Enable unicode property escapes #119

Conversation

modernserf
Copy link

Implements #116

// convert to RegExp
var pat = reUnion(match.map(regexpOrLiteral))

// validate
var regexp = new RegExp(pat)
var flags = unicodeState.hasFlag() ? 'u' : ''
var regexp = new RegExp(pat, flags)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every time we build a RegExp we need to add the u flag, if applicable; otherwise it complains about "nothing to repeat" in patterns like /\u{0075}+/

@@ -8,6 +8,11 @@ const python = require('./python')

function lexAll(lexer) {return Array.from(lexer)}

let supportsUnicodePropertyEscapes = false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there's a better way to feature detect this?

@tjvr
Copy link
Collaborator

tjvr commented Feb 24, 2019

I'm going to close this in favour of #122. Thanks for contributing though! 🙂

Sent with GitHawk

@tjvr tjvr closed this Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants