[v:master] e9aca1256 - ci: switched to vieter-v
parent
ccd185a9ad
commit
a30a25cd55
168
v.c
168
v.c
|
@ -1,11 +1,11 @@
|
|||
#define V_COMMIT_HASH "460c2ee77"
|
||||
#define V_COMMIT_HASH "e9aca1256"
|
||||
|
||||
#ifndef V_COMMIT_HASH
|
||||
#define V_COMMIT_HASH "398db2138"
|
||||
#define V_COMMIT_HASH "460c2ee77"
|
||||
#endif
|
||||
|
||||
#ifndef V_CURRENT_COMMIT_HASH
|
||||
#define V_CURRENT_COMMIT_HASH "460c2ee"
|
||||
#define V_CURRENT_COMMIT_HASH "e9aca12"
|
||||
#endif
|
||||
|
||||
#define V_USE_SIGNAL_H
|
||||
|
@ -7719,6 +7719,7 @@ int string_last_index_u8(string s, u8 c);
|
|||
int string_count(string s, string substr);
|
||||
bool string_contains(string s, string substr);
|
||||
bool string_contains_any(string s, string chars);
|
||||
bool string_contains_only(string s, string chars);
|
||||
bool string_contains_any_substr(string s, Array_string substrs);
|
||||
bool string_starts_with(string s, string p);
|
||||
bool string_ends_with(string s, string p);
|
||||
|
@ -9881,6 +9882,7 @@ void v__builder__cbuilder__build_c(v__builder__Builder* b, Array_string v_files,
|
|||
VV_LOCAL_SYMBOL void main__main(void);
|
||||
VV_LOCAL_SYMBOL void main__invoke_help_and_exit(Array_string remaining);
|
||||
VV_LOCAL_SYMBOL void main__rebuild(v__pref__Preferences* prefs);
|
||||
string _v_dump_expr_string(string fpath, int line, string sexpr, string dump_arg);
|
||||
|
||||
static string time__FormatTime_str(time__FormatTime it); // auto
|
||||
static string time__FormatDate_str(time__FormatDate it); // auto
|
||||
|
@ -10439,6 +10441,7 @@ rune _const_os__dot = '.'; // precomputed
|
|||
rune _const_os__qmark = '?'; // precomputed
|
||||
Array_string _const_os__args; // inited later
|
||||
string _const_os__wd_at_startup; // inited later
|
||||
Array_string _const_os__executable_suffixes; // inited later
|
||||
Array_string _const_v__vmod__mod_file_stop_paths; // inited later
|
||||
v__vmod__ModFileCacher* _const_v__vmod__private_file_cacher; // inited later
|
||||
u64 _const_rand__wyrand__wyp0 = 11562461410679940143U; // precomputed
|
||||
|
@ -11423,6 +11426,34 @@ static string v__ast__Param_str(v__ast__Param it) { return indent_v__ast__Param_
|
|||
static string v__ast__StructField_str(v__ast__StructField it) { return indent_v__ast__StructField_str(it, 0);}
|
||||
|
||||
// V dump functions:
|
||||
string _v_dump_expr_string(string fpath, int line, string sexpr, string dump_arg) {
|
||||
string sline = int_str(line);
|
||||
string value = string_str(dump_arg);
|
||||
|
||||
strings__Builder sb = strings__new_builder(256);
|
||||
|
||||
strings__Builder_write_rune(&sb, '[');
|
||||
strings__Builder_write_string(&sb, fpath);
|
||||
strings__Builder_write_rune(&sb, ':');
|
||||
strings__Builder_write_string(&sb, sline);
|
||||
strings__Builder_write_rune(&sb, ']');
|
||||
strings__Builder_write_rune(&sb, ' ');
|
||||
strings__Builder_write_string(&sb, sexpr);
|
||||
strings__Builder_write_rune(&sb, ':');
|
||||
strings__Builder_write_rune(&sb, ' ');
|
||||
strings__Builder_write_string(&sb, value);
|
||||
strings__Builder_write_rune(&sb, '\n');
|
||||
|
||||
string res;
|
||||
res = strings__Builder_str(&sb);
|
||||
eprint(res);
|
||||
string_free(&res);
|
||||
strings__Builder_free(&sb);
|
||||
|
||||
string_free(&value);
|
||||
string_free(&sline);
|
||||
return dump_arg;
|
||||
}
|
||||
|
||||
static string indent_v__ast__CallExpr_str(v__ast__CallExpr it, int indent_count) {
|
||||
string indents = string_repeat(_SLIT(" "), indent_count);
|
||||
|
@ -23640,6 +23671,23 @@ bool string_contains_any(string s, string chars) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool string_contains_only(string s, string chars) {
|
||||
if (chars.len == 0) {
|
||||
return false;
|
||||
}
|
||||
for (int _t2 = 0; _t2 < s.len; ++_t2) {
|
||||
u8 ch = s.str[_t2];
|
||||
int res = 0;
|
||||
for (int i = 0; i < chars.len && res == 0; i++) {
|
||||
res += (int[]){(ch == chars.str[i])?1:0}[0];
|
||||
}
|
||||
if (res == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool string_contains_any_substr(string s, Array_string substrs) {
|
||||
if (substrs.len == 0) {
|
||||
return true;
|
||||
|
@ -31742,7 +31790,7 @@ bool os__is_executable(string path) {
|
|||
#if defined(_WIN32)
|
||||
{
|
||||
string p = os__real_path(path);
|
||||
bool _t1 = os__exists(p) && string_ends_with(p, _SLIT(".exe"));
|
||||
bool _t1 = os__exists(p) && (string_ends_with(p, _SLIT(".exe")) || string_ends_with(p, _SLIT(".bat")) || string_ends_with(p, _SLIT(".cmd")));
|
||||
return _t1;
|
||||
}
|
||||
#endif
|
||||
|
@ -33575,26 +33623,35 @@ _option_string os__find_abs_path_of_executable(string exepath) {
|
|||
if ((exepath).len == 0) {
|
||||
return (_option_string){ .state=2, .err=_v_error(_SLIT("expected non empty `exepath`")), .data={EMPTY_STRUCT_INITIALIZATION} };
|
||||
}
|
||||
if (os__is_abs_path(exepath)) {
|
||||
_option_string _t2;
|
||||
opt_ok2(&(string[]) { os__real_path(exepath) }, (_option*)(&_t2), sizeof(string));
|
||||
return _t2;
|
||||
for (int _t2 = 0; _t2 < _const_os__executable_suffixes.len; ++_t2) {
|
||||
string suffix = ((string*)_const_os__executable_suffixes.data)[_t2];
|
||||
string fexepath = string__plus(exepath, suffix);
|
||||
if (os__is_abs_path(fexepath)) {
|
||||
_option_string _t3;
|
||||
opt_ok2(&(string[]) { os__real_path(fexepath) }, (_option*)(&_t3), sizeof(string));
|
||||
return _t3;
|
||||
}
|
||||
string res = _SLIT("");
|
||||
string path = os__getenv(_SLIT("PATH"));
|
||||
Array_string paths = string_split(path, _const_os__path_delimiter);
|
||||
for (int _t3 = 0; _t3 < paths.len; ++_t3) {
|
||||
string p = ((string*)paths.data)[_t3];
|
||||
string found_abs_path = os__join_path_single(p, exepath);
|
||||
for (int _t4 = 0; _t4 < paths.len; ++_t4) {
|
||||
string p = ((string*)paths.data)[_t4];
|
||||
string found_abs_path = os__join_path_single(p, fexepath);
|
||||
#if defined(CUSTOM_DEFINE_trace_find_abs_path_of_executable)
|
||||
{
|
||||
_v_dump_expr_string(_SLIT("/woodpecker/src/git.rustybever.be/vieter-v/v/vlib/os/os.v"), 473, _SLIT("found_abs_path"), found_abs_path );
|
||||
}
|
||||
#endif
|
||||
if (os__exists(found_abs_path) && os__is_executable(found_abs_path)) {
|
||||
res = found_abs_path;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (res.len > 0) {
|
||||
_option_string _t4;
|
||||
opt_ok2(&(string[]) { os__real_path(res) }, (_option*)(&_t4), sizeof(string));
|
||||
return _t4;
|
||||
_option_string _t5;
|
||||
opt_ok2(&(string[]) { os__real_path(res) }, (_option*)(&_t5), sizeof(string));
|
||||
return _t5;
|
||||
}
|
||||
}
|
||||
return (_option_string){ .state=2, .err=os__error_failed_to_find_executable(), .data={EMPTY_STRUCT_INITIALIZATION} };
|
||||
}
|
||||
|
@ -38644,7 +38701,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
string vhash = _SLIT("398db2138");
|
||||
string vhash = _SLIT("460c2ee77");
|
||||
p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))})));
|
||||
if (string__eq(os__user_os(), _SLIT("windows"))) {
|
||||
p->use_cache = false;
|
||||
|
@ -71315,7 +71372,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) {
|
|||
strings__Builder_writeln(&g->cheaders, _SLIT("#include <stdint.h>"));
|
||||
strings__Builder_writeln(&g->cheaders, _SLIT("#include <stddef.h>"));
|
||||
} else {
|
||||
string tcc_undef_has_include = _SLIT("\n\011#if defined(__TINYC__) && defined(__has_include)\n\011// tcc does not support has_include properly yet, turn it off completely\n\011#undef __has_include\n\011#endif");
|
||||
string tcc_undef_has_include = _SLIT("\n#if defined(__TINYC__) && defined(__has_include)\n// tcc does not support has_include properly yet, turn it off completely\n#undef __has_include\n#endif");
|
||||
strings__Builder_writeln(&g->cheaders, tcc_undef_has_include);
|
||||
strings__Builder_writeln(&g->includes, tcc_undef_has_include);
|
||||
if (g->pref->os == v__pref__OS__freebsd) {
|
||||
|
@ -71658,18 +71715,18 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string
|
|||
}
|
||||
|
||||
VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t) {
|
||||
multi_return_string_string mr_37072 = v__gen__c__Gen_optional_type_name(g, t);
|
||||
string styp = mr_37072.arg0;
|
||||
string base = mr_37072.arg1;
|
||||
multi_return_string_string mr_37068 = v__gen__c__Gen_optional_type_name(g, t);
|
||||
string styp = mr_37068.arg0;
|
||||
string base = mr_37068.arg1;
|
||||
map_set(&g->optionals, &(string[]){base}, &(string[]) { styp });
|
||||
string _t1 = styp;
|
||||
return _t1;
|
||||
}
|
||||
|
||||
VV_LOCAL_SYMBOL string v__gen__c__Gen_register_result(v__gen__c__Gen* g, v__ast__Type t) {
|
||||
multi_return_string_string mr_37205 = v__gen__c__Gen_result_type_name(g, t);
|
||||
string styp = mr_37205.arg0;
|
||||
string base = mr_37205.arg1;
|
||||
multi_return_string_string mr_37201 = v__gen__c__Gen_result_type_name(g, t);
|
||||
string styp = mr_37201.arg0;
|
||||
string base = mr_37201.arg1;
|
||||
map_set(&g->results, &(string[]){base}, &(string[]) { styp });
|
||||
string _t1 = styp;
|
||||
return _t1;
|
||||
|
@ -72736,8 +72793,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g,
|
|||
*(multi_return_v__ast__StructField_Array_v__ast__Type*) _t4.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)};
|
||||
}
|
||||
|
||||
multi_return_v__ast__StructField_Array_v__ast__Type mr_65936 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data);
|
||||
Array_v__ast__Type embed_types = mr_65936.arg1;
|
||||
multi_return_v__ast__StructField_Array_v__ast__Type mr_65932 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data);
|
||||
Array_v__ast__Type embed_types = mr_65932.arg1;
|
||||
if (embed_types.len > 0) {
|
||||
v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types)));
|
||||
ptr = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}}));
|
||||
|
@ -72811,7 +72868,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex
|
|||
map_set(&g->referenced_fns->val, &(string[]){fname}, &(bool[]) { true });
|
||||
}
|
||||
sync__RwMutex_unlock(&g->referenced_fns->mtx);;
|
||||
fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}}));
|
||||
fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s = isnil(exp_sym) ? _SLIT("nil") : v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}}));
|
||||
if ((*exp_sym->info._v__ast__Interface).is_generic) {
|
||||
fname = v__gen__c__Gen_generic_fn_name(g, (*exp_sym->info._v__ast__Interface).concrete_types, fname, false);
|
||||
}
|
||||
|
@ -74282,11 +74339,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit
|
|||
string value_typ_str = v__gen__c__Gen_typ(g, unwrap_val_typ);
|
||||
v__ast__TypeSymbol* value_sym = v__ast__Table_sym(g->table, unwrap_val_typ);
|
||||
v__ast__TypeSymbol* key_sym = v__ast__Table_final_sym(g->table, unwrap_key_typ);
|
||||
multi_return_string_string_string_string mr_107766 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym);
|
||||
string hash_fn = mr_107766.arg0;
|
||||
string key_eq_fn = mr_107766.arg1;
|
||||
string clone_fn = mr_107766.arg2;
|
||||
string free_fn = mr_107766.arg3;
|
||||
multi_return_string_string_string_string mr_107762 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym);
|
||||
string hash_fn = mr_107762.arg0;
|
||||
string key_eq_fn = mr_107762.arg1;
|
||||
string clone_fn = mr_107762.arg2;
|
||||
string free_fn = mr_107762.arg3;
|
||||
int size = node.vals.len;
|
||||
string shared_styp = _SLIT("");
|
||||
string styp = _SLIT("");
|
||||
|
@ -75596,9 +75653,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_
|
|||
for (int _t3 = 0; _t3 < (*sym->info._v__ast__Struct).fields.len; ++_t3) {
|
||||
v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data)[_t3];
|
||||
if (v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__optional)) {
|
||||
multi_return_string_string mr_149616 = v__gen__c__Gen_optional_type_name(g, field.typ);
|
||||
string styp = mr_149616.arg0;
|
||||
string base = mr_149616.arg1;
|
||||
multi_return_string_string mr_149612 = v__gen__c__Gen_optional_type_name(g, field.typ);
|
||||
string styp = mr_149612.arg0;
|
||||
string base = mr_149612.arg1;
|
||||
sync__RwMutex_lock(&g->done_optionals->mtx);
|
||||
/*lock*/ {
|
||||
if (!Array_string_contains(g->done_optionals->val, base)) {
|
||||
|
@ -75932,11 +75989,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false;
|
|||
if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) {
|
||||
string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}}));
|
||||
if (g->pref->is_debug) {
|
||||
multi_return_int_string_string_string mr_159987 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_159987.arg0;
|
||||
string pafile = mr_159987.arg1;
|
||||
string pamod = mr_159987.arg2;
|
||||
string pafn = mr_159987.arg3;
|
||||
multi_return_int_string_string_string mr_159983 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_159983.arg0;
|
||||
string pafile = mr_159983.arg1;
|
||||
string pamod = mr_159983.arg2;
|
||||
string pafn = mr_159983.arg3;
|
||||
v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}})));
|
||||
} else {
|
||||
v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_result_not_set("), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}})));
|
||||
|
@ -75959,11 +76016,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false;
|
|||
if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) {
|
||||
string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}}));
|
||||
if (g->pref->is_debug) {
|
||||
multi_return_int_string_string_string mr_161257 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_161257.arg0;
|
||||
string pafile = mr_161257.arg1;
|
||||
string pamod = mr_161257.arg2;
|
||||
string pafn = mr_161257.arg3;
|
||||
multi_return_int_string_string_string mr_161253 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_161253.arg0;
|
||||
string pafile = mr_161253.arg1;
|
||||
string pamod = mr_161253.arg2;
|
||||
string pafn = mr_161253.arg3;
|
||||
v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}})));
|
||||
} else {
|
||||
v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_optional_not_set( "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}})));
|
||||
|
@ -76073,11 +76130,11 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty
|
|||
{
|
||||
v__ast__Map info = v__ast__TypeSymbol_map_info(sym);
|
||||
v__ast__TypeSymbol* key_typ = v__ast__Table_sym(g->table, info.key_type);
|
||||
multi_return_string_string_string_string mr_163865 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ);
|
||||
string hash_fn = mr_163865.arg0;
|
||||
string key_eq_fn = mr_163865.arg1;
|
||||
string clone_fn = mr_163865.arg2;
|
||||
string free_fn = mr_163865.arg3;
|
||||
multi_return_string_string_string_string mr_163861 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ);
|
||||
string hash_fn = mr_163861.arg0;
|
||||
string key_eq_fn = mr_163861.arg1;
|
||||
string clone_fn = mr_163861.arg2;
|
||||
string free_fn = mr_163861.arg3;
|
||||
string noscan_key = v__gen__c__Gen_check_noscan(g, info.key_type);
|
||||
string noscan_value = v__gen__c__Gen_check_noscan(g, info.value_type);
|
||||
string noscan = (noscan_key.len != 0 || noscan_value.len != 0 ? (_SLIT("_noscan")) : (_SLIT("")));
|
||||
|
@ -76606,8 +76663,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) {
|
|||
int params_start_pos = g->out.len;
|
||||
Array_v__ast__Param params = array_clone_to_depth(&method.params, 0);
|
||||
array_set(¶ms, 0, &(v__ast__Param[]) { ((v__ast__Param){(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).type_pos,.typ = v__ast__Type_set_nr_muls(st, 1),(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_mut,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_auto_rec,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,}) });
|
||||
multi_return_Array_string_Array_string_Array_bool mr_178892 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false);
|
||||
Array_string fargs = mr_178892.arg0;
|
||||
multi_return_Array_string_Array_string_Array_bool mr_178888 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false);
|
||||
Array_string fargs = mr_178888.arg0;
|
||||
string parameter_name = strings__Builder_cut_last(&g->out, g->out.len - params_start_pos);
|
||||
if (v__ast__Type_is_ptr(st)) {
|
||||
parameter_name = string_trim_string_left(parameter_name, _SLIT("__shared__"));
|
||||
|
@ -76624,8 +76681,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) {
|
|||
*(multi_return_v__ast__Fn_Array_v__ast__Type*) _t26.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.dep_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)};
|
||||
}
|
||||
|
||||
multi_return_v__ast__Fn_Array_v__ast__Type mr_179356 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data);
|
||||
Array_v__ast__Type embed_types = mr_179356.arg1;
|
||||
multi_return_v__ast__Fn_Array_v__ast__Type mr_179352 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data);
|
||||
Array_v__ast__Type embed_types = mr_179352.arg1;
|
||||
if (embed_types.len > 0 && !Array_string_contains(method_names, method.name)) {
|
||||
v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types)));
|
||||
string method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}}));
|
||||
|
@ -84716,7 +84773,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast
|
|||
bool is_var_mut = v__ast__Expr_is_auto_deref_var(expr);
|
||||
string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ);
|
||||
if (is_ptr && !is_var_mut) {
|
||||
v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s="), 0, { .d_c = 0 }}})));
|
||||
v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s = isnil("), 0, { .d_c = 0 }}})));
|
||||
v__gen__c__Gen_expr(g, expr);
|
||||
v__gen__c__Gen_write(g, _SLIT(") ? _SLIT(\"nil\") : "));
|
||||
}
|
||||
v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}})));
|
||||
if (str_method_expects_ptr && !is_ptr) {
|
||||
|
@ -84764,7 +84823,7 @@ VV_LOCAL_SYMBOL multi_return_u64_string v__gen__c__Gen_str_format(v__gen__c__Gen
|
|||
bool remove_tail_zeros = false;
|
||||
u8 fspec = (*(u8*)/*ee elem_sym */array_get(node.fmts, i));
|
||||
StrIntpType fmt_type = ((StrIntpType){0});
|
||||
v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*117 &u8*/0xfe02, {.d_u8 = fspec}}, {_SLIT(" "), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/"), 0, { .d_c = 0 }}})));
|
||||
v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*117 &u8*/0xfe02, {.d_u8 = fspec}}, {_SLIT(" "), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s = isnil(sym) ? _SLIT("nil") : v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/"), 0, { .d_c = 0 }}})));
|
||||
if ((fspec - 'A') <= ('Z' - 'A')) {
|
||||
upper_case = true;
|
||||
}
|
||||
|
@ -100866,6 +100925,7 @@ void _vinit(int ___argc, voidptr ___argv) {
|
|||
_const_os__path_delimiter = _SLIT(":");
|
||||
_const_os__args = os__init_os_args(___argc, (byte**)___argv);
|
||||
_const_os__wd_at_startup = os__getwd();
|
||||
_const_os__executable_suffixes = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("")}));
|
||||
// Initializations for module v.util.version
|
||||
_const_v__util__version__v_version = _SLIT("0.2.4");
|
||||
// Initializations for module v.vmod
|
||||
|
|
134
v_win.c
134
v_win.c
|
@ -1,11 +1,11 @@
|
|||
#define V_COMMIT_HASH "460c2ee77"
|
||||
#define V_COMMIT_HASH "e9aca1256"
|
||||
|
||||
#ifndef V_COMMIT_HASH
|
||||
#define V_COMMIT_HASH "398db2138"
|
||||
#define V_COMMIT_HASH "460c2ee77"
|
||||
#endif
|
||||
|
||||
#ifndef V_CURRENT_COMMIT_HASH
|
||||
#define V_CURRENT_COMMIT_HASH "460c2ee"
|
||||
#define V_CURRENT_COMMIT_HASH "e9aca12"
|
||||
#endif
|
||||
|
||||
#define V_USE_SIGNAL_H
|
||||
|
@ -7364,6 +7364,7 @@ int string_last_index_u8(string s, u8 c);
|
|||
int string_count(string s, string substr);
|
||||
bool string_contains(string s, string substr);
|
||||
bool string_contains_any(string s, string chars);
|
||||
bool string_contains_only(string s, string chars);
|
||||
bool string_contains_any_substr(string s, Array_string substrs);
|
||||
bool string_starts_with(string s, string p);
|
||||
bool string_ends_with(string s, string p);
|
||||
|
@ -10183,6 +10184,7 @@ rune _const_os__dot = '.'; // precomputed
|
|||
rune _const_os__qmark = '?'; // precomputed
|
||||
Array_string _const_os__args; // inited later
|
||||
string _const_os__wd_at_startup; // inited later
|
||||
Array_string _const_os__executable_suffixes; // inited later
|
||||
Array_string _const_v__vmod__mod_file_stop_paths; // inited later
|
||||
v__vmod__ModFileCacher* _const_v__vmod__private_file_cacher; // inited later
|
||||
u64 _const_rand__wyrand__wyp0 = 11562461410679940143U; // precomputed
|
||||
|
@ -22983,6 +22985,23 @@ bool string_contains_any(string s, string chars) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool string_contains_only(string s, string chars) {
|
||||
if (chars.len == 0) {
|
||||
return false;
|
||||
}
|
||||
for (int _t2 = 0; _t2 < s.len; ++_t2) {
|
||||
u8 ch = s.str[_t2];
|
||||
int res = 0;
|
||||
for (int i = 0; i < chars.len && res == 0; i++) {
|
||||
res += (int[]){(ch == chars.str[i])?1:0}[0];
|
||||
}
|
||||
if (res == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool string_contains_any_substr(string s, Array_string substrs) {
|
||||
if (substrs.len == 0) {
|
||||
return true;
|
||||
|
@ -30860,7 +30879,7 @@ bool os__exists(string path) {
|
|||
|
||||
bool os__is_executable(string path) {
|
||||
string p = os__real_path(path);
|
||||
bool _t1 = os__exists(p) && string_ends_with(p, _SLIT(".exe"));
|
||||
bool _t1 = os__exists(p) && (string_ends_with(p, _SLIT(".exe")) || string_ends_with(p, _SLIT(".bat")) || string_ends_with(p, _SLIT(".cmd")));
|
||||
return _t1;
|
||||
bool _t2 = access(((char*)(path.str)), _const_os__x_ok) != -1;
|
||||
return _t2;
|
||||
|
@ -32052,26 +32071,30 @@ _option_string os__find_abs_path_of_executable(string exepath) {
|
|||
if ((exepath).len == 0) {
|
||||
return (_option_string){ .state=2, .err=_v_error(_SLIT("expected non empty `exepath`")), .data={EMPTY_STRUCT_INITIALIZATION} };
|
||||
}
|
||||
if (os__is_abs_path(exepath)) {
|
||||
_option_string _t2;
|
||||
opt_ok2(&(string[]) { os__real_path(exepath) }, (_option*)(&_t2), sizeof(string));
|
||||
return _t2;
|
||||
for (int _t2 = 0; _t2 < _const_os__executable_suffixes.len; ++_t2) {
|
||||
string suffix = ((string*)_const_os__executable_suffixes.data)[_t2];
|
||||
string fexepath = string__plus(exepath, suffix);
|
||||
if (os__is_abs_path(fexepath)) {
|
||||
_option_string _t3;
|
||||
opt_ok2(&(string[]) { os__real_path(fexepath) }, (_option*)(&_t3), sizeof(string));
|
||||
return _t3;
|
||||
}
|
||||
string res = _SLIT("");
|
||||
string path = os__getenv(_SLIT("PATH"));
|
||||
Array_string paths = string_split(path, _const_os__path_delimiter);
|
||||
for (int _t3 = 0; _t3 < paths.len; ++_t3) {
|
||||
string p = ((string*)paths.data)[_t3];
|
||||
string found_abs_path = os__join_path_single(p, exepath);
|
||||
for (int _t4 = 0; _t4 < paths.len; ++_t4) {
|
||||
string p = ((string*)paths.data)[_t4];
|
||||
string found_abs_path = os__join_path_single(p, fexepath);
|
||||
if (os__exists(found_abs_path) && os__is_executable(found_abs_path)) {
|
||||
res = found_abs_path;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (res.len > 0) {
|
||||
_option_string _t4;
|
||||
opt_ok2(&(string[]) { os__real_path(res) }, (_option*)(&_t4), sizeof(string));
|
||||
return _t4;
|
||||
_option_string _t5;
|
||||
opt_ok2(&(string[]) { os__real_path(res) }, (_option*)(&_t5), sizeof(string));
|
||||
return _t5;
|
||||
}
|
||||
}
|
||||
return (_option_string){ .state=2, .err=os__error_failed_to_find_executable(), .data={EMPTY_STRUCT_INITIALIZATION} };
|
||||
}
|
||||
|
@ -36926,7 +36949,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) {
|
|||
if ((p->third_party_option).len == 0) {
|
||||
p->third_party_option = p->cflags;
|
||||
}
|
||||
string vhash = _SLIT("398db2138");
|
||||
string vhash = _SLIT("460c2ee77");
|
||||
p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))})));
|
||||
if (string__eq(os__user_os(), _SLIT("windows"))) {
|
||||
p->use_cache = false;
|
||||
|
@ -69054,7 +69077,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) {
|
|||
strings__Builder_writeln(&g->cheaders, _SLIT("#include <stdint.h>"));
|
||||
strings__Builder_writeln(&g->cheaders, _SLIT("#include <stddef.h>"));
|
||||
} else {
|
||||
string tcc_undef_has_include = _SLIT("\n\011#if defined(__TINYC__) && defined(__has_include)\n\011// tcc does not support has_include properly yet, turn it off completely\n\011#undef __has_include\n\011#endif");
|
||||
string tcc_undef_has_include = _SLIT("\n#if defined(__TINYC__) && defined(__has_include)\n// tcc does not support has_include properly yet, turn it off completely\n#undef __has_include\n#endif");
|
||||
strings__Builder_writeln(&g->cheaders, tcc_undef_has_include);
|
||||
strings__Builder_writeln(&g->includes, tcc_undef_has_include);
|
||||
if (g->pref->os == v__pref__OS__freebsd) {
|
||||
|
@ -69397,18 +69420,18 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string
|
|||
}
|
||||
|
||||
VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t) {
|
||||
multi_return_string_string mr_37072 = v__gen__c__Gen_optional_type_name(g, t);
|
||||
string styp = mr_37072.arg0;
|
||||
string base = mr_37072.arg1;
|
||||
multi_return_string_string mr_37068 = v__gen__c__Gen_optional_type_name(g, t);
|
||||
string styp = mr_37068.arg0;
|
||||
string base = mr_37068.arg1;
|
||||
map_set(&g->optionals, &(string[]){base}, &(string[]) { styp });
|
||||
string _t1 = styp;
|
||||
return _t1;
|
||||
}
|
||||
|
||||
VV_LOCAL_SYMBOL string v__gen__c__Gen_register_result(v__gen__c__Gen* g, v__ast__Type t) {
|
||||
multi_return_string_string mr_37205 = v__gen__c__Gen_result_type_name(g, t);
|
||||
string styp = mr_37205.arg0;
|
||||
string base = mr_37205.arg1;
|
||||
multi_return_string_string mr_37201 = v__gen__c__Gen_result_type_name(g, t);
|
||||
string styp = mr_37201.arg0;
|
||||
string base = mr_37201.arg1;
|
||||
map_set(&g->results, &(string[]){base}, &(string[]) { styp });
|
||||
string _t1 = styp;
|
||||
return _t1;
|
||||
|
@ -70455,8 +70478,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g,
|
|||
*(multi_return_v__ast__StructField_Array_v__ast__Type*) _t4.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)};
|
||||
}
|
||||
|
||||
multi_return_v__ast__StructField_Array_v__ast__Type mr_65936 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data);
|
||||
Array_v__ast__Type embed_types = mr_65936.arg1;
|
||||
multi_return_v__ast__StructField_Array_v__ast__Type mr_65932 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data);
|
||||
Array_v__ast__Type embed_types = mr_65932.arg1;
|
||||
if (embed_types.len > 0) {
|
||||
v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types)));
|
||||
ptr = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}}));
|
||||
|
@ -70530,7 +70553,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex
|
|||
map_set(&g->referenced_fns->val, &(string[]){fname}, &(bool[]) { true });
|
||||
}
|
||||
sync__RwMutex_unlock(&g->referenced_fns->mtx);;
|
||||
fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}}));
|
||||
fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s = isnil(exp_sym) ? _SLIT("nil") : v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}}));
|
||||
if ((*exp_sym->info._v__ast__Interface).is_generic) {
|
||||
fname = v__gen__c__Gen_generic_fn_name(g, (*exp_sym->info._v__ast__Interface).concrete_types, fname, false);
|
||||
}
|
||||
|
@ -72001,11 +72024,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit
|
|||
string value_typ_str = v__gen__c__Gen_typ(g, unwrap_val_typ);
|
||||
v__ast__TypeSymbol* value_sym = v__ast__Table_sym(g->table, unwrap_val_typ);
|
||||
v__ast__TypeSymbol* key_sym = v__ast__Table_final_sym(g->table, unwrap_key_typ);
|
||||
multi_return_string_string_string_string mr_107766 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym);
|
||||
string hash_fn = mr_107766.arg0;
|
||||
string key_eq_fn = mr_107766.arg1;
|
||||
string clone_fn = mr_107766.arg2;
|
||||
string free_fn = mr_107766.arg3;
|
||||
multi_return_string_string_string_string mr_107762 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym);
|
||||
string hash_fn = mr_107762.arg0;
|
||||
string key_eq_fn = mr_107762.arg1;
|
||||
string clone_fn = mr_107762.arg2;
|
||||
string free_fn = mr_107762.arg3;
|
||||
int size = node.vals.len;
|
||||
string shared_styp = _SLIT("");
|
||||
string styp = _SLIT("");
|
||||
|
@ -73300,9 +73323,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_
|
|||
for (int _t3 = 0; _t3 < (*sym->info._v__ast__Struct).fields.len; ++_t3) {
|
||||
v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data)[_t3];
|
||||
if (v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__optional)) {
|
||||
multi_return_string_string mr_149616 = v__gen__c__Gen_optional_type_name(g, field.typ);
|
||||
string styp = mr_149616.arg0;
|
||||
string base = mr_149616.arg1;
|
||||
multi_return_string_string mr_149612 = v__gen__c__Gen_optional_type_name(g, field.typ);
|
||||
string styp = mr_149612.arg0;
|
||||
string base = mr_149612.arg1;
|
||||
sync__RwMutex_lock(&g->done_optionals->mtx);
|
||||
/*lock*/ {
|
||||
if (!Array_string_contains(g->done_optionals->val, base)) {
|
||||
|
@ -73636,11 +73659,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false;
|
|||
if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) {
|
||||
string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}}));
|
||||
if (g->pref->is_debug) {
|
||||
multi_return_int_string_string_string mr_159987 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_159987.arg0;
|
||||
string pafile = mr_159987.arg1;
|
||||
string pamod = mr_159987.arg2;
|
||||
string pafn = mr_159987.arg3;
|
||||
multi_return_int_string_string_string mr_159983 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_159983.arg0;
|
||||
string pafile = mr_159983.arg1;
|
||||
string pamod = mr_159983.arg2;
|
||||
string pafn = mr_159983.arg3;
|
||||
v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}})));
|
||||
} else {
|
||||
v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_result_not_set("), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}})));
|
||||
|
@ -73663,11 +73686,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false;
|
|||
if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) {
|
||||
string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}}));
|
||||
if (g->pref->is_debug) {
|
||||
multi_return_int_string_string_string mr_161257 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_161257.arg0;
|
||||
string pafile = mr_161257.arg1;
|
||||
string pamod = mr_161257.arg2;
|
||||
string pafn = mr_161257.arg3;
|
||||
multi_return_int_string_string_string mr_161253 = v__gen__c__Gen_panic_debug_info(g, or_block.pos);
|
||||
int paline = mr_161253.arg0;
|
||||
string pafile = mr_161253.arg1;
|
||||
string pamod = mr_161253.arg2;
|
||||
string pafn = mr_161253.arg3;
|
||||
v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}})));
|
||||
} else {
|
||||
v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_optional_not_set( "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}})));
|
||||
|
@ -73777,11 +73800,11 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty
|
|||
{
|
||||
v__ast__Map info = v__ast__TypeSymbol_map_info(sym);
|
||||
v__ast__TypeSymbol* key_typ = v__ast__Table_sym(g->table, info.key_type);
|
||||
multi_return_string_string_string_string mr_163865 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ);
|
||||
string hash_fn = mr_163865.arg0;
|
||||
string key_eq_fn = mr_163865.arg1;
|
||||
string clone_fn = mr_163865.arg2;
|
||||
string free_fn = mr_163865.arg3;
|
||||
multi_return_string_string_string_string mr_163861 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ);
|
||||
string hash_fn = mr_163861.arg0;
|
||||
string key_eq_fn = mr_163861.arg1;
|
||||
string clone_fn = mr_163861.arg2;
|
||||
string free_fn = mr_163861.arg3;
|
||||
string noscan_key = v__gen__c__Gen_check_noscan(g, info.key_type);
|
||||
string noscan_value = v__gen__c__Gen_check_noscan(g, info.value_type);
|
||||
string noscan = (noscan_key.len != 0 || noscan_value.len != 0 ? (_SLIT("_noscan")) : (_SLIT("")));
|
||||
|
@ -74305,8 +74328,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) {
|
|||
int params_start_pos = g->out.len;
|
||||
Array_v__ast__Param params = array_clone_to_depth(&method.params, 0);
|
||||
array_set(¶ms, 0, &(v__ast__Param[]) { ((v__ast__Param){(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).type_pos,.typ = v__ast__Type_set_nr_muls(st, 1),(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_mut,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_auto_rec,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,}) });
|
||||
multi_return_Array_string_Array_string_Array_bool mr_178892 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false);
|
||||
Array_string fargs = mr_178892.arg0;
|
||||
multi_return_Array_string_Array_string_Array_bool mr_178888 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false);
|
||||
Array_string fargs = mr_178888.arg0;
|
||||
string parameter_name = strings__Builder_cut_last(&g->out, g->out.len - params_start_pos);
|
||||
if (v__ast__Type_is_ptr(st)) {
|
||||
parameter_name = string_trim_string_left(parameter_name, _SLIT("__shared__"));
|
||||
|
@ -74323,8 +74346,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) {
|
|||
*(multi_return_v__ast__Fn_Array_v__ast__Type*) _t26.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.dep_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)};
|
||||
}
|
||||
|
||||
multi_return_v__ast__Fn_Array_v__ast__Type mr_179356 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data);
|
||||
Array_v__ast__Type embed_types = mr_179356.arg1;
|
||||
multi_return_v__ast__Fn_Array_v__ast__Type mr_179352 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data);
|
||||
Array_v__ast__Type embed_types = mr_179352.arg1;
|
||||
if (embed_types.len > 0 && !Array_string_contains(method_names, method.name)) {
|
||||
v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types)));
|
||||
string method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}}));
|
||||
|
@ -82341,7 +82364,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast
|
|||
bool is_var_mut = v__ast__Expr_is_auto_deref_var(expr);
|
||||
string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ);
|
||||
if (is_ptr && !is_var_mut) {
|
||||
v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s="), 0, { .d_c = 0 }}})));
|
||||
v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s = isnil("), 0, { .d_c = 0 }}})));
|
||||
v__gen__c__Gen_expr(g, expr);
|
||||
v__gen__c__Gen_write(g, _SLIT(") ? _SLIT(\"nil\") : "));
|
||||
}
|
||||
v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}})));
|
||||
if (str_method_expects_ptr && !is_ptr) {
|
||||
|
@ -82389,7 +82414,7 @@ VV_LOCAL_SYMBOL multi_return_u64_string v__gen__c__Gen_str_format(v__gen__c__Gen
|
|||
bool remove_tail_zeros = false;
|
||||
u8 fspec = (*(u8*)/*ee elem_sym */array_get(node.fmts, i));
|
||||
StrIntpType fmt_type = ((StrIntpType){0});
|
||||
v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*117 &u8*/0xfe02, {.d_u8 = fspec}}, {_SLIT(" "), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/"), 0, { .d_c = 0 }}})));
|
||||
v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*117 &u8*/0xfe02, {.d_u8 = fspec}}, {_SLIT(" "), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s = isnil(sym) ? _SLIT("nil") : v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/"), 0, { .d_c = 0 }}})));
|
||||
if ((fspec - 'A') <= ('Z' - 'A')) {
|
||||
upper_case = true;
|
||||
}
|
||||
|
@ -98165,6 +98190,7 @@ void _vinit(int ___argc, voidptr ___argv) {
|
|||
_const_os__hwnd_broadcast = ((voidptr)(0xFFFF));
|
||||
_const_os__args = os__init_os_args_wide(___argc, (byteptr*)___argv);
|
||||
_const_os__wd_at_startup = os__getwd();
|
||||
_const_os__executable_suffixes = new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT(".exe"), _SLIT(".bat"), _SLIT(".cmd"), _SLIT("")}));
|
||||
// Initializations for module v.util.version
|
||||
_const_v__util__version__v_version = _SLIT("0.2.4");
|
||||
// Initializations for module v.vmod
|
||||
|
|
Loading…
Reference in New Issue