September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#var c := #65. // character
|
||||
#var s := "some text". // UTF-8 literal
|
||||
#var w := "some wide text". // UTF-16 literal
|
||||
#var s2 := "text with ""quotes"" and "#13#10"two lines".
|
||||
var c := $65. // character
|
||||
var s := "some text". // UTF-8 literal
|
||||
var w := "some wide text"w. // UTF-16 literal
|
||||
var s2 := "text with ""quotes"" and "$13$10"two lines".
|
||||
|
|
|
|||
|
|
@ -1,5 +1,2 @@
|
|||
TEXT = 'That''s right!' !Only apostrophes as delimiters. Doubling required.
|
||||
TEXT = "That's right!" !Chose quotes, so that apostrophes may be used freely.
|
||||
TEXT = "He said ""That's right!""" !Give in, and use quotes for a "quoted string" source style.
|
||||
TEXT = 'He said "That''s right!"' !Though one may dabble in inconsistency.
|
||||
TEXT = 23HHe said "That's right!" !Some later compilers allowed Hollerith to escape from FORMAT.
|
||||
BLAH = "
|
||||
1Stuff"
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
TEXT = "That's"//CHAR(10)//"right!" !For an ASCII linefeed (or newline) character.
|
||||
TEXT = 'That''s right!' !Only apostrophes as delimiters. Doubling required.
|
||||
TEXT = "That's right!" !Chose quotes, so that apostrophes may be used freely.
|
||||
TEXT = "He said ""That's right!""" !Give in, and use quotes for a "quoted string" source style.
|
||||
TEXT = 'He said "That''s right!"' !Though one may dabble in inconsistency.
|
||||
TEXT = 23HHe said "That's right!" !Some later compilers allowed Hollerith to escape from FORMAT.
|
||||
|
|
|
|||
1
Task/Literals-String/Fortran/literals-string-4.f
Normal file
1
Task/Literals-String/Fortran/literals-string-4.f
Normal file
|
|
@ -0,0 +1 @@
|
|||
TEXT = "That's"//CHAR(10)//"right!" !For an ASCII linefeed (or newline) character.
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
echo Quotes are optional in most cases.
|
||||
echo
|
||||
echo 'But they are when using either of these characters (or whitespace):'
|
||||
echo '# $ % ^ & * ( ) { } ; \' " \\ < > ?'
|
||||
echo
|
||||
echo Single quotes only interpolate \\ and \' sequences.
|
||||
echo '\In \other \cases, \backslashes \are \preserved \literally.'
|
||||
echo
|
||||
set something variable
|
||||
echo "Double quotes interpolates \\, \" and \$ sequences and $something accesses."
|
||||
1
Task/Literals-String/Gecho/literals-string-1.gecho
Normal file
1
Task/Literals-String/Gecho/literals-string-1.gecho
Normal file
|
|
@ -0,0 +1 @@
|
|||
'a outascii
|
||||
1
Task/Literals-String/Gecho/literals-string-2.gecho
Normal file
1
Task/Literals-String/Gecho/literals-string-2.gecho
Normal file
|
|
@ -0,0 +1 @@
|
|||
'yo...dawg. print
|
||||
26
Task/Literals-String/Kotlin/literals-string.kotlin
Normal file
26
Task/Literals-String/Kotlin/literals-string.kotlin
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// version 1.0.6
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val cl = 'a' // character literal - can contain escaped character
|
||||
val esl = "abc\ndef" // escaped string literal - can contain escaped character(s)
|
||||
val rsl = """
|
||||
This is a raw string literal
|
||||
which does not treat escaped characters
|
||||
(\t, \b, \n, \r, \', \", \\, \$ and \u)
|
||||
specially and can contain new lines.
|
||||
|
||||
"Quotes" or doubled ""quotes"" can
|
||||
be included without problem but not
|
||||
tripled quotes.
|
||||
"""
|
||||
val msl = """
|
||||
|Leading whitespace can be removed from a raw
|
||||
|string literal by including
|
||||
|a margin prefix ('|' is the default)
|
||||
|in combination with the trimMargin function.
|
||||
""".trimMargin()
|
||||
println(cl)
|
||||
println(esl)
|
||||
println(rsl)
|
||||
println(msl)
|
||||
}
|
||||
3
Task/Literals-String/Zkl/literals-string-1.zkl
Normal file
3
Task/Literals-String/Zkl/literals-string-1.zkl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
text:=
|
||||
0'|foo|
|
||||
"bar\n";
|
||||
4
Task/Literals-String/Zkl/literals-string-2.zkl
Normal file
4
Task/Literals-String/Zkl/literals-string-2.zkl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
n:=7; text:=String(
|
||||
"foo = ",3,"\n"
|
||||
"bar=",n,"\n"
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue