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
Messed up location in TemplateLiteral #167
Comments
I thought this was fixed? ff71744 I'm on cellphone, can't confirm. The AST explorer version is old. |
You're right AST explorer is pretty old, which is quite inconvenient for testing and debugging :( Based on the initial observations in my real program, it looked like the start of the If you think this isn't the case I can debug further with my real program, I didn't notice AST Explorer was so old. |
Yes, pls verify with latest meriyah locally. |
@3cp You can put the same code in there: https://meriyah.github.io/meriyah/ I also observed that if you remove the |
@jods This is JSX not template |
@KFlash I don't understand? I unchecked JSX and checked module in the left sidebar. EDIT: I think I understand, you saw the default page content :) (Also to whomever maintains this page: in AST explorer the ability to hover code and highlight AST -- and vice-versa -- is really handy.) |
I did a comparison here. start & end values is off by 1 a few places,. I guess the whitespace screw this up. Template tail start at 54 and end at 54. If you consume a backtick the end value should increase with +1. So the value should be 54 - 55. Not sure about column values |
Open this in AST explorer:
https://astexplorer.net/#/gist/5456736625f73c2da2f35c1d2d7deca5/679cef422dad9ffff19e0894129d3f58ecb98740
The code is simply:
Now observe the
loc
of theTemplateLiteral
and itsquasis
(theexpressions
seem ok).TemplateLiteral.loc
seem to start at the first expression hole.Quasis
loc
end before they start, or are zero-length.The text was updated successfully, but these errors were encountered: