archives

« Bugzilla Issues Index

#85 — heredoc support


Many languages support multiline strings through a heredoc type syntax.

Python:
longStr = """This
is
a
multiline
string"""

C#:
string longStr = @"This
is
a
multiline
string";

PHP:
$foo = <<EOF
This
is
a
multiline
string
EOF

ECMAScript supports multiline strings, but the continuation character can be cumbersome

var longString = "This\
is\
a\
multiline\
string";

If you forget the continuation character, it can cause confusion trying to determine where the issue is.


Closing as fixed, since http://wiki.ecmascript.org/doku.php?id=harmony:quasis takes care of this need.