2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,5 +1,15 @@
|
|||
;Task:
|
||||
Show literal specification of characters and strings.
|
||||
If supported, show how verbatim strings (quotes where escape sequences are quoted literally) and here-strings work.
|
||||
|
||||
If supported, show how the following work:
|
||||
:* ''verbatim strings'' (quotes where escape sequences are quoted literally)
|
||||
:* ''here-strings''
|
||||
|
||||
<br>
|
||||
Also, discuss which quotes expand variables.
|
||||
|
||||
* Related tasks: [[Special characters]], [[Here document]]
|
||||
|
||||
;Related tasks:
|
||||
* [[Special characters]]
|
||||
* [[Here document]]
|
||||
<br><br>
|
||||
|
|
|
|||
1
Task/Literals-String/Ela/literals-string-1.ela
Normal file
1
Task/Literals-String/Ela/literals-string-1.ela
Normal file
|
|
@ -0,0 +1 @@
|
|||
c = 'c'
|
||||
1
Task/Literals-String/Ela/literals-string-2.ela
Normal file
1
Task/Literals-String/Ela/literals-string-2.ela
Normal file
|
|
@ -0,0 +1 @@
|
|||
str = "Hello, world!"
|
||||
2
Task/Literals-String/Ela/literals-string-3.ela
Normal file
2
Task/Literals-String/Ela/literals-string-3.ela
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
c = '\t'
|
||||
str = "first line\nsecond line\nthird line"
|
||||
2
Task/Literals-String/Ela/literals-string-4.ela
Normal file
2
Task/Literals-String/Ela/literals-string-4.ela
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
vs = <[This is a
|
||||
verbatim string]>
|
||||
4
Task/Literals-String/Elena/literals-string.elena
Normal file
4
Task/Literals-String/Elena/literals-string.elena
Normal file
|
|
@ -0,0 +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".
|
||||
7
Task/Literals-String/Fortran/literals-string-1.f
Normal file
7
Task/Literals-String/Fortran/literals-string-1.f
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
DIMENSION ATWT(12)
|
||||
PRINT 1
|
||||
1 FORMAT (12HElement Name,F9.4)
|
||||
DO 10 I = 1,12
|
||||
READ 1,ATWT(I)
|
||||
10 PRINT 1,ATWT(I)
|
||||
END
|
||||
5
Task/Literals-String/Fortran/literals-string-2.f
Normal file
5
Task/Literals-String/Fortran/literals-string-2.f
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
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-3.f
Normal file
1
Task/Literals-String/Fortran/literals-string-3.f
Normal file
|
|
@ -0,0 +1 @@
|
|||
TEXT = "That's"//CHAR(10)//"right!" !For an ASCII linefeed (or newline) character.
|
||||
Loading…
Add table
Add a link
Reference in a new issue