Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
1
Task/Literals-String/Axe/literals-string-1.axe
Normal file
1
Task/Literals-String/Axe/literals-string-1.axe
Normal file
|
|
@ -0,0 +1 @@
|
|||
'A'
|
||||
1
Task/Literals-String/Axe/literals-string-2.axe
Normal file
1
Task/Literals-String/Axe/literals-string-2.axe
Normal file
|
|
@ -0,0 +1 @@
|
|||
"ABC"
|
||||
2
Task/Literals-String/Lasso/literals-string-1.lasso
Normal file
2
Task/Literals-String/Lasso/literals-string-1.lasso
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
'I\'m a 2" string\n'
|
||||
"I'm a 2\" string\n"
|
||||
1
Task/Literals-String/Lasso/literals-string-2.lasso
Normal file
1
Task/Literals-String/Lasso/literals-string-2.lasso
Normal file
|
|
@ -0,0 +1 @@
|
|||
`I'm also a 2" string\n`
|
||||
3
Task/Literals-String/Lingo/literals-string-1.lingo
Normal file
3
Task/Literals-String/Lingo/literals-string-1.lingo
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
str = "Hello ""E&"world!""E
|
||||
put str
|
||||
-- "Hello "world!""
|
||||
3
Task/Literals-String/Lingo/literals-string-2.lingo
Normal file
3
Task/Literals-String/Lingo/literals-string-2.lingo
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
str = "This is the first line.\
|
||||
This is the second line.\
|
||||
This is the third line."
|
||||
6
Task/Literals-String/Lingo/literals-string-3.lingo
Normal file
6
Task/Literals-String/Lingo/literals-string-3.lingo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
template = QUOTE&"Milliseconds since last reboot: ""E&"&_system.milliseconds"
|
||||
|
||||
-- expand template in current context
|
||||
str = value(template)
|
||||
put str
|
||||
-- "Milliseconds since last reboot: 20077664"
|
||||
5
Task/Literals-String/LiveCode/literals-string.livecode
Normal file
5
Task/Literals-String/LiveCode/literals-string.livecode
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
put "Literal string" -- Literal string
|
||||
put char 1 of "Literal string" -- L
|
||||
put char 1 to 7 of "Literal string" -- Literal
|
||||
put word 1 of "Literal string" -- Literal
|
||||
put quote & "string" & quote -- "string"
|
||||
7
Task/Literals-String/Nim/literals-string.nim
Normal file
7
Task/Literals-String/Nim/literals-string.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
var c = 'c'
|
||||
var s = "foobar"
|
||||
var l = """foobar
|
||||
and even
|
||||
more test here"""
|
||||
|
||||
var f = r"C:\texts\text.txt" # Raw string
|
||||
5
Task/Literals-String/Oforth/literals-string.oforth
Normal file
5
Task/Literals-String/Oforth/literals-string.oforth
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
'a'
|
||||
'\''
|
||||
"abcd"
|
||||
"ab\ncd"
|
||||
"ab\" and \" cd"
|
||||
1
Task/Literals-String/Phix/literals-string-1.phix
Normal file
1
Task/Literals-String/Phix/literals-string-1.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
constant UPPERCASEJ = 'J' -- equivalent to 74
|
||||
2
Task/Literals-String/Phix/literals-string-2.phix
Normal file
2
Task/Literals-String/Phix/literals-string-2.phix
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
constant hw = "Hello World!",
|
||||
mt = "" -- empty string
|
||||
1
Task/Literals-String/Phix/literals-string-3.phix
Normal file
1
Task/Literals-String/Phix/literals-string-3.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
s = "日本語"
|
||||
4
Task/Literals-String/Phix/literals-string-4.phix
Normal file
4
Task/Literals-String/Phix/literals-string-4.phix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
string s = "food"
|
||||
s[2..3] = 'e' -- s is now "feed" (replace all)
|
||||
s[2..2] = "east" -- s is now "feasted" (replace substring)
|
||||
s[2..5] = "" -- s is now "fed"
|
||||
12
Task/Literals-String/Phix/literals-string-5.phix
Normal file
12
Task/Literals-String/Phix/literals-string-5.phix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
ts = """
|
||||
this
|
||||
string\thing"""
|
||||
|
||||
ts = """
|
||||
_____this
|
||||
string\thing"""
|
||||
|
||||
ts = 'this
|
||||
string\thing'
|
||||
|
||||
ts = "this\nstring\\thing"
|
||||
1
Task/Literals-String/Phix/literals-string-6.phix
Normal file
1
Task/Literals-String/Phix/literals-string-6.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
?x"68 65 6c 6c 6f"; -- displays "hello"
|
||||
1
Task/Literals-String/Ring/literals-string.ring
Normal file
1
Task/Literals-String/Ring/literals-string.ring
Normal file
|
|
@ -0,0 +1 @@
|
|||
see 'This is a "quoted string"'
|
||||
4
Task/Literals-String/Sidef/literals-string-1.sidef
Normal file
4
Task/Literals-String/Sidef/literals-string-1.sidef
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
'single quotes with \'embedded quote\' and \\backslash';
|
||||
‚unicode single quoted’;
|
||||
%q(not interpolating with (nested) parentheses
|
||||
and newline);
|
||||
4
Task/Literals-String/Sidef/literals-string-2.sidef
Normal file
4
Task/Literals-String/Sidef/literals-string-2.sidef
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
var a = 42;
|
||||
"double \Uquotes\E with \"embedded quote\"\nnewline and variable interpolation: #{a} % 10 = #{a % 10}";
|
||||
„same as above”;
|
||||
%Q(same as above);
|
||||
13
Task/Literals-String/Sidef/literals-string-3.sidef
Normal file
13
Task/Literals-String/Sidef/literals-string-3.sidef
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
print <<EOT
|
||||
Implicit double-quoted (interpolates):
|
||||
a = #{a}
|
||||
EOT
|
||||
|
||||
print <<"EOD"
|
||||
Explicit double-quoted with interpolation:
|
||||
a = #{a}
|
||||
EOD
|
||||
|
||||
print <<'NON_INTERPOLATING'
|
||||
This will not interpolate: #{a}
|
||||
NON_INTERPOLATING
|
||||
7
Task/Literals-String/Swift/literals-string.swift
Normal file
7
Task/Literals-String/Swift/literals-string.swift
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let you = "You"
|
||||
let str1 = "\(you) can insert variables into strings."
|
||||
let str2 = "Swift also supports unicode in strings ı∫ƒ∂ß´™¡à"
|
||||
let str3 = "Swift also supports control characters \n\tLike this"
|
||||
let str4 = "'" // '
|
||||
let str5 = "\"" // "
|
||||
println(str3)
|
||||
Loading…
Add table
Add a link
Reference in a new issue