Skip to content

Enable unicode property escapes#119

Closed
modernserf wants to merge 1 commit into
no-context:masterfrom
modernserf:support-unicode-property-escapes
Closed

Enable unicode property escapes#119
modernserf wants to merge 1 commit into
no-context:masterfrom
modernserf:support-unicode-property-escapes

Conversation

@modernserf

Copy link
Copy Markdown

Implements #116

Comment thread moo.js
// validate
var regexp = new RegExp(pat)
var flags = unicodeState.hasFlag() ? 'u' : ''
var regexp = new RegExp(pat, flags)

Copy link
Copy Markdown
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}+/

Comment thread test/test.js

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

let supportsUnicodePropertyEscapes = false

Copy link
Copy Markdown
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

tjvr commented Feb 24, 2019

Copy link
Copy Markdown
Collaborator

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