-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Support 'template string' ('string interpolation') #4634
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
Conversation
|
Please also check my comments in this commit: aiya000@e4e7d0d. |
5048469 to
d8e0211
Compare
|
Appveyor says But I don't have any ideas about this. |
Maybe no. |
|
@k-takata Thanks a lot! |
|
@k-takata Thanks π |
Codecov Report
@@ Coverage Diff @@
## master #4634 +/- ##
==========================================
+ Coverage 87.39% 87.43% +0.04%
==========================================
Files 143 143
Lines 158229 158419 +190
==========================================
+ Hits 138277 138513 +236
+ Misses 19952 19906 -46
Continue to review full report at Codecov.
|
|
According to the result of codecov, it seems that your test is not executed on CI. source test_string_interpolation.vimin |
|
@k-takata Sorry, Now I'm working to fix problems. |
Co-authored-by: K.Takata <[email protected]>
|
Error: thread too long |
|
@Houl Sorry, what do you mean? :) |
|
@brammool Hi, Bram :D |
|
@brammool Hi. |
|
@brammool Hi.
Should we include an implementation for vim9script into this PR?
Eventually, yes. Since it's an expression, which needs to be compiled.
But let's first see about the current implementation (sorry, didn't get
to looking at the most recent changes, bug repors keep me busy).
β¦--
If Microsoft would build a car...
... You'd have to press the "Start" button to turn the engine off.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
|
@brammool Thank you for your reply! I understood that you are in keeping busy π When you are no longer in busy, I would be grateful if you see the current implementation :D Thank you! |
|
Is this actual syntax? If at all, I hope the syntax will be otherwise it will be impossible to skip these new string literals using a single regexp. |
|
@Houl The first half is actual syntax :) |
|
Is this actual syntax?
" Quotes in quotes
echo $'${'*'}'
echo $"${"*"}"
If at all, I hope the syntax will be
echo $'${''*''}'
echo $"${\"*\"}"
otherwise it will be impossible to skip these new string literals
using a single regexp.
The expression inside the ${} will be a normal expression, no escaping
needed. There also can be line breaks inside the ${}. With Vim9 that
won't even require the leading backslash.
The trailing "}" is found by skipping over the expression, thus other
"}" can be inside the expression, so long as there is no syntax error.
This is very similar to Javascript/Typescript use of backtick strings.
It will be a challenge to recognize this with a regexp.
β¦--
A real patriot is the fellow who gets a parking ticket and rejoices
that the system works.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
|
The idea was to skip over |
|
Wish: |
Is this meaning the C function? |
|
@aiya000 I've been following this since your original post in June of 2019 and I'm so impressed with your patience and commitment to getting this integrated into |
|
@austintraver This PR was so hard for me, because this is the first contribution of Vim. Thank you :D |
|
Great work ! |
This motivation is here => #4491 :)
This is a version that omitted the '_' support.
(Please see #4491 (comment))
Please take this patch if you agree to this π
Or let's discuss again at #4491 if Bram really want to '_' :D