* bitwise not operator, ~
* auto cast operator, ~~. In many circumstances, will automatically determine what to cast to.
- Will also report errors in the cast is not possible.
+* Arbitrarily typed varargs. They behave similar to C-style varargs.
+* vararg_get builtin procedure to retrieve a value from a ... vararg.
+* #private_file directive for placing a symbol at file scope.
+* a basic implentation of printf in the standard library.
+* use statements at the function level.
Removals:
Changes:
* Procedure definitions now require parentheses, even if there are no arguments. This was
done to allow for `proc { foo, bar }` to be the overload syntax.
+* array_map takes an arbitrary parameter of polymorphic type to make up for the fact that
+ anonymous procs do not have closure. New type signature is:
+ array_map :: proc (arr: ^[..] $T, data: $R, f: proc (T, R) -> T)
+* better syntax highlighting for VIM.
Bug fixes:
+* many bugs related to var args and procedure calls in general.
+* polymorphic structs caused segmentation fault when trying to produce an error message.
+* polymorhpic structs caused scope to change when using a struct literal of a polymoprhic type.
+* #char "\"" did not work.
+* nested function calls returning non-basic types would simply be wrong.
u32 vararg_count = 0;
u32 vararg_offset = -1;
+ u64 stack_top_store_local;;
bh_arr_each(AstArgument *, parg, call->arg_arr) {
AstArgument* arg = *parg;
if (place_on_stack && !arg_is_struct) WID(WI_GLOBAL_GET, stack_top_idx);
+ if (stack_grow_amm != 0) {
+ stack_top_store_local = local_raw_allocate(mod->local_alloc, WASM_TYPE_INT32);
+ WID(WI_GLOBAL_GET, stack_top_idx);
+ WIL(WI_LOCAL_SET, stack_top_store_local);
+
+ WID(WI_GLOBAL_GET, stack_top_idx);
+ WID(WI_I32_CONST, stack_grow_amm);
+ WI(WI_I32_ADD);
+ WID(WI_GLOBAL_SET, stack_top_idx);
+ }
+
emit_expression(mod, &code, arg->value);
+ if (stack_grow_amm != 0) {
+ WIL(WI_LOCAL_GET, stack_top_store_local);
+ WID(WI_GLOBAL_SET, stack_top_idx);
+
+ local_raw_free(mod->local_alloc, WASM_TYPE_INT32);
+ }
+
if (place_on_stack) {
if (arg_is_struct) WID(WI_GLOBAL_GET, stack_top_idx);
emit_store_instruction(mod, &code, arg->value->type, stack_grow_amm);
println(i32map_has(^imap, 50));
println(i32map_has(^imap, 51));
- print(i32map_get(^imap, 50, ""));
- println(i32map_get(^imap, 1234, ""));
+ printf("%s%s\n", i32map_get(^imap, 50, ""), i32map_get(^imap, 1234, ""));
i32map_delete(^imap, 50);
println(i32map_has(^imap, 50));