September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1 +0,0 @@
|
|||
auto s = q"[a string that you "don't" have to escape]";
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
writefln(q"EOS
|
||||
This
|
||||
is a multi-line
|
||||
heredoc string
|
||||
EOS"
|
||||
);
|
||||
28
Task/Here-document/Kotlin/here-document.kotlin
Normal file
28
Task/Here-document/Kotlin/here-document.kotlin
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// version 1.1.0
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val ev = "embed variables"
|
||||
|
||||
val here = """
|
||||
This is a raw string literal
|
||||
which does not treat escaped characters
|
||||
(\t, \b, \n, \r, \', \", \\, \$ and \u)
|
||||
specially and can contain new lines,
|
||||
indentation and other whitespace
|
||||
within the string.
|
||||
|
||||
"Quotes" or doubled ""quotes"" can
|
||||
be included without problem but not
|
||||
tripled quotes.
|
||||
|
||||
It's also possible to $ev
|
||||
in a raw string literal using string
|
||||
interpolation.
|
||||
|
||||
If you need to include a
|
||||
literal ${'$'} sign in a raw string literal then
|
||||
don't worry you've just done it!
|
||||
"""
|
||||
|
||||
println(here)
|
||||
}
|
||||
9
Task/Here-document/Zkl/here-document.zkl
Normal file
9
Task/Here-document/Zkl/here-document.zkl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
x:=
|
||||
#<<<
|
||||
"#<<< starts a block of lines that are concatenated verbatim
|
||||
and fed into the parser as one line. #<<< ends the block.
|
||||
Both #<<< tokens must start the line that is otherwise ignored
|
||||
|
||||
Note that is isn't a string, but arbitrary source " + 1 + 23;
|
||||
#<<<
|
||||
x.println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue