asyncLiz / parse-literals

Parse template literals from code
MIT License
9 stars 2 forks source link

Failure at parsing expression with /* comments inside */ #13

Closed minht11 closed 3 years ago

minht11 commented 4 years ago

Minifier fails to parse if comment is found next to expression inside template literal: Parse Error: <div .icon=@TEMPLATE_EXPRESSION();* Some comment */}></div>

Code example that causes the problem:

html`<div .icon=${0/* Some comment */}></div>

Reproduction https://repl.it/repls/ImmaterialPointedInternet

This makes using Typescript const enums and minification impossible.

asyncLiz commented 3 years ago

Thanks for the bug! Looks like this is an underlying issue with parse-literals, so I'm going to move this issue to that repo

asyncLiz commented 3 years ago

Fixed on main branch