about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/030container.cc b/030container.cc
index 387693ef..6187e815 100644
--- a/030container.cc
+++ b/030container.cc
@@ -271,13 +271,13 @@ case GET: {
   reagent/*copy*/ base = inst.ingredients.at(0);  // new copy for every invocation
   // Update GET base in Check
   if (!base.type || !base.type->value || !contains_key(Type, base.type->value) || get(Type, base.type->value).kind != CONTAINER) {
-    raise << maybe(get(Recipe, r).name) << "first ingredient of 'get' should be a container, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "first ingredient of 'get' should be a container, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
     break;
   }
   type_ordinal base_type = base.type->value;
   const reagent& offset = inst.ingredients.at(1);
   if (!is_literal(offset) || !is_mu_scalar(offset)) {
-    raise << maybe(get(Recipe, r).name) << "second ingredient of 'get' should have type 'offset', but got " << inst.ingredients.at(1).original_string << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "second ingredient of 'get' should have type 'offset', but got '" << inst.ingredients.at(1).original_string << "'\n" << end();
     break;
   }
   int offset_value = 0;
@@ -286,7 +286,7 @@ case GET: {
   else
     offset_value = offset.value;
   if (offset_value < 0 || offset_value >= SIZE(get(Type, base_type).elements)) {
-    raise << maybe(get(Recipe, r).name) << "invalid offset " << offset_value << " for " << get(Type, base_type).name << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "invalid offset '" << offset_value << "' for '" << get(Type, base_type).name << "'\n" << end();
     break;
   }
   if (inst.products.empty()) break;
@@ -294,7 +294,7 @@ case GET: {
   // Update GET product in Check
   const reagent/*copy*/ element = element_type(base.type, offset_value);
   if (!types_coercible(product, element)) {
-    raise << maybe(get(Recipe, r).name) << "'get " << base.original_string << ", " << offset.original_string << "' should write to " << names_to_string_without_quotes(element.type) << " but " << product.name << " has type " << names_to_string_without_quotes(product.type) << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "'get " << base.original_string << ", " << offset.original_string << "' should write to " << names_to_string_without_quotes(element.type) << " but '" << product.name << "' has type " << names_to_string_without_quotes(product.type) << '\n' << end();
     break;
   }
   break;
@@ -351,7 +351,7 @@ def main [
   14:number <- copy 36
   get 12:point-number/raw, 2:offset  # point-number occupies 3 locations but has only 2 fields; out of bounds
 ]
-+error: main: invalid offset 2 for point-number
++error: main: invalid offset '2' for 'point-number'
 
 :(scenario get_out_of_bounds_2)
 % Hide_errors = true;
@@ -361,7 +361,7 @@ def main [
   14:number <- copy 36
   get 12:point-number/raw, -1:offset
 ]
-+error: main: invalid offset -1 for point-number
++error: main: invalid offset '-1' for 'point-number'
 
 :(scenario get_product_type_mismatch)
 % Hide_errors = true;
@@ -371,7 +371,7 @@ def main [
   14:number <- copy 36
   15:address:number <- get 12:point-number/raw, 1:offset
 ]
-+error: main: 'get 12:point-number/raw, 1:offset' should write to number but 15 has type (address number)
++error: main: 'get 12:point-number/raw, 1:offset' should write to number but '15' has type (address number)
 
 //: we might want to call 'get' without saving the results, say in a sandbox
 
@@ -408,21 +408,21 @@ case PUT: {
   reagent/*copy*/ base = inst.ingredients.at(0);
   // Update PUT base in Check
   if (!base.type || !base.type->value || !contains_key(Type, base.type->value) || get(Type, base.type->value).kind != CONTAINER) {
-    raise << maybe(get(Recipe, r).name) << "first ingredient of 'put' should be a container, but got " << inst.ingredients.at(0).original_string << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "first ingredient of 'put' should be a container, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
     break;
   }
   type_ordinal base_type = base.type->value;
   reagent/*copy*/ offset = inst.ingredients.at(1);
   // Update PUT offset in Check
   if (!is_literal(offset) || !is_mu_scalar(offset)) {
-    raise << maybe(get(Recipe, r).name) << "second ingredient of 'put' should have type 'offset', but got " << inst.ingredients.at(1).original_string << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "second ingredient of 'put' should have type 'offset', but got '" << inst.ingredients.at(1).original_string << "'\n" << end();
     break;
   }
   int offset_value = 0;
   if (is_integer(offset.name)) {  // later layers permit non-integer offsets
     offset_value = to_integer(offset.name);
     if (offset_value < 0 || offset_value >= SIZE(get(Type, base_type).elements)) {
-      raise << maybe(get(Recipe, r).name) << "invalid offset " << offset_value << " for " << get(Type, base_type).name << '\n' << end();
+      raise << maybe(get(Recipe, r).name) << "invalid offset '" << offset_value << "' for '" << get(Type, base_type).name << "'\n" << end();
       break;
     }
   }
@@ -432,7 +432,7 @@ case PUT: {
   const reagent& value = inst.ingredients.at(2);
   const reagent& element = element_type(base.type, offset_value);
   if (!types_coercible(element, value)) {
-    raise << maybe(get(Recipe, r).name) << "'put " << base.original_string << ", " << offset.original_string << "' should store " << names_to_string_without_quotes(element.type) << " but " << value.name << " has type " << names_to_string_without_quotes(value.type) << '\n' << end();
+    raise << maybe(get(Recipe, r).name) << "'put " << base.original_string << ", " << offset.original_string << "' should write to " << names_to_string_without_quotes(element.type) << " but '" << value.name << "' has type " << names_to_string_without_quotes(value.type) << '\n' << end();
     break;
   }
   break;
@@ -546,7 +546,7 @@ void insert_container(const string& command, kind_of_type kind, istream& in) {
   }
   else if (info.Num_calls_to_transform_all_at_first_definition != Num_calls_to_transform_all) {
     // extension after transform_all
-    raise << "there was a call to transform_all() between the definition of container " << name << " and a subsequent extension. This is not supported, since any recipes that used " << name << " values have already been transformed and 'frozen'.\n" << end();
+    raise << "there was a call to transform_all() between the definition of container '" << name << "' and a subsequent extension. This is not supported, since any recipes that used '" << name << "' values have already been transformed and \"frozen\".\n" << end();
     return;
   }
   info.name = name;
revious revision' href='/akkartik/mu/blame/baremetal/shell/sandbox.mu?h=hlt&id=06e4b1be9bd9ce502fabd8c1ddd38f867ced5f26'>^
2812e206 ^
2387a8fb ^
2812e206 ^



7d34b82a ^
2812e206 ^










06e4b1be ^

2812e206 ^
06e4b1be ^

2812e206 ^



















61c47f6d ^
995dc380 ^
684c0962 ^
a4bc5df0 ^
995dc380 ^
8b8d0fc7 ^







995dc380 ^


7e9e65ee ^
70def320 ^

995dc380 ^
421ed465 ^



2387a8fb ^
421ed465 ^
995dc380 ^

7d34b82a ^
3bfac642 ^
a4bc5df0 ^
2812e206 ^
a4bc5df0 ^
2812e206 ^
a4bc5df0 ^


a4bc5df0 ^


2812e206 ^


3bfac642 ^







a4bc5df0 ^

3bfac642 ^




684c0962 ^
668bec39 ^
421ed465 ^
210c4837 ^

421ed465 ^






210c4837 ^
cb66df2e ^
640896da ^
668bec39 ^
a4bc5df0 ^











2812e206 ^
a4bc5df0 ^
2812e206 ^
a4bc5df0 ^
0580b507 ^

a4bc5df0 ^













2812e206 ^
a4bc5df0 ^
2812e206 ^
a4bc5df0 ^
0580b507 ^

a4bc5df0 ^





0580b507 ^
a4bc5df0 ^
0580b507 ^
a4bc5df0 ^




2812e206 ^
a4bc5df0 ^
2812e206 ^
0580b507 ^





2812e206 ^







7d34b82a ^
2812e206 ^


a4bc5df0 ^
2812e206 ^




7d34b82a ^
2812e206 ^
a4bc5df0 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262