"Flags:\n"
"\t<input files> List of initial files\n"
"\t-o <target_file> Specify the target file (default: out.wasm)\n"
- "\t-r <runtime> Specifies a runtime. Can be: wasi, js, custom.\n"
- "\t--verbose Verbose output\n";
+ "\t--runtime, -r <runtime> Specifies a runtime. Can be: wasi, js, custom.\n"
+ "\t--verbose, -V Verbose output\n"
+ "\t -VV Very verbose output\n"
+ "\t -VVV Very very verbose output (to be used by compiler developers)\n"
+ "\t--use-post-mvp-features Enables post MVP WASM features such as memory.copy and memory.fill\n"
+ "\n"
+ "Developer flags:\n"
+ "\t--print-function-mappings Prints a mapping from WASM function index to source location.\n"
+ "\t--print-static-if-results Prints the conditional result of each #if statement. Useful for debugging.\n"
+ "\n";
+
static CompileOptions compile_opts_parse(bh_allocator alloc, int argc, char *argv[]) {
CompileOptions options = {
else if (!strcmp(argv[i], "-I")) {
bh_arr_push(options.included_folders, argv[++i]);
}
- else if (!strcmp(argv[i], "-r")) {
+ else if (!strcmp(argv[i], "-r") || !strcmp(argv[i], "--runtime")) {
i += 1;
if (!strcmp(argv[i], "wasi")) options.runtime = Runtime_Wasi;
else if (!strcmp(argv[i], "js")) options.runtime = Runtime_Js;
static SymresStatus symres_use(AstUse* use) {
SYMRES(expression, &use->expr);
+ if (use->expr->kind == Ast_Kind_Package) {
+ AstPackage* package = (AstPackage *) use->expr;
+ scope_include(curr_scope, package->package->scope, use->token->pos);
+ return Symres_Success;
+ }
+
if (use->expr->kind == Ast_Kind_Enum_Type) {
AstEnumType* et = (AstEnumType *) use->expr;
WID(WI_I32_CONST, switch_node->min_case);
WI(WI_I32_SUB);
}
- WIL(WI_JUMP_TABLE, (u64) bt);
+ WIP(WI_JUMP_TABLE, bt);
WI(WI_BLOCK_END);
bh_arr_each(AstSwitchCase, sc, switch_node->cases) {