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
[Feature request] String interpolation (like Swift) #1
Comments
That's interesting, such interpolation can be solved in two steps:
Do you have ideas how to solve |
Yes, I was trying to solve this problem by looping every character and add some logic, but I found that the custom string literal, because will be parsed as a string, cannot contain the "\(" syntax because the char "(" will in a certain way escape the parenthesis, also if there isn't a reason. Before continue, this should be solved... |
Let's add it :)! Are you willing for a PR? |
Yes, of course! How can I solve? Could be "parseTemplate" is not the good one? (I am trying to learn with source code but could be the way I found is not appropriate)... |
If you talking about The simplest possible way would be to construct template expression and then just pass it to Anyways the method to override should be |
About
Javascript string interpolation is not always clear:
More about Swift string interpolation here: https://www.hackingwithswift.com/sixty/1/5/string-interpolation
Here is how it will look like:
And here is how it looks in JavaScript:
The text was updated successfully, but these errors were encountered: