Multi-line quasi literals
2012/1/20 Luke Hoban <lukeh at microsoft.com>:
My feeling is that: a) Multi-line string literals are important and should be supported in quasis. b) Trailing whitespace should be allowed and preserved. It is a useful for quasis to be "as literal as possible".
This came up in side conversation at the TC39 meeting today - wanted to send mail to see if the open issue can be resolved.
+1.
Some IDEs provide mechanisms that automatically strip whitespace on save, but I think those will have to change for ES.next anyway.
www.velocityreviews.com/forums/t144789-eclipse-stripping-whitespace-at-eol.html
""" For javascript got to 'save actions' select "Perform the selected actions on save" Check "Additional Actions" and click on configure. choose the "code organizing" tab
Check "Remove trailing whitespace"
This will remove trailing white space from all lines every time you save. You can optionally ignore empty lines. """
We should not have any doubts about this point. Quasis mean almost-verbatim, including literal unescaped newlines and all spaces.
Mike, will you update the wiki?
Thanks for bringing this up, Luke.
2012/1/20 Brendan Eich <brendan at mozilla.org>:
We should not have any doubts about this point. Quasis mean almost-verbatim, including literal unescaped newlines and all spaces.
Mike, will you update the wiki?
Will do.
One of the valuable use cases for quasis that we've discussed is multi-line string literals. It was just pointed out to me that the current proposal page mentions an open issue which calls into question multi-line string literals and the exact semantics of them. This is in harmony:quasis "Line Continuation and Line Terminators".
The concern raised there is about trailing whitespace at the end of lines, and in particular issues related to source control and end-of-line escapes.
My feeling is that: a) Multi-line string literals are important and should be supported in quasis. b) Trailing whitespace should be allowed and preserved. It is a useful for quasis to be "as literal as possible".
This came up in side conversation at the TC39 meeting today - wanted to send mail to see if the open issue can be resolved.
Luke