@@ -158,7 +158,7 @@ compile_c_file :: (
158
158
}
159
159
160
160
if flags != "" {
161
- for string .split(flags, ' ') do args << it
161
+ for str .split(flags, ' ') do args << it
162
162
}
163
163
164
164
args << "-o"
@@ -233,14 +233,14 @@ compile_c_file :: (
233
233
io.write(writer, type_encoding(method_info.return_type))
234
234
io.write(writer, ")) {\n")
235
235
236
- method_name := slice .find_opt(ff.tags, [it](it.type == customize))
236
+ method_name := Slice .find_opt(ff.tags, [it](it.type == customize))
237
237
->transform(x => misc.any_as(x, customize).symbol_name) ?? ff.name
238
238
239
239
if name_map != null_proc {
240
240
method_name = name_map(method_name)
241
241
}
242
242
243
- switch slice .find_opt(ff.tags, [it](it.type == func_body))
243
+ switch Slice .find_opt(ff.tags, [it](it.type == func_body))
244
244
->transform(x => misc.any_as(x, func_body).body)
245
245
{
246
246
case .Some as body {
@@ -251,7 +251,7 @@ compile_c_file :: (
251
251
case .None {
252
252
print_body(
253
253
writer, method_name, method_info, cast_map,
254
- slice .some(ff.tags, [it](
254
+ Slice .some(ff.tags, [it](
255
255
misc.any_as(*it, type_expr)
256
256
|> Optional.from_ptr()
257
257
|> Optional.transform(x => x == last_arg_is_return_value)
@@ -305,7 +305,7 @@ compile_c_file :: (
305
305
map_to_dyncall(p, &call_signature)
306
306
}
307
307
308
- string .append(&call_signature, ")")
308
+ dyn_str .append(&call_signature, ")")
309
309
map_to_dyncall(func_info.return_type, &call_signature)
310
310
311
311
io.write_format(&callw, "(void *) runtime->wasm_func_from_idx(runtime->wasm_func_table, P({}, i32), \"{}\")", param_num, cast(str) call_signature)
@@ -319,21 +319,21 @@ compile_c_file :: (
319
319
}
320
320
321
321
switch p {
322
- case void do string .append(call_signature, "v")
323
- case bool do string .append(call_signature, "B")
324
- case i8 do string .append(call_signature, "c")
325
- case u8 do string .append(call_signature, "C")
326
- case i16 do string .append(call_signature, "s")
327
- case u16 do string .append(call_signature, "S")
328
- case i32 do string .append(call_signature, "i")
329
- case u32 do string .append(call_signature, "I")
330
- case i64 do string .append(call_signature, "l")
331
- case u64 do string .append(call_signature, "L")
332
- case f32 do string .append(call_signature, "f")
333
- case f64 do string .append(call_signature, "d")
322
+ case void do dyn_str .append(call_signature, "v")
323
+ case bool do dyn_str .append(call_signature, "B")
324
+ case i8 do dyn_str .append(call_signature, "c")
325
+ case u8 do dyn_str .append(call_signature, "C")
326
+ case i16 do dyn_str .append(call_signature, "s")
327
+ case u16 do dyn_str .append(call_signature, "S")
328
+ case i32 do dyn_str .append(call_signature, "i")
329
+ case u32 do dyn_str .append(call_signature, "I")
330
+ case i64 do dyn_str .append(call_signature, "l")
331
+ case u64 do dyn_str .append(call_signature, "L")
332
+ case f32 do dyn_str .append(call_signature, "f")
333
+ case f64 do dyn_str .append(call_signature, "d")
334
334
case _ {
335
335
if is_pointer(p) {
336
- string .append(call_signature, "p")
336
+ dyn_str .append(call_signature, "p")
337
337
} else {
338
338
panic(tprintf("Unsupported type in function pointer: {}", p))
339
339
}
@@ -343,7 +343,7 @@ compile_c_file :: (
343
343
344
344
} elseif it_info.kind == .Struct && it_info->as_struct().constructed_from != cptr {
345
345
param_type := it
346
- name := slice .find_opt(cast_map, [x](x.type == param_type))
346
+ name := Slice .find_opt(cast_map, [x](x.type == param_type))
347
347
->transform(x => x.name)
348
348
->expect(tprintf("Structures used as parameter arguments MUST have a definition in the 'cast_map' in '{}'.", method_name))
349
349
@@ -371,13 +371,13 @@ compile_c_file :: (
371
371
call_str := io.buffer_stream_to_str(call)
372
372
call_str = call_str[0 .. call_str.count - 2]
373
373
if last_arg_is_return_value {
374
- return_type := slice .get(method_info.parameter_types, -1)
374
+ return_type := Slice .get(method_info.parameter_types, -1)
375
375
if return_type->info().kind != .Pointer {
376
376
panic(tprintf("last_arg_is_return_value requires last parameter to be a pointer. ({} in {})", method_info.parameter_types, method_name))
377
377
}
378
378
379
379
return_type = return_type->info()->as_pointer().to
380
- type_name := slice .find_opt(cast_map, [x](x.type == return_type))
380
+ type_name := Slice .find_opt(cast_map, [x](x.type == return_type))
381
381
->transform(x => x.name)
382
382
->expect(tprintf("Types used as last argument return values MUST have a definition in the 'cast_map' in '{}'.", method_name))
383
383
0 commit comments