"\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"
- "\t--doc <doc_file>"
+ "\t--doc <doc_file>\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"
"\t--print-notes Prints the location of notes throughout the loaded code.\n"
"\t--no-colors Disables colors in the error message\n"
+ "\t--no-file-contents Disables '#file_contents' for security\n"
"\n";
.fun_output = 0,
.print_function_mappings = 0,
.use_post_mvp_features = 0,
+ .no_file_contents = 0,
.runtime = Runtime_Wasi,
else if (!strcmp(argv[i], "--no-colors")) {
options.no_colors = 1;
}
+ else if (!strcmp(argv[i], "--no-file-contents")) {
+ options.no_file_contents = 1;
+ }
else if (!strcmp(argv[i], "--use-post-mvp-features")) {
options.use_post_mvp_features = 1;
}
case Entity_Type_Process_Directive: cs = check_process_directive((AstNode *) ent->expr); break;
+ case Entity_Type_File_Contents:
+ if (context.options->no_file_contents) {
+ onyx_report_error(ent->expr->token->pos, "#file_contents is disabled for this compilation.");
+ }
+ break;
+
default: break;
}