| 1 |
/* |
| 2 |
* comment! |
| 3 |
*/ |
| 4 |
#include <tads.h> |
| 5 |
|
| 6 |
main(args) |
| 7 |
{ |
| 8 |
local i = 123, j = 345; |
| 9 |
|
| 10 |
"""""Test of various mode switching. <<'''Triple-single'''>>."""; |
| 11 |
|
| 12 |
"""More mode switching. <<'Single single', '''Triple single'''>> end."""; |
| 13 |
local s = '''Even more. <<'Single single', '''Triple single'''>> |
| 14 |
and back to it.'''; |
| 15 |
"<<s>>\n"; |
| 16 |
|
| 17 |
"""Again with the doubles. <<"Double-single", """Double-triple""">> |
| 18 |
and ending."""; |
| 19 |
|
| 20 |
"""This is a triple-quoted string. "It's very nice," someone |
| 21 |
said. What about ""pairs of quotes""? They should be fine. |
| 22 |
And we should also handle a whole run of escaped quotes, |
| 23 |
as in these 10: \"""""""""". That's it for this one."""; |
| 24 |
|
| 25 |
"\b"; |
| 26 |
""""And how about quotes around the whole string?""""; |
| 27 |
|
| 28 |
"\b"; |
| 29 |
"""""Or ""pairs"" of quotes???"""""; |
| 30 |
|
| 31 |
"\b"; |
| 32 |
"There's the empty triple-quoted string, of course:"; |
| 33 |
""""""; |
| 34 |
|
| 35 |
"\b"; |
| 36 |
"And what about a string of 16 quotes? As in: "; """"""""""""""""; |
| 37 |
|
| 38 |
"\b"; |
| 39 |
"This is a regular string with i=<<i>> embedded."; |
| 40 |
|
| 41 |
"\b"; |
| 42 |
"""This is a triple quoted string with "embedded quotes"!!!"""; |
| 43 |
|
| 44 |
"\b"; |
| 45 |
"""On to triple quote embeddings. i=<<i>>, j=<<j>>, and |
| 46 |
is i==j? <<i == j ? '''Yes!''' : 'No.'>> How about i!=j? << |
| 47 |
i != j ? '''Yes!''' : 'No.'>> And using if: <<if i==j>>i equals |
| 48 |
j<<else>>i and j are unequal<<end>>."""; |
| 49 |
|
| 50 |
"\n"; |
| 51 |
} |