3 resource(1) "123"; // should be okay because types differ
4 //resource(1) 123; // duplicate resource 1
5 //resource(0x100000001) 100; // duplicate resource 1
7 ///* this is a /* nested */ comment */
10 resource(0xFFFFFFFE) 101; // -2
11 resource(- 0x7FFFFFFF) 102; // -2147483647
12 resource(-0x80000000) 103; // -2147483648
13 resource( 0x80000001) "104"; // -2147483647
14 resource(-0x80000001) 105; // 2147483647
15 resource(-3, "name") 106;
17 resource(10, "nom") "hello";
18 resource(11, "") 123; // should ignore name
20 //------------------------------------------------------------------------------
24 //resource(22) (int32) true; // invalid cast
27 resource(31) (int32) 12345;
28 resource(32) (uint32) 12345;
29 resource(33) (size_t) 12345;
30 resource(34) (ssize_t) 12345;
31 resource(35) (time_t) 12345;
32 resource(36) (int64) 1234;
33 resource(37) (uint64) 1234;
34 resource(38) (off_t) 0xffaa;
35 resource(39) (int8) 12345;
36 resource(40) (uint8) 12345;
37 resource(41) (int16) 12345;
38 resource(42) (uint16) 12345;
39 resource(43) (float) 12345;
40 resource(44) (double) 12345;
41 resource(44) (raw) 12345;
45 resource(47) -0xFFFF; // -65535
46 resource(48) -0xFFFFFFFF; // 1
47 resource(49) -0x7FFFFFFF; // -2147483647
48 resource(50) -0x80000000; // -2147483648
49 resource(51) 0x80000001; // -2147483647
50 resource(52) -0x80000001; // 2147483647
51 resource(53) (uint64) -0xFFFFFFFF; // 18446744069414584321
53 resource(55) 'what'; // 2003329396
54 resource(56) -'what'; // -2003329396
56 resource(58) 0b11111111111111111111111111111111; // -1
57 resource(59) (uint64) 0b1111111111111111111111111111111111111111111111111111111111111111; // 18446744073709551615
58 //resource(59) - -123; // syntax error
61 resource(61) (float) 10.0;
62 resource(62) (double) 10.0;
65 resource(65) (raw) 10.0;
66 //resource(69) - -10.0; // syntax error
69 resource(71) (string) "pants";
70 resource(72) "w00t\0dude";
71 resource(73) "fancy" "pants";
73 resource(75) "" "this" "wont" "" "scare" "" "me" "";
74 resource(76) (raw) "fancy";
75 //resource(79) "hi", "ho"; // , not allowed
78 resource(81) (buffer) $"4041";
79 resource(82) (raw) $"4041";
80 resource(83) $"4041" $"4243";
82 resource(85) $"" $"40" $"" $"41" $"";
83 resource(86) (array) $"4041";
84 //resource(89) $"0"; // too few digits
85 //resource(89) $"GA"; // invalid digit
86 //resource(89) $"FF", $"AA"; // , not allowed
88 resource(90) (#'blah') $"4041";
89 resource(91) (#'blah') (uint16) 1234;
90 resource(92) #'blah' 1234;
91 resource(93) #'blah' (uint16) 1234;
92 //resource(95) (#'blah' uint16) 1234; // we don't allow this notation
94 //------------------------------------------------------------------------------
119 resource(R_Boolean) false;
120 resource(R_Int8) (int8)4;
121 resource(R_Character) (#'CHAR') $"28";
122 resource(R_String) "Dance and song";
123 resource(R_Double) (double)0.0;
124 resource(R_Float) 0.0;
125 resource(R_Int64) (int64)-125829120;
126 resource(R_Int32) -123450;
127 resource(R_MIMEString) (#'MIMS') "application/octet-stream";
128 resource(R_Offset) (off_t)0;
129 resource(R_Pointer) (#'PNTR') $"00000000";
131 resource(R_Int16) (int16)-1234;
132 resource(R_Size) (size_t)0;
133 resource(R_Status) (ssize_t)0;
134 resource(R_Time) (time_t)0;
135 resource(R_UInt8) (uint8)200;
136 resource(R_UInt64) (uint64)17293822569102704640;
137 resource(R_UInt32) (uint32)251658240;
138 resource(R_UInt16) (uint16)61440;
140 resource(120) $"40414243";
143 $"DE8765005507E15BC8033E2CD6BFB72620DD87F9780325D0BB2DAC7DAEE9AC9B"
144 $"6C7398DB05ADC01C5E41CBC0CCDA19DBE9FFEF7430BE3525C5FCBC419BB90000";
146 //------------------------------------------------------------------------------
148 // The decompile should escape the special characters, except \P, which
149 // is not special (the \ is dropped). Unlike deres, rc does not split the
150 // string literal into two parts at the newline.
151 resource(200) "a \tshort string\nwith \bplenty\fof\r\vescapes\P";
153 // More stuff that should be escaped.
154 resource(201) "some other \"special\" characters like \\ and \0x01 and \002";
156 // Decompiling should create a "#'CSTR' array" with two items, because the
157 // string contains an embedded null character. By the way, beres does not
158 // recognize \0 as null, but rc does.
159 resource(202) "alongstring-alongstringg\000-alongstringg-alongstringg-alongstringgalongstringg-alongstringg-alongstringg-alongstringg-alongstring";
161 // Don't do the following in your own resource files. It should not crash
162 // the compiler or decompiler, but pretending that non-string data is a
163 // null-terminated string is A Bad Thing (tm).
164 resource(210) (#'CSTR') $"4041";
165 resource(212) (#'CSTR') (uint64) 5678;
167 // Should decompile as raw, not as string.
168 resource(213) (#200) 100;
170 // The decompiler sees this as a string literal.
171 resource(214) (#200) $"6400";
173 // The decompiler creates the symbolic names R_BOOL_MyName and R_CSTR_MyName,
174 // with values 215 and 216, respectively.
175 resource(215, "MyName") true;
176 resource(216, "MyName") "true";
178 // The decompiler creates the symbol R_200_MyName.
179 resource(217, "MyName") (#200) 123;