Add string interpolation#518
Conversation
|
I am testing the interpolation begin escape and I have found that when I use the escape without adding any interpolated expression, there is an error, since the interpolated string is treated as the regular string and it does not accept the escaped
|
|
Besides, I still considered Ruby-style interpolation in meantime and now I think this might be better idea, since:
I respect your opinion about interpolation syntax and your time but we develop Scriban for people who use it, not for only both of us. And the change will remain mostly my business after all. |
Don't treat it as a regular string, but as an interpolated string that doesn't have interpolations. That will avoid entirely the problem. Roundtrip of Scriban text should be preserved anyway, so you would have to keep this information around.
No need to change your PR on that aspect. Your PR is close to completion really.
Just to clarify, all the OSS I develop, that's primarily for my personal usage 🙂. I don't develop things for others, but I'm willing to share with others if that is useful and it is not a huge burden for me to maintain. If you contribute to this repo, it means that it is something I'm ok to "support", you can go away and do something else in your life, I will still support it. |
Add new tests
|
Please include more tests with nested interpolation |
…en direcly embedded into interpolated expression (thanks to lofcz for pointing conditional expression scenario) Add some new tests
|
@ranger-turtle Thanks for the changes, much appreciated, it's looking good. Could you push the "Resolve Conversation" buttons above for the items that you have already resolved so that I can reason about what is left. |
@xoofx Done. I think you need to check if the error messages I have added in last two commits are friendly enough. |
|
Thanks @ranger-turtle for the hard work! I'll update the doc as well and will probably release a new version that includes it in the coming days or next week. |
Oh, ok different topic. There is an exe in the solution to generate such doc, it's not done manually. No problem I will verify the doc. |
This comment was marked as spam.
This comment was marked as spam.
|
Btw @ranger-turtle, I have updated Scriban in kalk and String interpolation works out of the box 🙂 |
|
@xoofx Just like in other software dependent on Scriban, including MakiSei, one of the my projects. Merci. |
Pull Request Test Coverage Report for Build 6058994959Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |


This is my first attempt to add string interpolation to Scriban.
I could not make the Parser and Lexer to discard
$character fully, since it is needed byScriptPrinter. Maybe I have overlooked something but I am not sure.It might close #476 .