Multi-line quasi literals

2012-01-20 Thread Luke Hoban
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 
http://wiki.ecmascript.org/doku.php?id=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

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Multi-line quasi literals

2012-01-20 Thread Mike Samuel
2012/1/20 Luke Hoban lu...@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.

http://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.

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Multi-line quasi literals

2012-01-20 Thread Brendan Eich
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.

/be


Mike Samuel mailto:mikesam...@gmail.com
January 20, 2012 9:47 AM

+1.

Some IDEs provide mechanisms that automatically strip whitespace on
save, but I think those will have to change for ES.next anyway.

http://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.

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Luke Hoban mailto:lu...@microsoft.com
January 19, 2012 11:11 PM
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 
http://wiki.ecmascript.org/doku.php?id=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

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Multi-line quasi literals

2012-01-20 Thread Mike Samuel
2012/1/20 Brendan Eich bren...@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.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss