Add globals to the compiler. We need:
1. A list of global variable names (detected during the first pass)
2. (global $name (mut i64) (i64.const 0)) declarations in the output
3. global.get $name / global.set $name instead of local.get / local.set
Add a global tracking table:
var c_global_names: [64][]const u8 = undefined;
var c_global_count: usize = 0;
fn c_is_global(name: []const u8) bool {
for (0..c_global_count) |i| {
if (streq(c_global_names[i], name)) {
return true;
}
}
return false;
}