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

feat: implement parsing for heregexes with interpolations #87

Merged

Conversation

alangpierce
Copy link
Member

Progress toward these issues:
decaffeinate/decaffeinate#557
decaffeinate/decaffeinate#341

Just like with strings, we use decaffeinate-parser to unify the two styles of
heregexes (ones with interpolations and ones without) into a single Heregex node
type, and a normal heregexes simply have 0 interpolations. The CoffeeScript
parser treats heregexes with interpolations as a call to the RegExp function
with + operations for the components, so we can add a special case for that
type of node and reuse the code for dealing with string interpolations.

BREAKING CHANGE: Heregex expressions now always use the new Heregex node type
rather than RegExp. In all cases, a Heregex node has an array of quasis and
expressions.

Progress toward these issues:
decaffeinate/decaffeinate#557
decaffeinate/decaffeinate#341

Just like with strings, we use decaffeinate-parser to unify the two styles of
heregexes (ones with interpolations and ones without) into a single Heregex node
type, and a normal heregexes simply have 0 interpolations. The CoffeeScript
parser treats heregexes with interpolations as a call to the `RegExp` function
with `+` operations for the components, so we can add a special case for that
type of node and reuse the code for dealing with string interpolations.

BREAKING CHANGE: Heregex expressions now always use the new Heregex node type
rather than RegExp. In all cases, a Heregex node has an array of quasis and
expressions.
@alangpierce alangpierce merged commit f0abec5 into decaffeinate:master Nov 27, 2016
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