lydell / js-tokens

Tiny JavaScript tokenizer.
MIT License
503 stars 31 forks source link

js-tokens can not match variables in template string. #7

Closed janryWang closed 7 years ago

janryWang commented 7 years ago

like this

jsTokens.exec("`hello world ${variable + `a + ${b}`} `")

Under normal circumstances, it can match variable and b

lydell commented 7 years ago

https://github.com/lydell/js-tokens/blob/54549dd979142c78cf629b51f9f06e8133c529f9/README.md#template-string-interpolation

janryWang commented 7 years ago

fine ,but

jsToken.exec("`hello world ${`{{{{{$1111111`}`   ddddddd")

will not match hello world ${{{{{{$1111111} and ddddddd

lydell commented 7 years ago

It's explained in the same link as well:

Only one level of nesting is supported.

janryWang commented 7 years ago

Ok , thx