Mercurial > projects > dang
diff tests/parser/string_1.d @ 104:7ff4bc2accf2 new_gen
Lexing more types of strings. Now all's left is to parse the string in the AST.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Wed, 21 May 2008 21:05:23 +0200 |
parents | |
children | 89db676fbacb 41ccd50e7cbc |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/parser/string_1.d Wed May 21 21:05:23 2008 +0200 @@ -0,0 +1,27 @@ + +int main() +{ + /* All examples taken from D's Language site */ + + char[4] s1 = "food"; + + char[5] s2 = r"hello"; + char[15] s3 = r"c:\root\foo.exe"; + char[4] s4 = r"ab\n"; + + char[5] s5 = `hello`; + char[15] s6 = `c:\root\foo.exe`; + char[4] s7 = `ab\n`; + char[4] s9 = `abn\`; + + char[5] s10 = "hello"; + char[15] s11 = "c:\\root\\foo.exe"; + char[3] s12 = "ab\n"; + char[3] s13 = "ab +"; + + char[1] s14 = x"0A"; + char[6] s15 = x"00 FBCD 32FD 0A"; + + return 0; +}