Mercurial > projects > dang
view tests/parser/string_1.d @ 187:08b6ce45b456
Changed the way static arrays are represented
Now uses [3 x i32] rather than [3 x i32]*, and when using constants they are
copied before use.
Also dixed a test or two
author | Anders Halager <halager@gmail.com> |
---|---|
date | Fri, 25 Jul 2008 12:53:58 +0200 |
parents | 6cb2f4201e2a |
children |
line wrap: on
line source
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[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"; /* And some custom ones */ char[7] s16 = "\x61\u05D0\U000201A4"; char[2] s17 = "\122\522"; char[8] s18 = x"61 62 63 64 65 66 67 68"; char[3] s19 = "\®\&"; char[3] s20 = "\®\&"c; wchar[2] s21 = "\®\&"w; dchar[2] s22 = "\®\&"d; return 0; }