Javascript lexer improvements#773
Conversation
Codecov Report
@@ Coverage Diff @@
## master #773 +/- ##
=============================
=============================
Continue to review full report at Codecov.
|
723e87d to
1034a47
Compare
1034a47 to
b03eae0
Compare
|
Hi @akx . I've been working on this feature for a while. In my setup I need these changes. However I have some problems when using my own fork in my project. So I have some questions regarding using a fork of babel in my project, and also what needs to be done to get this merged, so I don't have to use my fork anymore. In my project, which uses Pipenv. Inside the This works partly. When I run However, when I run my Django devserver, on some requests (not all of them, I'm not sure yet why it only happens on some requests), the request fails with a exception coming from I noticed that when I go into the virtualenv directory (which is created by Pipenv and can be retrieved with I will have to look into the possibilities to integrate this in my project in a way that the locale files would be generated when I build and deploy my project. In the mean time it would be good for us if the changes would eventually be merged into the official package. So I have two questions:
|
|
Closing this MR now, because I splitted this one up in 2 separate MRs:
Please review and reply in the appropriate new MRs. |
Add option
parse_template_stringthat improves parsing of javascript templates expressions, like:And it also works with nested expressions like:
You have to enable template string extraction with an option in the
option_map:Then it should work.
On this branch I also fixed another issue that I was facing. In a JS library that I use, there was regex with a
/inside a character class[a-z]. The babel JS lexer thought this closed the regex, but JavaScript allows this as a normal match character within a character class, and does not close the regex. I updated the regex so that it will cover this exception.